Skip to content

Commit 96f400d

Browse files
committed
Removes persistent bundle booleans on API 21
Change-Id: I3e81effc9d5662f7b21de4d49725d094aebc219e
1 parent b69087c commit 96f400d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

library/src/main/java/com/google/android/media/tv/companionlibrary/sync/EpgSyncJobService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import android.media.tv.TvInputInfo;
3232
import android.net.Uri;
3333
import android.os.AsyncTask;
34+
import android.os.Build;
3435
import android.os.PersistableBundle;
3536
import android.os.RemoteException;
3637
import android.support.annotation.VisibleForTesting;
@@ -349,8 +350,10 @@ public static void requestImmediateSync(
349350
throw new IllegalArgumentException("This class does not extend EpgSyncJobService");
350351
}
351352
PersistableBundle persistableBundle = new PersistableBundle();
352-
persistableBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
353-
persistableBundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
353+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
354+
persistableBundle.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);
355+
persistableBundle.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
356+
}
354357
persistableBundle.putString(EpgSyncJobService.BUNDLE_KEY_INPUT_ID, inputId);
355358
persistableBundle.putLong(EpgSyncJobService.BUNDLE_KEY_SYNC_PERIOD, syncDuration);
356359
JobInfo.Builder builder = new JobInfo.Builder(REQUEST_SYNC_JOB_ID, jobServiceComponent);

0 commit comments

Comments
 (0)