diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 28 | ||||
| -rw-r--r-- | core/java/android/os/BatteryStats.java | 10 | ||||
| -rw-r--r-- | core/java/android/os/IPowerManager.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/os/PowerManager.java | 12 | ||||
| -rw-r--r-- | core/java/android/service/dreams/Sandman.java | 3 |
5 files changed, 40 insertions, 15 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index bf3bfae..849253b 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -233,8 +233,10 @@ public class AppOpsManager { public static final int OP_READ_EXTERNAL_STORAGE = 59; /** @hide Write external storage. */ public static final int OP_WRITE_EXTERNAL_STORAGE = 60; + /** @hide Turned on the screen. */ + public static final int OP_TURN_SCREEN_ON = 61; /** @hide */ - public static final int _NUM_OP = 61; + public static final int _NUM_OP = 62; /** Access to coarse location information. */ public static final String OPSTR_COARSE_LOCATION = "android:coarse_location"; @@ -393,7 +395,8 @@ public class AppOpsManager { OP_READ_CELL_BROADCASTS, OP_MOCK_LOCATION, OP_READ_EXTERNAL_STORAGE, - OP_WRITE_EXTERNAL_STORAGE + OP_WRITE_EXTERNAL_STORAGE, + OP_TURN_SCREEN_ON, }; /** @@ -461,7 +464,8 @@ public class AppOpsManager { OPSTR_READ_CELL_BROADCASTS, OPSTR_MOCK_LOCATION, OPSTR_READ_EXTERNAL_STORAGE, - OPSTR_WRITE_EXTERNAL_STORAGE + OPSTR_WRITE_EXTERNAL_STORAGE, + null, }; /** @@ -528,8 +532,9 @@ public class AppOpsManager { "BODY_SENSORS", "READ_CELL_BROADCASTS", "MOCK_LOCATION", - "OPSTR_READ_EXTERNAL_STORAGE", - "OPSTR_WRITE_EXTERNAL_STORAGE", + "READ_EXTERNAL_STORAGE", + "WRITE_EXTERNAL_STORAGE", + "TURN_ON_SCREEN", }; /** @@ -598,6 +603,7 @@ public class AppOpsManager { null, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, + null, // no permission for turning the screen on }; /** @@ -666,7 +672,8 @@ public class AppOpsManager { null, // READ_CELL_BROADCASTS null, // MOCK_LOCATION null, // READ_EXTERNAL_STORAGE - null // WRITE_EXTERNAL_STORAGE + null, // WRITE_EXTERNAL_STORAGE + null, // TURN_ON_SCREEN }; /** @@ -734,7 +741,8 @@ public class AppOpsManager { false, // READ_CELL_BROADCASTS false, // MOCK_LOCATION false, // READ_EXTERNAL_STORAGE - false // WRITE_EXTERNAL_STORAGE + false, // WRITE_EXTERNAL_STORAGE + false, // TURN_ON_SCREEN }; /** @@ -801,7 +809,8 @@ public class AppOpsManager { AppOpsManager.MODE_ALLOWED, AppOpsManager.MODE_ERRORED, // OP_MOCK_LOCATION AppOpsManager.MODE_ALLOWED, - AppOpsManager.MODE_ALLOWED + AppOpsManager.MODE_ALLOWED, + AppOpsManager.MODE_ALLOWED, // OP_TURN_ON_SCREEN }; /** @@ -872,7 +881,8 @@ public class AppOpsManager { false, false, false, - false + false, + false, }; /** 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", }; /** diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index 804d3d0..0f37ac7 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -37,7 +37,7 @@ interface IPowerManager boolean isWakeLockLevelSupported(int level); void userActivity(long time, int event, int flags); - void wakeUp(long time); + void wakeUp(long time, String reason, String opPackageName); void goToSleep(long time, int reason, int flags); void nap(long time); boolean isInteractive(); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 6ef1cd0..9a1a03e 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -658,7 +658,17 @@ public final class PowerManager { */ public void wakeUp(long time) { try { - mService.wakeUp(time); + mService.wakeUp(time, "wakeUp", mContext.getOpPackageName()); + } catch (RemoteException e) { + } + } + + /** + * @hide + */ + public void wakeUp(long time, String reason) { + try { + mService.wakeUp(time, reason, mContext.getOpPackageName()); } catch (RemoteException e) { } } diff --git a/core/java/android/service/dreams/Sandman.java b/core/java/android/service/dreams/Sandman.java index 5f5b079..eeb340b 100644 --- a/core/java/android/service/dreams/Sandman.java +++ b/core/java/android/service/dreams/Sandman.java @@ -92,7 +92,8 @@ public final class Sandman { // be awake by the time this happens. Otherwise the dream may not start. PowerManager powerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE); - powerManager.wakeUp(SystemClock.uptimeMillis()); + powerManager.wakeUp(SystemClock.uptimeMillis(), + "android.service.dreams:DREAM"); } else { Slog.i(TAG, "Activating dream by user request."); } |
