diff --git a/service/src/main/java/com/github/kr328/clash/service/ClashCore.kt b/service/src/main/java/com/github/kr328/clash/service/ClashCore.kt index 50d5b8f..e13c789 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ClashCore.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ClashCore.kt @@ -143,6 +143,9 @@ class ClashCore(private val service: Service) : CoroutineScope by MainScope() { notification.setProfile(active.name) + if (!settings.get(ServiceSettings.NOTIFICATION_REFRESH)) + notification.updateBase() + broadcastProfileLoaded(service) } catch (e: Exception) { stopSelf(e.message ?: "Unknown") diff --git a/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt b/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt index f57a895..ce43c18 100644 --- a/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt +++ b/service/src/main/java/com/github/kr328/clash/service/ClashNotification.kt @@ -66,7 +66,7 @@ class ClashNotification( context.startForeground(CLASH_STATUS_NOTIFICATION_ID, notification) } - private fun updateBase() { + fun updateBase() { val notification = baseBuilder .setContentTitle(currentProfile) .setContentText(context.getText(R.string.running))