Index: base/system_monitor/system_monitor_android.cc |
diff --git a/base/system_monitor/system_monitor_android.cc b/base/system_monitor/system_monitor_android.cc |
index c86076d2a84baaaf1a20ec489ddbffdc46af7e7d..bace3ab9fe7ea4cfaf32c8e76ba77c678e7105a8 100644 |
--- a/base/system_monitor/system_monitor_android.cc |
+++ b/base/system_monitor/system_monitor_android.cc |
@@ -3,12 +3,30 @@ |
// found in the LICENSE file. |
#include "base/system_monitor/system_monitor.h" |
+#include "jni/SystemMonitor_jni.h" |
namespace base { |
+namespace android { |
+ |
+void OnBatteryChargingChanged(JNIEnv* env, |
vandebo (ex-Chrome)
2012/10/04 17:55:56
This is nativeOnBatteryChargingChanged? A comment
bulach
2012/10/04 18:33:33
done, sorry about all the magic going in here.
I c
|
+ jclass clazz, |
+ jboolean is_charging) { |
+ SystemMonitor::Get()->SetBatteryIsCharging(is_charging); |
+} |
+ |
+} // namespace android |
bool SystemMonitor::IsBatteryPower() { |
- NOTIMPLEMENTED(); |
- return true; |
+ return is_battery_charging_; |
+} |
+ |
+void SystemMonitor::SetBatteryIsCharging(bool is_battery_charging) { |
+ is_battery_charging_ = is_battery_charging; |
+ SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); |
+} |
+ |
+bool SystemMonitor::RegisterSystemMonitor(JNIEnv* env) { |
+ return base::android::RegisterNativesImpl(env); |
} |
} // namespace base |