1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_ANDROID_H_
6 #define CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_ANDROID_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "content/common/content_export.h"
13 // Android implementation of Battery Status API.
14 class CONTENT_EXPORT BatteryStatusManagerAndroid
{
16 // Must be called at startup.
17 static bool Register(JNIEnv
* env
);
19 // Called from Java via JNI.
20 void GotBatteryStatus(JNIEnv
*, jobject
, jboolean charging
,
21 jdouble chargingTime
, jdouble dischargingTime
,
24 bool StartListeningBatteryChange();
25 void StopListeningBatteryChange();
28 BatteryStatusManagerAndroid();
29 virtual ~BatteryStatusManagerAndroid();
32 // Java provider of battery status info.
33 base::android::ScopedJavaGlobalRef
<jobject
> j_manager_
;
35 DISALLOW_COPY_AND_ASSIGN(BatteryStatusManagerAndroid
);
38 } // namespace content
40 #endif // CHROME_BROWSER_BATTERY_STATUS_BATTERY_STATUS_MANAGER_ANDROID_H_