Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: base/system_monitor/system_monitor_android.cc

Issue 11027024: Android: Integrates native and java SystemMonitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« base/system_monitor/system_monitor.h ('K') | « base/system_monitor/system_monitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698