OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/system_monitor/system_monitor.h" | 5 #include "base/system_monitor/system_monitor.h" |
6 #include "jni/SystemMonitor_jni.h" | |
6 | 7 |
7 namespace base { | 8 namespace base { |
9 namespace android { | |
10 | |
11 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
| |
12 jclass clazz, | |
13 jboolean is_charging) { | |
14 SystemMonitor::Get()->SetBatteryIsCharging(is_charging); | |
15 } | |
16 | |
17 } // namespace android | |
8 | 18 |
9 bool SystemMonitor::IsBatteryPower() { | 19 bool SystemMonitor::IsBatteryPower() { |
10 NOTIMPLEMENTED(); | 20 return is_battery_charging_; |
11 return true; | 21 } |
22 | |
23 void SystemMonitor::SetBatteryIsCharging(bool is_battery_charging) { | |
24 is_battery_charging_ = is_battery_charging; | |
25 SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); | |
26 } | |
27 | |
28 bool SystemMonitor::RegisterSystemMonitor(JNIEnv* env) { | |
29 return base::android::RegisterNativesImpl(env); | |
12 } | 30 } |
13 | 31 |
14 } // namespace base | 32 } // namespace base |
OLD | NEW |