1 // Copyright (c) 2011 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 #include "base/system_monitor/system_monitor.h"
6 #include "jni/SystemMonitor_jni.h"
12 // Native implementation of SystemMonitor.java.
13 void OnBatteryChargingChanged(JNIEnv
* env
,
15 SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT
);
18 } // namespace android
20 bool SystemMonitor::IsBatteryPower() {
21 JNIEnv
* env
= base::android::AttachCurrentThread();
22 return base::android::Java_SystemMonitor_isBatteryPower(env
);
25 bool RegisterSystemMonitor(JNIEnv
* env
) {
26 return base::android::RegisterNativesImpl(env
);