Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java

Issue 2697493002: [Offline pages] Implementation of OfflineBackgroundTask using background_task_scheduler (Closed)
Patch Set: Addressing more feedback Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
index 935b9005f8a0b61f8856780e344dc5e368a32869..be80d9f0d2fffcc267a1ba84e44a11050b7be846 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/TaskExtrasPacker.java
@@ -4,10 +4,7 @@
package org.chromium.chrome.browser.offlinepages;
-import android.annotation.TargetApi;
-import android.os.Build;
import android.os.Bundle;
-import android.os.PersistableBundle;
import org.chromium.chrome.browser.ChromeBackgroundService;
@@ -33,23 +30,11 @@ public class TaskExtrasPacker {
bundle.putLong(SCHEDULED_TIME_TAG, System.currentTimeMillis());
}
- /** Puts current time into the input bundle. */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
- public static void packTimeInBundle(PersistableBundle bundle) {
- bundle.putLong(SCHEDULED_TIME_TAG, System.currentTimeMillis());
- }
-
/** Extracts the time we put into the bundle. */
public static long unpackTimeFromBundle(Bundle bundle) {
return bundle.getLong(SCHEDULED_TIME_TAG);
}
- /** Extracts the time we put into the bundle. */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
- public static long unpackTimeFromBundle(PersistableBundle bundle) {
- return bundle.getLong(SCHEDULED_TIME_TAG);
- }
-
/** Puts trigger conditions into the input bundle. */
public static void packTriggerConditionsInBundle(Bundle bundle, TriggerConditions conditions) {
bundle.putBoolean(POWER_CONNECTED_TAG, conditions.requirePowerConnected());
@@ -57,15 +42,6 @@ public class TaskExtrasPacker {
bundle.putBoolean(UNMETERED_NETWORK_TAG, conditions.requireUnmeteredNetwork());
}
- /** Puts trigger conditions into the input bundle. */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
- public static void packTriggerConditionsInBundle(
- PersistableBundle bundle, TriggerConditions conditions) {
- bundle.putBoolean(POWER_CONNECTED_TAG, conditions.requirePowerConnected());
- bundle.putInt(BATTERY_PERCENTAGE_TAG, conditions.getMinimumBatteryPercentage());
- bundle.putBoolean(UNMETERED_NETWORK_TAG, conditions.requireUnmeteredNetwork());
- }
-
/** Extracts the trigger conditions we put into the bundle. */
public static TriggerConditions unpackTriggerConditionsFromBundle(Bundle bundle) {
boolean requirePowerConnected = bundle.getBoolean(POWER_CONNECTED_TAG, true);
@@ -74,14 +50,4 @@ public class TaskExtrasPacker {
return new TriggerConditions(
requirePowerConnected, minimumBatteryPercentage, requireUnmeteredNetwork);
}
-
- /** Extracts the trigger conditions we put into the bundle. */
- @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
- public static TriggerConditions unpackTriggerConditionsFromBundle(PersistableBundle bundle) {
- boolean requirePowerConnected = bundle.getBoolean(POWER_CONNECTED_TAG, true);
- int minimumBatteryPercentage = bundle.getInt(BATTERY_PERCENTAGE_TAG, 100);
- boolean requireUnmeteredNetwork = bundle.getBoolean(UNMETERED_NETWORK_TAG, true);
- return new TriggerConditions(
- requirePowerConnected, minimumBatteryPercentage, requireUnmeteredNetwork);
- }
}

Powered by Google App Engine
This is Rietveld 408576698