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

Unified Diff: base/system_monitor/system_monitor_android.cc

Issue 11538008: Fire SystemMonitor::{RESUME,SUSPEND}_EVENT on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update findbugs_known_bugs.txt Created 8 years 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 4e1a16b3e91f379f26bd829b55f62f08ca9cba46..f29b7b0380279ac59461f02369142a687a24c297 100644
--- a/base/system_monitor/system_monitor_android.cc
+++ b/base/system_monitor/system_monitor_android.cc
@@ -10,11 +10,18 @@ namespace base {
namespace android {
// Native implementation of SystemMonitor.java.
-void OnBatteryChargingChanged(JNIEnv* env,
- jclass clazz) {
+void OnBatteryChargingChanged(JNIEnv* env, jclass clazz) {
SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::POWER_STATE_EVENT);
}
+void OnMainActivityResumed(JNIEnv* env, jclass clazz) {
+ SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::RESUME_EVENT);
+}
+
+void OnMainActivitySuspended(JNIEnv* env, jclass clazz) {
+ SystemMonitor::Get()->ProcessPowerMessage(SystemMonitor::SUSPEND_EVENT);
+}
+
} // namespace android
bool SystemMonitor::IsBatteryPower() {
« no previous file with comments | « base/android/java/src/org/chromium/base/SystemMonitor.java ('k') | build/android/findbugs_filter/findbugs_known_bugs.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698