Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
swiftcleanerphonehelper
Commits
77f295db
Commit
77f295db
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
a68b65da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
NotificationUtils.kt
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
+19
-2
No files found.
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
View file @
77f295db
...
...
@@ -118,12 +118,22 @@ object NotificationUtils {
}
private
var
lastNotificationTime
=
0L
fun
sendNotification
(
context
:
Context
,
where
:
String
)
{
if
(
isDeviceLocked
||
isAppInForeground
||
!
isScreenOn
)
{
return
}
val
actionId
=
nextNotificationId
val
intervalTime
=
System
.
currentTimeMillis
()
-
lastNotificationTime
val
spInterval
=
SpUtils
.
getInstance
().
getInt
(
"NotificationInterval"
,
1
)
val
oneMinute
=
1
*
60
*
1000L
Log
.
e
(
"sendNotification"
,
"where=$where actionId=$actionId intervalTime=$intervalTime spInterval=$spInterval"
)
if
(
lastNotificationTime
!=
0L
&&
intervalTime
<
spInterval
*
oneMinute
)
{
return
}
val
bigRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common
)
val
smallRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common_small
)
var
intentAction
=
""
...
...
@@ -138,9 +148,11 @@ object NotificationUtils {
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_APP_MANAGER
->
{
}
FUNCTION_BATTERY
->
{
}
...
...
@@ -148,15 +160,19 @@ object NotificationUtils {
FUNCTION_LARGE_FILE
->
{
}
FUNCTION_WHATS_APP
->
{
FUNCTION_WHATS_APP
->
{
}
FUNCTION_APP_PROCESS
->
{
}
FUNCTION_SIMILAR_PHOTOS
->
{
}
FUNCTION_SCREENSHOT
->
{
}
...
...
@@ -183,6 +199,7 @@ object NotificationUtils {
bigRemoteViews
,
smallRemoteViews
,
)
lastNotificationTime
=
System
.
currentTimeMillis
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment