@Test public void testWriteToBundle_updateCurrent() { for (boolean replaceCurrent : ALL_BOOLEANS) { Bundle b = writer.writeToBundle( initializeDefaultBuilder().setReplaceCurrent(replaceCurrent).build(), new Bundle()); assertEquals("update_current", replaceCurrent, b.getBoolean("update_current")); } }
public Bundle writeToBundle(JobParameters job, Bundle b) { b.putString(REQUEST_PARAM_TAG, job.getTag()); b.putBoolean(REQUEST_PARAM_UPDATE_CURRENT, job.shouldReplaceCurrent()); boolean persisted = job.getLifetime() == Lifetime.FOREVER; b.putBoolean(REQUEST_PARAM_PERSISTED, persisted); b.putString(REQUEST_PARAM_SERVICE, GooglePlayReceiver.class.getName()); writeTriggerToBundle(job, b); writeConstraintsToBundle(job, b); writeRetryStrategyToBundle(job, b); Bundle userExtras = job.getExtras(); if (userExtras == null) { userExtras = new Bundle(); } b.putBundle(REQUEST_PARAM_EXTRAS, jobCoder.encode(job, userExtras)); return b; }
GooglePlayJobWriter { public Bundle writeToBundle(JobParameters job, Bundle b) { b.putString(REQUEST_PARAM_TAG, job.getTag()); b.putBoolean(REQUEST_PARAM_UPDATE_CURRENT, job.shouldReplaceCurrent()); boolean persisted = job.getLifetime() == Lifetime.FOREVER; b.putBoolean(REQUEST_PARAM_PERSISTED, persisted); b.putString(REQUEST_PARAM_SERVICE, GooglePlayReceiver.class.getName()); writeTriggerToBundle(job, b); writeConstraintsToBundle(job, b); writeRetryStrategyToBundle(job, b); Bundle userExtras = job.getExtras(); if (userExtras == null) { userExtras = new Bundle(); } b.putBundle(REQUEST_PARAM_EXTRAS, jobCoder.encode(job, userExtras)); return b; } }
GooglePlayJobWriter { public Bundle writeToBundle(JobParameters job, Bundle b) { b.putString(REQUEST_PARAM_TAG, job.getTag()); b.putBoolean(REQUEST_PARAM_UPDATE_CURRENT, job.shouldReplaceCurrent()); boolean persisted = job.getLifetime() == Lifetime.FOREVER; b.putBoolean(REQUEST_PARAM_PERSISTED, persisted); b.putString(REQUEST_PARAM_SERVICE, GooglePlayReceiver.class.getName()); writeTriggerToBundle(job, b); writeConstraintsToBundle(job, b); writeRetryStrategyToBundle(job, b); Bundle userExtras = job.getExtras(); if (userExtras == null) { userExtras = new Bundle(); } b.putBundle(REQUEST_PARAM_EXTRAS, jobCoder.encode(job, userExtras)); return b; }  }
GooglePlayJobWriter { public Bundle writeToBundle(JobParameters job, Bundle b) { b.putString(REQUEST_PARAM_TAG, job.getTag()); b.putBoolean(REQUEST_PARAM_UPDATE_CURRENT, job.shouldReplaceCurrent()); boolean persisted = job.getLifetime() == Lifetime.FOREVER; b.putBoolean(REQUEST_PARAM_PERSISTED, persisted); b.putString(REQUEST_PARAM_SERVICE, GooglePlayReceiver.class.getName()); writeTriggerToBundle(job, b); writeConstraintsToBundle(job, b); writeRetryStrategyToBundle(job, b); Bundle userExtras = job.getExtras(); if (userExtras == null) { userExtras = new Bundle(); } b.putBundle(REQUEST_PARAM_EXTRAS, jobCoder.encode(job, userExtras)); return b; }  Bundle writeToBundle(JobParameters job, Bundle b); }
GooglePlayJobWriter { public Bundle writeToBundle(JobParameters job, Bundle b) { b.putString(REQUEST_PARAM_TAG, job.getTag()); b.putBoolean(REQUEST_PARAM_UPDATE_CURRENT, job.shouldReplaceCurrent()); boolean persisted = job.getLifetime() == Lifetime.FOREVER; b.putBoolean(REQUEST_PARAM_PERSISTED, persisted); b.putString(REQUEST_PARAM_SERVICE, GooglePlayReceiver.class.getName()); writeTriggerToBundle(job, b); writeConstraintsToBundle(job, b); writeRetryStrategyToBundle(job, b); Bundle userExtras = job.getExtras(); if (userExtras == null) { userExtras = new Bundle(); } b.putBundle(REQUEST_PARAM_EXTRAS, jobCoder.encode(job, userExtras)); return b; }  Bundle writeToBundle(JobParameters job, Bundle b);  }