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

Commit 833f3b14 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

fix: start the pending intent

parent 49a35613
Loading
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -62,17 +62,26 @@ class ReLoginWithOidcService: Service() {
             { future ->
                val intent = getIntentFromFuture(future)

                if (intent == null) {
                    stopSelf()
                    return@addAccount
                }

                intent?.let {
                    it.apply {
                intent.apply {
                        flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
                    }

                    PendingIntent.getActivity(context,
                val pendingIntent = PendingIntent.getActivity(context,
                    0,
                        it,
                    intent,
                    PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)

                try {
                    pendingIntent.send()
                } catch (exception: Exception){
                    Logger.log.warning("ReLogin: Can't start login activity:  ${exception.message}")
                }

                stopSelf()
            },
            null)