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

Commit 8d75c14d authored by Adrian Roos's avatar Adrian Roos
Browse files

Explicitly specify package in EmergencyButton

Change-Id: I0c64195e748ef926ae87db21663c86eab38c38b8
parent 07459a36
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -36,7 +36,10 @@ import com.android.internal.widget.LockPatternUtils;
 * allows the user to return to the call.
 */
public class EmergencyButton extends Button {
    private static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
    private static final Intent INTENT_EMERGENCY_DIAL = new Intent()
            .setAction("com.android.phone.EmergencyDialer.DIAL")
            .setPackage("com.android.phone")
            .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);

    KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {

@@ -112,12 +115,9 @@ public class EmergencyButton extends Button {
                mEmergencyButtonCallback.onEmergencyButtonClickedWhenInCall();
            }
        } else {
            final boolean bypassHandler = true;
            KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(bypassHandler);
            Intent intent = new Intent(ACTION_EMERGENCY_DIAL);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                    | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
            getContext().startActivityAsUser(intent,
            KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(
                    true /* bypassHandler */);
            getContext().startActivityAsUser(INTENT_EMERGENCY_DIAL,
                    new UserHandle(mLockPatternUtils.getCurrentUser()));
        }
    }