Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 867ac0c

Browse files
author
胡晟昊
committed
fix: stop service crash
1 parent 8063228 commit 867ac0c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/main/java/com/dede/nativetools/netspeed/service/NetSpeedService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ class NetSpeedService : Service(), Runnable {
183183
override fun onDestroy() {
184184
lifecycleJob.cancel()
185185
netSpeedCompute.destroy()
186-
stopForeground(STOP_FOREGROUND_REMOVE)
186+
@Suppress("DEPRECATION")
187+
stopForeground(true)
187188
notificationManager.cancel(NetSpeedNotificationHelper.NOTIFICATION_ID)
188189
broadcastHelper.unregister(this)
189190
super.onDestroy()

app/src/main/java/com/dede/nativetools/netspeed/typeface/TypefaceGetter.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ interface TypefaceGetter {
3636
if (fontList.contains(key)) {
3737
DownloadTypefaceImpl(appContext, "$key.ttf")
3838
} else {
39-
throw IllegalStateException("Unknown font name: $key")
39+
NormalTypeface()
40+
//throw IllegalStateException("Unknown font name: $key")
4041
}
4142
}
4243
}

0 commit comments

Comments
 (0)