| 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..4e1a16b3e91f379f26bd829b55f62f08ca9cba46 100644
|
| --- a/base/system_monitor/system_monitor_android.cc
|
| +++ b/base/system_monitor/system_monitor_android.cc
|
| @@ -3,12 +3,27 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/system_monitor/system_monitor.h"
|
| +#include "jni/SystemMonitor_jni.h"
|
|
|
| namespace base {
|
|
|
| +namespace android {
|
| +
|
| +// Native implementation of SystemMonitor.java.
|
| +void OnBatteryChargingChanged(JNIEnv* env,
|
| + jclass clazz) {
|
| + SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT);
|
| +}
|
| +
|
| +} // namespace android
|
| +
|
| bool SystemMonitor::IsBatteryPower() {
|
| - NOTIMPLEMENTED();
|
| - return true;
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + return base::android::Java_SystemMonitor_isBatteryPower(env);
|
| +}
|
| +
|
| +bool RegisterSystemMonitor(JNIEnv* env) {
|
| + return base::android::RegisterNativesImpl(env);
|
| }
|
|
|
| } // namespace base
|
|
|