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

Commit 7ca3706e authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge \"Suppress PRE_BOOT notifications for some profiles.\" into nyc-mr1-dev

am: 99f70388

Change-Id: I977d5e4073ce57809ffb2b2e324b133c52341c4f
parents 03b34e40 99f70388
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public abstract class PreBootBroadcaster extends IIntentReceiver.Stub {
    private int mIndex = 0;

    public PreBootBroadcaster(ActivityManagerService service, int userId,
            ProgressReporter progress) {
            ProgressReporter progress, boolean quiet) {
        mService = service;
        mUserId = userId;
        mProgress = progress;
@@ -68,8 +68,10 @@ public abstract class PreBootBroadcaster extends IIntentReceiver.Stub {
        mTargets = mService.mContext.getPackageManager().queryBroadcastReceiversAsUser(mIntent,
                MATCH_SYSTEM_ONLY, UserHandle.of(userId));

        if (!quiet) {
            mHandler.obtainMessage(MSG_SHOW).sendToTarget();
        }
    }

    public void sendNext() {
        if (mIndex >= mTargets.size()) {
+6 −1
Original line number Diff line number Diff line
@@ -351,7 +351,11 @@ final class UserController {
                // PRE_BOOT receivers are finished to avoid ANR'ing apps
                final UserInfo info = getUserInfo(userId);
                if (!Objects.equals(info.lastLoggedInFingerprint, Build.FINGERPRINT)) {
                    new PreBootBroadcaster(mService, userId, null) {
                    // Suppress double notifications for managed profiles that
                    // were unlocked automatically (no challenge token required)
                    // as part of their parent user being unlocked.
                    final boolean quiet = info.isManagedProfile() && !uss.tokenProvided;
                    new PreBootBroadcaster(mService, userId, null, quiet) {
                        @Override
                        public void onFinished() {
                            finishUserUnlockedCompleted(uss);
@@ -972,6 +976,7 @@ final class UserController {
                return false;
            } else {
                uss.mUnlockProgress.addListener(listener);
                uss.tokenProvided = (token != null);
            }

            finishUserUnlocking(uss);
+1 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public final class UserState {
    public int state = STATE_BOOTING;
    public int lastState = STATE_BOOTING;
    public boolean switching;
    public boolean tokenProvided;

    /**
     * The last time that a provider was reported to usage stats as being brought to important