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

Side by Side Diff: base/android/java/src/org/chromium/base/PowerMonitor.java

Issue 1263053002: Move JNI annotations to annotations package. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.base; 5 package org.chromium.base;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.content.IntentFilter; 9 import android.content.IntentFilter;
10 import android.os.BatteryManager; 10 import android.os.BatteryManager;
11 import android.os.Handler; 11 import android.os.Handler;
12 import android.os.Looper; 12 import android.os.Looper;
13 13
14 import org.chromium.base.annotations.CalledByNative;
15 import org.chromium.base.annotations.JNINamespace;
16
14 17
15 /** 18 /**
16 * Integrates native PowerMonitor with the java side. 19 * Integrates native PowerMonitor with the java side.
17 */ 20 */
18 @JNINamespace("base::android") 21 @JNINamespace("base::android")
19 public class PowerMonitor implements ApplicationStatus.ApplicationStateListener { 22 public class PowerMonitor implements ApplicationStatus.ApplicationStateListener {
20 private static final long SUSPEND_DELAY_MS = 1 * 60 * 1000; // 1 minute. 23 private static final long SUSPEND_DELAY_MS = 1 * 60 * 1000; // 1 minute.
21 private static class LazyHolder { 24 private static class LazyHolder {
22 private static final PowerMonitor INSTANCE = new PowerMonitor(); 25 private static final PowerMonitor INSTANCE = new PowerMonitor();
23 } 26 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 92
90 @CalledByNative 93 @CalledByNative
91 private static boolean isBatteryPower() { 94 private static boolean isBatteryPower() {
92 return sInstance.mIsBatteryPower; 95 return sInstance.mIsBatteryPower;
93 } 96 }
94 97
95 private static native void nativeOnBatteryChargingChanged(); 98 private static native void nativeOnBatteryChargingChanged();
96 private static native void nativeOnMainActivitySuspended(); 99 private static native void nativeOnMainActivitySuspended();
97 private static native void nativeOnMainActivityResumed(); 100 private static native void nativeOnMainActivityResumed();
98 } 101 }
OLDNEW
« no previous file with comments | « base/android/java/src/org/chromium/base/PathUtils.java ('k') | base/android/java/src/org/chromium/base/SysUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698