summaryrefslogtreecommitdiffstats
path: root/core/java/android/os/BatteryStats.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-07-13 14:48:08 -0700
committerDianne Hackborn <hackbod@google.com>2015-07-15 09:59:07 -0700
commit280a64e793d081847c5dcea23ed9be38aa5332d2 (patch)
treea9ea0a4aca5e578efb1b9e252477cedfa79c547f /core/java/android/os/BatteryStats.java
parent18709f9a0095afe6dba11f9dd71e3210c5f4e1db (diff)
downloadframeworks_base-280a64e793d081847c5dcea23ed9be38aa5332d2.zip
frameworks_base-280a64e793d081847c5dcea23ed9be38aa5332d2.tar.gz
frameworks_base-280a64e793d081847c5dcea23ed9be38aa5332d2.tar.bz2
Improve tracking of screen on reasons.
- New screen on app op to record the last time each app has caused the screen to be turned on. - New battery stats event that tells us the reason the screen has been asked to turn on. - Propagate out power manager API to specify the reason a caller is asking to have the screen turned on. Note that currently the window flag to turn the screen on bypasses much of this because it is being handled in the window manager by just directly telling the power manager to turn the screen on. To make this better we need a new API where it can specify who it is calling the API for. Change-Id: I667e56cb1f80508d054da004db667efbcc22e971
Diffstat (limited to 'core/java/android/os/BatteryStats.java')
-rw-r--r--core/java/android/os/BatteryStats.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 452e4d5..ecb7f5a 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -1195,9 +1195,11 @@ public abstract class BatteryStats implements Parcelable {
public static final int EVENT_PACKAGE_ACTIVE = 0x0010;
// Event for a package being on the temporary whitelist.
public static final int EVENT_TEMP_WHITELIST = 0x0011;
+ // Event for the screen waking up.
+ public static final int EVENT_SCREEN_WAKE_UP = 0x0012;
// Number of event types.
- public static final int EVENT_COUNT = 0x0012;
+ public static final int EVENT_COUNT = 0x0013;
// Mask to extract out only the type part of the event.
public static final int EVENT_TYPE_MASK = ~(EVENT_FLAG_START|EVENT_FLAG_FINISH);
@@ -1858,12 +1860,14 @@ public abstract class BatteryStats implements Parcelable {
public static final String[] HISTORY_EVENT_NAMES = new String[] {
"null", "proc", "fg", "top", "sync", "wake_lock_in", "job", "user", "userfg", "conn",
- "active", "pkginst", "pkgunin", "alarm", "stats", "inactive", "active", "tmpwhitelist"
+ "active", "pkginst", "pkgunin", "alarm", "stats", "inactive", "active", "tmpwhitelist",
+ "screenwake",
};
public static final String[] HISTORY_EVENT_CHECKIN_NAMES = new String[] {
"Enl", "Epr", "Efg", "Etp", "Esy", "Ewl", "Ejb", "Eur", "Euf", "Ecn",
- "Eac", "Epi", "Epu", "Eal", "Est", "Eai", "Eaa", "Etw"
+ "Eac", "Epi", "Epu", "Eal", "Est", "Eai", "Eaa", "Etw",
+ "Esw",
};
/**