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

Unified Diff: device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java

Issue 1133253003: Retreive the BatteryManager as a system service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java
diff --git a/device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java b/device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java
index d833b2c93b95ed48f34be76e2808a9d7bbd82b17..10a9fc9f818624f71e00539d93c6787d9cd8ad99 100644
--- a/device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java
+++ b/device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java
@@ -63,8 +63,9 @@ class BatteryStatusManager {
// BatteryManager.EXTRA_PRESENT appears to be unreliable on Galaxy Nexus,
// Android 4.2.1, it always reports false. See http://crbug.com/384348.
this(context, callback, Build.MODEL.equals("Galaxy Nexus"),
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? new BatteryManager()
- : null);
+ Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
+ ? (BatteryManager) context.getSystemService(Context.BATTERY_SERVICE)
+ : null);
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698