@Test public void prepareJob_messenger_noExtras() { Bundle bundle = TestUtil.getBundleForContentJobExecution(); JobInvocation jobInvocation = receiver.prepareJob(callbackMock, bundle); assertEquals(jobInvocation.getTriggerReason().getTriggeredContentUris(), TestUtil.URIS); }
@Nullable @VisibleForTesting JobInvocation prepareJob(Intent intent) { Bundle intentExtras = intent.getExtras(); if (intentExtras == null) { Log.e(TAG, ERROR_NO_DATA); return null; } Pair<JobCallback, Bundle> extraction = callbackExtractor.extractCallback(intentExtras); if (extraction == null) { Log.i(TAG, "no callback found"); return null; } return prepareJob(extraction.first, extraction.second); }
GooglePlayReceiver extends Service implements ExecutionDelegator.JobFinishedCallback { @Nullable @VisibleForTesting JobInvocation prepareJob(Intent intent) { Bundle intentExtras = intent.getExtras(); if (intentExtras == null) { Log.e(TAG, ERROR_NO_DATA); return null; } Pair<JobCallback, Bundle> extraction = callbackExtractor.extractCallback(intentExtras); if (extraction == null) { Log.i(TAG, "no callback found"); return null; } return prepareJob(extraction.first, extraction.second); } }
GooglePlayReceiver extends Service implements ExecutionDelegator.JobFinishedCallback { @Nullable @VisibleForTesting JobInvocation prepareJob(Intent intent) { Bundle intentExtras = intent.getExtras(); if (intentExtras == null) { Log.e(TAG, ERROR_NO_DATA); return null; } Pair<JobCallback, Bundle> extraction = callbackExtractor.extractCallback(intentExtras); if (extraction == null) { Log.i(TAG, "no callback found"); return null; } return prepareJob(extraction.first, extraction.second); }  }
GooglePlayReceiver extends Service implements ExecutionDelegator.JobFinishedCallback { @Nullable @VisibleForTesting JobInvocation prepareJob(Intent intent) { Bundle intentExtras = intent.getExtras(); if (intentExtras == null) { Log.e(TAG, ERROR_NO_DATA); return null; } Pair<JobCallback, Bundle> extraction = callbackExtractor.extractCallback(intentExtras); if (extraction == null) { Log.i(TAG, "no callback found"); return null; } return prepareJob(extraction.first, extraction.second); }  @Override final int onStartCommand(Intent intent, int flags, int startId); @Nullable @Override IBinder onBind(Intent intent); @Override void onJobFinished(@NonNull JobInvocation js, @JobResult int result); }
GooglePlayReceiver extends Service implements ExecutionDelegator.JobFinishedCallback { @Nullable @VisibleForTesting JobInvocation prepareJob(Intent intent) { Bundle intentExtras = intent.getExtras(); if (intentExtras == null) { Log.e(TAG, ERROR_NO_DATA); return null; } Pair<JobCallback, Bundle> extraction = callbackExtractor.extractCallback(intentExtras); if (extraction == null) { Log.i(TAG, "no callback found"); return null; } return prepareJob(extraction.first, extraction.second); }  @Override final int onStartCommand(Intent intent, int flags, int startId); @Nullable @Override IBinder onBind(Intent intent); @Override void onJobFinished(@NonNull JobInvocation js, @JobResult int result);  }