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

Commit ea27e026 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Try to open default SMS app only if device is unlocked." am: 2cd19833

am: 62e835d6

Change-Id: I0ac98b7aa5a1b38fcfafd8119e4b523b9b3c4e0c
parents b56ce639 62e835d6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1685,11 +1685,16 @@ public abstract class InboundSmsHandler extends StateMachine {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (ACTION_OPEN_SMS_APP.equals(intent.getAction())) {
                // do nothing if the user had not unlocked the device yet
                UserManager userManager =
                        (UserManager) context.getSystemService(Context.USER_SERVICE);
                if (!userManager.isUserUnlocked()) {
                    context.startActivity(context.getPackageManager().getLaunchIntentForPackage(
                            Telephony.Sms.getDefaultSmsPackage(context)));
                }
            }
        }
    }

    /**
     * Registers the broadcast receiver to launch the default SMS app when the user clicks the