Chromium Code Reviews| 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 { |
| 8 | 9 |
| 10 namespace android { | |
| 11 | |
| 12 // Native implementation of SystemMonitor.java. | |
| 13 void OnBatteryChargingChanged(JNIEnv* env, | |
| 14 jclass clazz) { | |
| 15 SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT); | |
| 16 } | |
| 17 | |
| 18 } // namespace android | |
| 19 | |
| 9 bool SystemMonitor::IsBatteryPower() { | 20 bool SystemMonitor::IsBatteryPower() { |
| 10 NOTIMPLEMENTED(); | 21 JNIEnv* env = base::android::AttachCurrentThread(); |
| 11 return true; | 22 return base::android::Java_SystemMonitor_isBatteryPower(env); |
| 23 } | |
| 24 | |
| 25 // static | |
|
vandebo (ex-Chrome)
2012/10/05 15:35:40
nit: remove static - no longer a class member ;-)
bulach
2012/10/05 16:22:49
indeed! :) removed..
| |
| 26 bool RegisterSystemMonitor(JNIEnv* env) { | |
| 27 return base::android::RegisterNativesImpl(env); | |
| 12 } | 28 } |
| 13 | 29 |
| 14 } // namespace base | 30 } // namespace base |
| OLD | NEW |