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

Commit 0865cc0a authored by Chun-Wei Wang's avatar Chun-Wei Wang Committed by Android (Google) Code Review
Browse files

Merge "API coverage for Builder#requireDeviceIdle"

parents baa392df a6d73457
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.text.format.DateUtils;
import android.util.Slog;

@@ -167,6 +168,14 @@ public class GentleUpdateHelper {

    @WorkerThread
    private void scheduleIdleJob() {
        // Simulate idle jobs during test. Otherwise we need to wait for
        // more than 30 mins for JS to trigger the job.
        boolean isIdle = SystemProperties.getBoolean("debug.pm.gentle_update_test.is_idle", false);
        if (isIdle) {
            mHandler.post(this::runIdleJob);
            return;
        }

        if (mHasPendingIdleJob) {
            // No need to schedule the job again
            return;