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

Commit b5947e01 authored by Adrian Roos's avatar Adrian Roos
Browse files

Prevent EmergencyDialer restart from Keyguard

Fixes a flicker caused by clearing the emergency
dialer task when it was already launched. Instead
we now only clear activities on top of the dialer.

Bug: 20728640
Change-Id: I8a1214c4726e4848587a81e9050a6ab63759b64f
parent 9939961d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.keyguard;

import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
@@ -42,7 +43,7 @@ public class EmergencyButton extends Button {
            .setPackage("com.android.phone")
            .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                    | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
                    | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                    | Intent.FLAG_ACTIVITY_CLEAR_TOP);

    KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {

@@ -127,6 +128,7 @@ public class EmergencyButton extends Button {
            KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(
                    true /* bypassHandler */);
            getContext().startActivityAsUser(INTENT_EMERGENCY_DIAL,
                    ActivityOptions.makeCustomAnimation(getContext(), 0, 0).toBundle(),
                    new UserHandle(KeyguardUpdateMonitor.getCurrentUser()));
        }
    }