Loading app/src/main/kotlin/at/bitfire/davdroid/receiver/BootCompletedReceiver.kt +6 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import at.bitfire.davdroid.ui.NotificationUtils import at.bitfire.davdroid.ui.NotificationUtils.CHANNEL_GENERAL import at.bitfire.davdroid.ui.NotificationUtils.NOTIFY_SWITCH_TO_OPENID import at.bitfire.davdroid.ui.NotificationUtils.notifyIfPossible import at.bitfire.davdroid.ui.setup.LoginActivity.Companion.ACCOUNT_TYPE import at.bitfire.davdroid.ui.setup.LoginActivity.Companion.EXTRA_USERNAME import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob Loading Loading @@ -79,7 +81,7 @@ class BootCompletedReceiver: BroadcastReceiver() { private fun notifySwitchToOpenId(account: Account, context: Context) { val title = context.getString(R.string.notification_account_title, account.name) val contentText = context.getString(R.string.notification_switch_to_openId_text) val intent = generateReLoginIntent(context) val intent = generateReLoginIntent(account, context) val notification = NotificationUtils.newBuilder(context, CHANNEL_GENERAL) .setContentTitle(title) Loading @@ -93,9 +95,11 @@ class BootCompletedReceiver: BroadcastReceiver() { notificationManager.notifyIfPossible(NOTIFICATION_TAG, NOTIFY_SWITCH_TO_OPENID, notification) } private fun generateReLoginIntent(context: Context): PendingIntent { private fun generateReLoginIntent(account: Account, context: Context): PendingIntent { val reLoginIntent = Intent(context, ReLoginWithOidcActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK putExtra(ACCOUNT_TYPE, account.type) putExtra(EXTRA_USERNAME, account.name) } return PendingIntent.getActivity(context, Loading Loading
app/src/main/kotlin/at/bitfire/davdroid/receiver/BootCompletedReceiver.kt +6 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import at.bitfire.davdroid.ui.NotificationUtils import at.bitfire.davdroid.ui.NotificationUtils.CHANNEL_GENERAL import at.bitfire.davdroid.ui.NotificationUtils.NOTIFY_SWITCH_TO_OPENID import at.bitfire.davdroid.ui.NotificationUtils.notifyIfPossible import at.bitfire.davdroid.ui.setup.LoginActivity.Companion.ACCOUNT_TYPE import at.bitfire.davdroid.ui.setup.LoginActivity.Companion.EXTRA_USERNAME import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob Loading Loading @@ -79,7 +81,7 @@ class BootCompletedReceiver: BroadcastReceiver() { private fun notifySwitchToOpenId(account: Account, context: Context) { val title = context.getString(R.string.notification_account_title, account.name) val contentText = context.getString(R.string.notification_switch_to_openId_text) val intent = generateReLoginIntent(context) val intent = generateReLoginIntent(account, context) val notification = NotificationUtils.newBuilder(context, CHANNEL_GENERAL) .setContentTitle(title) Loading @@ -93,9 +95,11 @@ class BootCompletedReceiver: BroadcastReceiver() { notificationManager.notifyIfPossible(NOTIFICATION_TAG, NOTIFY_SWITCH_TO_OPENID, notification) } private fun generateReLoginIntent(context: Context): PendingIntent { private fun generateReLoginIntent(account: Account, context: Context): PendingIntent { val reLoginIntent = Intent(context, ReLoginWithOidcActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK putExtra(ACCOUNT_TYPE, account.type) putExtra(EXTRA_USERNAME, account.name) } return PendingIntent.getActivity(context, Loading