Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
184f554d
Commit
184f554d
authored
Jan 23, 2025
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修复】同步修复部分可能的崩溃
parent
63404314
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
NotificationUtil.kt
...a/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
+4
-3
StayJobService.kt
...com/base/filerecoveryrecyclebin/service/StayJobService.kt
+2
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
View file @
184f554d
...
@@ -447,10 +447,11 @@ object NotificationUtil {
...
@@ -447,10 +447,11 @@ object NotificationUtil {
val
delay
:
Long
=
val
delay
:
Long
=
AppPreferences
.
getInstance
().
getString
(
"delay"
,
"0"
).
toLongOrNull
()
?:
0L
AppPreferences
.
getInstance
().
getString
(
"delay"
,
"0"
).
toLongOrNull
()
?:
0L
handlerThread
=
HandlerThread
(
"NotificationHandlerThread"
)
handlerThread
=
HandlerThread
(
"NotificationHandlerThread"
)
handlerThread
!!
.
start
()
handlerThread
?.
start
()
handlerThread
?.
let
{
if
(
it
.
isAlive
&&
it
.
looper
!=
null
)
handler
=
Handler
(
it
.
looper
)
}
// 创建 Handler
handler
=
Handler
(
handlerThread
!!
.
looper
)
for
(
i
in
1
..
num
)
{
for
(
i
in
1
..
num
)
{
val
time
=
i
*
delay
val
time
=
i
*
delay
handler
?.
postDelayed
(
Runnable
{
handler
?.
postDelayed
(
Runnable
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/service/StayJobService.kt
View file @
184f554d
...
@@ -125,6 +125,7 @@ class StayJobService : JobService() {
...
@@ -125,6 +125,7 @@ class StayJobService : JobService() {
private
fun
startForeground
()
{
private
fun
startForeground
()
{
val
notification
=
createPermanentNotification
(
applicationContext
)
val
notification
=
createPermanentNotification
(
applicationContext
)
runCatching
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
startForeground
(
startForeground
(
NOTIFICATION_PERMANENT_ID
,
NOTIFICATION_PERMANENT_ID
,
...
@@ -133,7 +134,7 @@ class StayJobService : JobService() {
...
@@ -133,7 +134,7 @@ class StayJobService : JobService() {
)
)
}
else
{
}
else
{
startForeground
(
NOTIFICATION_PERMANENT_ID
,
notification
)
startForeground
(
NOTIFICATION_PERMANENT_ID
,
notification
)
}
}
}
isRunning
=
true
isRunning
=
true
}
}
...
...
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