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

Commit 2cd19833 authored by Amit Mahajan's avatar Amit Mahajan Committed by Gerrit Code Review
Browse files

Merge "Try to open default SMS app only if device is unlocked."

parents 41336f2e c62d61cb
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