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

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

Merge "Remove unnecessary cancel()."

parents 13ce5656 418815ec
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -42,10 +42,6 @@ public class ReviewNotificationPermissionsJobService extends JobService {
     */
    public static void scheduleJob(Context context, long rescheduleTimeMillis) {
        JobScheduler jobScheduler = context.getSystemService(JobScheduler.class);
        // if the job already exists for some reason, cancel & reschedule
        if (jobScheduler.getPendingJob(JOB_ID) != null) {
            jobScheduler.cancel(JOB_ID);
        }
        ComponentName component = new ComponentName(
                context, ReviewNotificationPermissionsJobService.class);
        JobInfo newJob = new JobInfo.Builder(JOB_ID, component)
+0 −5
Original line number Diff line number Diff line
@@ -20,10 +20,8 @@ import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;

import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.app.job.JobInfo;
import android.app.job.JobParameters;
@@ -75,9 +73,6 @@ public class ReviewNotificationPermissionsJobServiceTest extends UiServiceTestCa

    @Test
    public void testScheduleJob() {
        // if asked, the job doesn't currently exist yet
        when(mMockJobScheduler.getPendingJob(anyInt())).thenReturn(null);

        final int rescheduleTimeMillis = 350;  // arbitrary number

        // attempt to schedule the job