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

Commit 339f0b26 authored by Kweku Adams's avatar Kweku Adams Committed by Android (Google) Code Review
Browse files

Merge "Wait for unlock to start jobs." into sc-dev

parents 2863f6a4 e61cf512
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -887,20 +887,16 @@ public class JobSchedulerService extends com.android.server.SystemService
    }

    @Override
    public void onUserStarting(@NonNull TargetUser user) {
    public void onUserUnlocked(@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.
        mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
    }

    @Override
    public void onUserUnlocking(@NonNull TargetUser user) {
        // Let's kick any outstanding jobs for this user.
        mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
    }

    @Override
    public void onUserStopping(@NonNull TargetUser user) {
        synchronized (mLock) {