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

Unified Diff: base/android/java/src/org/chromium/base/PowerMonitor.java

Issue 167243005: Move PowerMonitor to Application Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« 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: 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..dc1bc8bec4fbb703d41f30447cd054bf1a185d30 100644
--- a/base/android/java/src/org/chromium/base/PowerMonitor.java
+++ b/base/android/java/src/org/chromium/base/PowerMonitor.java
@@ -44,7 +44,13 @@ public class PowerMonitor implements ActivityStatus.StateListener {
sInstance = LazyHolder.INSTANCE;
}
+ /**
+ * Create a PowerMonitor instance if none exists.
+ * @param context The context to register broadcast receivers for. The application context
+ * will be used from this parameter.
+ */
public static void create(Context context) {
+ context = context.getApplicationContext();
if (sInstance == null) {
sInstance = LazyHolder.INSTANCE;
ActivityStatus.registerStateListener(sInstance);
« 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