Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a291158b authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

fix: try to add intent data

parent fa39d7c3
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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
@@ -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)
@@ -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,