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

Commit 518d49b4 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

refactor: replace intent to start login Activity with a pending Intent

parent d0d1f37e
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package at.bitfire.davdroid

import android.accounts.AccountManager
import android.accounts.AccountManagerFuture
import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
@@ -24,7 +25,6 @@ import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import android.os.Bundle
import android.os.IBinder
import androidx.core.content.ContextCompat
import at.bitfire.davdroid.log.Logger
class ReLoginWithOidcService: Service() {

@@ -61,7 +61,10 @@ class ReLoginWithOidcService: Service() {
                val intent = getIntentFromFuture(future)

                intent?.let {
                    ContextCompat.startActivity(context, it, null)
                    PendingIntent.getActivity(context,
                        0,
                        it,
                        PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
                }
            },
            null)