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

Commit 17bd675f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Partial revert "Wait for unlock to start jobs."" into sc-qpr1-dev am:...

Merge "Partial revert "Wait for unlock to start jobs."" into sc-qpr1-dev am: 76849b6a am: 653e6d81

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15925291

Change-Id: I799b56e2bff31d0b3148e1368ba6c9085e62f790
parents b27c2808 653e6d81
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -1008,13 +1008,21 @@ public class JobSchedulerService extends com.android.server.SystemService
    }

    @Override
    public void onUserUnlocked(@NonNull TargetUser user) {
    public void onUserStarting(@NonNull TargetUser user) {
        synchronized (mLock) {
            // Note that the user has started after its unlocked instead of when the user
            // actually starts because the storage won't be decrypted until unlock.
            mStartedUsers = ArrayUtils.appendInt(mStartedUsers, user.getUserIdentifier());
        }
        // Let's kick any outstanding jobs for this user.
        // The user is starting but credential encrypted storage is still locked.
        // Only direct-boot-aware jobs can safely run.
        // Let's kick off any eligible jobs for this user.
        mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
    }

    @Override
    public void onUserUnlocked(@NonNull TargetUser user) {
        // The user is fully unlocked and credential encrypted storage is now decrypted.
        // Direct-boot-UNaware jobs can now safely run.
        // Let's kick off any outstanding jobs for this user.
        mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
    }