diff --git a/mobile/src/main/java/com/github/shadowsocks/App.kt b/mobile/src/main/java/com/github/shadowsocks/App.kt index a59306f5..78b6da6f 100644 --- a/mobile/src/main/java/com/github/shadowsocks/App.kt +++ b/mobile/src/main/java/com/github/shadowsocks/App.kt @@ -203,6 +203,16 @@ class App : Application() { DataStore.publicStore.putLong(Key.assetUpdateTime, info.lastUpdateTime) } + updateNotificationChannels() + } + + override fun onConfigurationChanged(newConfig: Configuration) { + super.onConfigurationChanged(newConfig) + checkChineseLocale(newConfig) + updateNotificationChannels() + } + + private fun updateNotificationChannels() { if (Build.VERSION.SDK_INT >= 26) @RequiresApi(26) { val nm = getSystemService(NotificationManager::class.java) nm.createNotificationChannels(listOf( @@ -216,11 +226,6 @@ class App : Application() { } } - override fun onConfigurationChanged(newConfig: Configuration) { - super.onConfigurationChanged(newConfig) - checkChineseLocale(newConfig) - } - fun listenForPackageChanges(callback: () -> Unit): BroadcastReceiver { val filter = IntentFilter(Intent.ACTION_PACKAGE_ADDED) filter.addAction(Intent.ACTION_PACKAGE_REMOVED)