From fd854ee58c5d56f84047007ead9f88a767ae956f Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 13 Jul 2015 18:00:37 -0700 Subject: Fix issue #21626564: MMS should be receivied while Dozing We now place whoever is receiving the MMS on the temporary whitelist while doing so, so they can get network access to download it. There was also an issue that needed to be fixed where we were no longer updating the list of allowed uids while dozing based on their proc states... we now do that. Also did a bit of optimization of the temp white list update path do the network policy manager, instead of going through a broadcast we now directly call in to the network policy manager. This also allows us to have a synchronous version of updating the list, so we can know the app has network access before we tell it to do anything. Finally added battery stats events for things going on and off the whitelist so we can diagnose the behavior there. Change-Id: Ic7fe010af680034d9f8cb014bb135b2addef7455 --- core/java/android/os/BatteryStats.java | 12 +++++++++--- core/java/android/os/IDeviceIdleController.aidl | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'core/java/android/os') diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index adc84bc..452e4d5 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -1193,9 +1193,11 @@ public abstract class BatteryStats implements Parcelable { public static final int EVENT_PACKAGE_INACTIVE = 0x000f; // Event for a package becoming active due to an interaction. 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; // Number of event types. - public static final int EVENT_COUNT = 0x0011; + public static final int EVENT_COUNT = 0x0012; // Mask to extract out only the type part of the event. public static final int EVENT_TYPE_MASK = ~(EVENT_FLAG_START|EVENT_FLAG_FINISH); @@ -1219,6 +1221,10 @@ public abstract class BatteryStats implements Parcelable { EVENT_USER_FOREGROUND | EVENT_FLAG_FINISH; public static final int EVENT_ALARM_START = EVENT_ALARM | EVENT_FLAG_START; public static final int EVENT_ALARM_FINISH = EVENT_ALARM | EVENT_FLAG_FINISH; + public static final int EVENT_TEMP_WHITELIST_START = + EVENT_TEMP_WHITELIST | EVENT_FLAG_START; + public static final int EVENT_TEMP_WHITELIST_FINISH = + EVENT_TEMP_WHITELIST | EVENT_FLAG_FINISH; // For CMD_EVENT. public int eventCode; @@ -1852,12 +1858,12 @@ 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" + "active", "pkginst", "pkgunin", "alarm", "stats", "inactive", "active", "tmpwhitelist" }; 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" + "Eac", "Epi", "Epu", "Eal", "Est", "Eai", "Eaa", "Etw" }; /** diff --git a/core/java/android/os/IDeviceIdleController.aidl b/core/java/android/os/IDeviceIdleController.aidl index fe4aa13..b768852 100644 --- a/core/java/android/os/IDeviceIdleController.aidl +++ b/core/java/android/os/IDeviceIdleController.aidl @@ -27,6 +27,7 @@ interface IDeviceIdleController { int[] getAppIdWhitelist(); int[] getAppIdTempWhitelist(); boolean isPowerSaveWhitelistApp(String name); - void addPowerSaveTempWhitelistApp(String name, long duration, int userId); + void addPowerSaveTempWhitelistApp(String name, long duration, int userId, String reason); + long addPowerSaveTempWhitelistAppForMms(String name, int userId, String reason); void exitIdle(String reason); } -- cgit v1.1