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

Commit f32edd1b 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

am: ea27e026

Change-Id: Ieaacadf196ff5f37981047bb0909da0d554793fd
parents c7cd1e0b ea27e026
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1682,11 +1682,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