Loading apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +4 −3 Original line number Diff line number Diff line Loading @@ -1426,9 +1426,6 @@ public final class JobStatus { * @return true if the exemption status changed */ public boolean updateMediaBackupExemptionStatus() { if (mJobSchedulerInternal == null) { mJobSchedulerInternal = LocalServices.getService(JobSchedulerInternal.class); } final boolean hasMediaExemption = hasMediaBackupExemption(); if (mHasMediaBackupExemption == hasMediaExemption) { return false; Loading Loading @@ -2567,6 +2564,10 @@ public final class JobStatus { } private boolean hasMediaBackupExemption() { if (mJobSchedulerInternal == null) { mJobSchedulerInternal = LocalServices.getService(JobSchedulerInternal.class); } // Check the legacy policy first. if (mHasExemptedMediaUrisOnly && !job.hasLateConstraint() Loading services/tests/mockingservicestests/src/com/android/server/job/controllers/FlexibilityControllerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.util.SparseArray; import com.android.server.AppSchedulingModuleThread; import com.android.server.DeviceIdleInternal; import com.android.server.LocalServices; import com.android.server.job.JobSchedulerInternal; import com.android.server.job.JobSchedulerService; import com.android.server.job.JobStore; Loading Loading @@ -196,6 +197,10 @@ public class FlexibilityControllerTest { doReturn(mJobStore).when(mJobSchedulerService).getJobStore(); // Used in JobStatus. doReturn(mIPackageManager).when(AppGlobals::getPackageManager); // Used in JobStatus. doReturn(mock(JobSchedulerInternal.class)) .when(() -> LocalServices.getService(JobSchedulerInternal.class)); // Freeze the clocks at a moment in time JobSchedulerService.sSystemClock = Clock.fixed(Instant.ofEpochMilli(FROZEN_TIME), ZoneOffset.UTC); Loading Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +4 −3 Original line number Diff line number Diff line Loading @@ -1426,9 +1426,6 @@ public final class JobStatus { * @return true if the exemption status changed */ public boolean updateMediaBackupExemptionStatus() { if (mJobSchedulerInternal == null) { mJobSchedulerInternal = LocalServices.getService(JobSchedulerInternal.class); } final boolean hasMediaExemption = hasMediaBackupExemption(); if (mHasMediaBackupExemption == hasMediaExemption) { return false; Loading Loading @@ -2567,6 +2564,10 @@ public final class JobStatus { } private boolean hasMediaBackupExemption() { if (mJobSchedulerInternal == null) { mJobSchedulerInternal = LocalServices.getService(JobSchedulerInternal.class); } // Check the legacy policy first. if (mHasExemptedMediaUrisOnly && !job.hasLateConstraint() Loading
services/tests/mockingservicestests/src/com/android/server/job/controllers/FlexibilityControllerTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ import android.util.SparseArray; import com.android.server.AppSchedulingModuleThread; import com.android.server.DeviceIdleInternal; import com.android.server.LocalServices; import com.android.server.job.JobSchedulerInternal; import com.android.server.job.JobSchedulerService; import com.android.server.job.JobStore; Loading Loading @@ -196,6 +197,10 @@ public class FlexibilityControllerTest { doReturn(mJobStore).when(mJobSchedulerService).getJobStore(); // Used in JobStatus. doReturn(mIPackageManager).when(AppGlobals::getPackageManager); // Used in JobStatus. doReturn(mock(JobSchedulerInternal.class)) .when(() -> LocalServices.getService(JobSchedulerInternal.class)); // Freeze the clocks at a moment in time JobSchedulerService.sSystemClock = Clock.fixed(Instant.ofEpochMilli(FROZEN_TIME), ZoneOffset.UTC); Loading