Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
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
Data Recovery White
Commits
ff4b1cd6
Commit
ff4b1cd6
authored
Jul 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
834a7855
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
16 deletions
+17
-16
NotificationUtil.kt
...c/main/java/com/base/datarecovery/fcm/NotificationUtil.kt
+11
-10
EventUtils.kt
app/src/main/java/com/base/datarecovery/utils/EventUtils.kt
+6
-6
No files found.
app/src/main/java/com/base/datarecovery/fcm/NotificationUtil.kt
View file @
ff4b1cd6
...
...
@@ -25,6 +25,7 @@ import com.base.datarecovery.bean.ConstObject.ID_SIMILAR_IMAGE
import
com.base.datarecovery.utils.AppPreferences
import
com.base.datarecovery.utils.CleanJunkStringResourceManager
import
com.base.datarecovery.utils.DuplicatePhotoStringResourceManager
import
com.base.datarecovery.utils.EventUtils
import
com.base.datarecovery.utils.ScreenshotCleanupStringManager
import
java.util.Random
...
...
@@ -189,14 +190,14 @@ object NotificationUtil {
private
var
handler
:
Handler
?
=
null
fun
sendNotification
(
context
:
Context
)
{
val
actionId
:
Int
=
getNextNotificationId
()
// KParameter.Kind.INSTANCE
.event("showNotification", null, null, false)
val
actionId
:
Int
=
getNextNotificationId
()
EventUtils
.
event
(
"showNotification"
,
null
,
null
,
false
)
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
return
}
val
interval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"notificationInterval"
,
"60"
).
toIntOrNull
()
?:
60
val
interval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"notificationInterval"
,
"60"
).
toIntOrNull
()
?:
60
val
lastTime
:
Long
=
AppPreferences
.
getInstance
().
getLong
(
"last_notification_time"
,
0
)
val
nowTime
=
System
.
currentTimeMillis
()
val
x
=
nowTime
-
lastTime
...
...
@@ -204,13 +205,13 @@ object NotificationUtil {
return
}
sendNotification
(
context
,
actionId
)
sendNotification
(
context
,
actionId
)
val
open
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"open"
,
"0"
).
toIntOrNull
()
?:
0
val
open
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"open"
,
"0"
).
toIntOrNull
()
?:
0
if
(
open
==
1
)
{
val
num
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"num"
,
"0"
).
toIntOrNull
()
?:
0
val
delay
:
Long
=
AppPreferences
.
getInstance
().
getString
(
"delay"
,
"0"
).
toLongOrNull
()
?:
0L
val
num
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"num"
,
"0"
).
toIntOrNull
()
?:
0
val
delay
:
Long
=
AppPreferences
.
getInstance
().
getString
(
"delay"
,
"0"
).
toLongOrNull
()
?:
0L
handlerThread
=
HandlerThread
(
"NotificationHandlerThread"
)
handlerThread
!!
.
start
()
...
...
@@ -224,7 +225,7 @@ object NotificationUtil {
return
@Runnable
}
if
(
MyApplication
.
PAUSED_VALUE
!==
1
)
{
sendNotification
(
context
,
actionId
)
sendNotification
(
context
,
actionId
)
}
},
time
)
}
...
...
@@ -238,10 +239,10 @@ object NotificationUtil {
handler
?.
removeCallbacksAndMessages
(
null
)
}
if
(
handlerThread
!=
null
)
{
handlerThread
?.
quit
()
handlerThread
?.
quit
()
handlerThread
=
null
}
handler
=
null
handler
=
null
}
private
var
currentNotificationIdIndex
=
-
1
...
...
app/src/main/java/com/base/datarecovery/utils/EventUtils.kt
View file @
ff4b1cd6
...
...
@@ -22,12 +22,12 @@ object EventUtils {
}
//
if (isSingleEvent) {
// val stringSet = AppPreferences.getInstance().getString("singleEvent"
)
//
if (stringSet.contains(key)) {
//
return
//
}
//
}
if
(
isSingleEvent
)
{
val
stringSet
=
AppPreferences
.
getInstance
().
getStringSet
(
"singleEvent"
,
setOf
()
)
if
(
stringSet
.
contains
(
key
))
{
return
}
}
Thread
{
var
parmJson
:
String
?
=
""
...
...
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