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

Commit ea0002f0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SystemService post-completed user event: jobs"

parents 204b287e d6e625de
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1209,19 +1209,17 @@ public class JobSchedulerService extends com.android.server.SystemService
        synchronized (mLock) {
            mStartedUsers = ArrayUtils.appendInt(mStartedUsers, user.getUserIdentifier());
        }
        // 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();
    }

    /** Start jobs after user is available, delayed by a few seconds since non-urgent. */
    @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.
    public void onUserCompletedEvent(@NonNull TargetUser user, UserCompletedEventType eventType) {
        if (eventType.includesOnUserStarting() || eventType.includesOnUserUnlocked()) {
            // onUserStarting: direct-boot-aware jobs can safely run
            // onUserUnlocked: direct-boot-UNaware jobs can safely run.
            mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget();
        }
    }

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