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
c03f07f5
Commit
c03f07f5
authored
Jul 12, 2024
by
leichao.gao
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
d5162d74
ff4b1cd6
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 @
c03f07f5
...
...
@@ -26,6 +26,7 @@ import com.base.datarecovery.utils.AppPreferences
import
com.base.datarecovery.utils.CleanJunkStringResourceManager
import
com.base.datarecovery.utils.DocumentRecoveryStringManager
import
com.base.datarecovery.utils.DuplicatePhotoStringResourceManager
import
com.base.datarecovery.utils.EventUtils
import
com.base.datarecovery.utils.PhotoRecoveryStringManager
import
com.base.datarecovery.utils.PrivacySpaceStringManager
import
com.base.datarecovery.utils.ScreenshotCleanupStringManager
...
...
@@ -193,14 +194,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
...
...
@@ -208,13 +209,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
()
...
...
@@ -228,7 +229,7 @@ object NotificationUtil {
return
@Runnable
}
if
(
MyApplication
.
PAUSED_VALUE
!==
1
)
{
sendNotification
(
context
,
actionId
)
sendNotification
(
context
,
actionId
)
}
},
time
)
}
...
...
@@ -242,10 +243,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 @
c03f07f5
...
...
@@ -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