Index: base/android/java/src/org/chromium/base/PowerMonitor.java |
diff --git a/base/android/java/src/org/chromium/base/PowerMonitor.java b/base/android/java/src/org/chromium/base/PowerMonitor.java |
index 39293981bb1325d905a97e4d286bbe8d9e422f38..b6d8cda53ef4a20190d93302488b6cc37322d02f 100644 |
--- a/base/android/java/src/org/chromium/base/PowerMonitor.java |
+++ b/base/android/java/src/org/chromium/base/PowerMonitor.java |
@@ -16,7 +16,7 @@ import android.os.Looper; |
* Integrates native PowerMonitor with the java side. |
*/ |
@JNINamespace("base::android") |
-public class PowerMonitor implements ActivityStatus.StateListener { |
+public class PowerMonitor implements ApplicationStatus.ApplicationStateListener { |
private static final long SUSPEND_DELAY_MS = 1 * 60 * 1000; // 1 minute. |
private static class LazyHolder { |
private static final PowerMonitor INSTANCE = new PowerMonitor(); |
@@ -47,7 +47,7 @@ public class PowerMonitor implements ActivityStatus.StateListener { |
public static void create(Context context) { |
if (sInstance == null) { |
sInstance = LazyHolder.INSTANCE; |
- ActivityStatus.registerStateListener(sInstance); |
+ ApplicationStatus.registerApplicationStateListener(sInstance); |
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); |
Intent batteryStatusIntent = context.registerReceiver(null, ifilter); |
onBatteryChargingChanged(batteryStatusIntent); |
@@ -71,12 +71,12 @@ public class PowerMonitor implements ActivityStatus.StateListener { |
} |
@Override |
- public void onActivityStateChange(int newState) { |
- if (newState == ActivityStatus.RESUMED) { |
+ public void onApplicationStateChange(int newState) { |
+ if (newState == ApplicationState.HAS_RUNNING_ACTIVITIES) { |
// Remove the callback from the message loop in case it hasn't been executed yet. |
mHandler.removeCallbacks(sSuspendTask); |
nativeOnMainActivityResumed(); |
- } else if (newState == ActivityStatus.PAUSED) { |
+ } else if (newState == ApplicationState.HAS_PAUSED_ACTIVITIES) { |
mHandler.postDelayed(sSuspendTask, SUSPEND_DELAY_MS); |
} |
} |