Loading core/java/android/app/ContextImpl.java +13 −6 Original line number Diff line number Diff line Loading @@ -960,14 +960,21 @@ class ContextImpl extends Context { String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { sendOrderedBroadcastAsUser(intent, user, receiverPermission, AppOpsManager.OP_NONE, resultReceiver, scheduler, initialCode, initialData, initialExtras); null, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, null, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading @@ -981,8 +988,8 @@ class ContextImpl extends Context { if (scheduler == null) { scheduler = mMainThread.getHandler(); } rd = new LoadedApk.ReceiverDispatcher( resultReceiver, getOuterContext(), scheduler, null, false).getIIntentReceiver(); rd = new LoadedApk.ReceiverDispatcher(resultReceiver, getOuterContext(), scheduler, null, false).getIIntentReceiver(); } } String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); Loading @@ -993,7 +1000,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, receiverPermissions, appOp, null, true, false, user.getIdentifier()); appOp, options, true, false, user.getIdentifier()); } catch (RemoteException e) { throw new RuntimeException("Failure from system", e); } Loading core/java/android/content/Context.java +11 −0 Original line number Diff line number Diff line Loading @@ -1808,6 +1808,17 @@ public abstract class Context { @Nullable Handler scheduler, int initialCode, @Nullable String initialData, @Nullable Bundle initialExtras); /** * Similar to above but takes an appOp as well, to enforce restrictions, and an options Bundle. * @see #sendOrderedBroadcastAsUser(Intent, UserHandle, String, * BroadcastReceiver, Handler, int, String, Bundle) * @hide */ public abstract void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, @Nullable String receiverPermission, int appOp, @Nullable Bundle options, BroadcastReceiver resultReceiver, @Nullable Handler scheduler, int initialCode, @Nullable String initialData, @Nullable Bundle initialExtras); /** * <p>Perform a {@link #sendBroadcast(Intent)} that is "sticky," meaning the * Intent you are sending stays around after the broadcast is complete, Loading core/java/android/content/ContextWrapper.java +10 −2 Original line number Diff line number Diff line Loading @@ -489,12 +489,20 @@ public class ContextWrapper extends Context { @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, resultReceiver, scheduler, initialCode, initialData, initialExtras); } /** @hide */ @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, options, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override @Deprecated public void sendStickyBroadcast(Intent intent) { Loading core/java/android/os/BatteryStats.java +9 −3 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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; Loading Loading @@ -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" }; /** Loading core/java/android/os/IDeviceIdleController.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading
core/java/android/app/ContextImpl.java +13 −6 Original line number Diff line number Diff line Loading @@ -960,14 +960,21 @@ class ContextImpl extends Context { String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { sendOrderedBroadcastAsUser(intent, user, receiverPermission, AppOpsManager.OP_NONE, resultReceiver, scheduler, initialCode, initialData, initialExtras); null, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, null, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading @@ -981,8 +988,8 @@ class ContextImpl extends Context { if (scheduler == null) { scheduler = mMainThread.getHandler(); } rd = new LoadedApk.ReceiverDispatcher( resultReceiver, getOuterContext(), scheduler, null, false).getIIntentReceiver(); rd = new LoadedApk.ReceiverDispatcher(resultReceiver, getOuterContext(), scheduler, null, false).getIIntentReceiver(); } } String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); Loading @@ -993,7 +1000,7 @@ class ContextImpl extends Context { ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, rd, initialCode, initialData, initialExtras, receiverPermissions, appOp, null, true, false, user.getIdentifier()); appOp, options, true, false, user.getIdentifier()); } catch (RemoteException e) { throw new RuntimeException("Failure from system", e); } Loading
core/java/android/content/Context.java +11 −0 Original line number Diff line number Diff line Loading @@ -1808,6 +1808,17 @@ public abstract class Context { @Nullable Handler scheduler, int initialCode, @Nullable String initialData, @Nullable Bundle initialExtras); /** * Similar to above but takes an appOp as well, to enforce restrictions, and an options Bundle. * @see #sendOrderedBroadcastAsUser(Intent, UserHandle, String, * BroadcastReceiver, Handler, int, String, Bundle) * @hide */ public abstract void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, @Nullable String receiverPermission, int appOp, @Nullable Bundle options, BroadcastReceiver resultReceiver, @Nullable Handler scheduler, int initialCode, @Nullable String initialData, @Nullable Bundle initialExtras); /** * <p>Perform a {@link #sendBroadcast(Intent)} that is "sticky," meaning the * Intent you are sending stays around after the broadcast is complete, Loading
core/java/android/content/ContextWrapper.java +10 −2 Original line number Diff line number Diff line Loading @@ -489,12 +489,20 @@ public class ContextWrapper extends Context { @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, resultReceiver, scheduler, initialCode, initialData, initialExtras); } /** @hide */ @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp, Bundle options, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { mBase.sendOrderedBroadcastAsUser(intent, user, receiverPermission, appOp, options, resultReceiver, scheduler, initialCode, initialData, initialExtras); } @Override @Deprecated public void sendStickyBroadcast(Intent intent) { Loading
core/java/android/os/BatteryStats.java +9 −3 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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; Loading Loading @@ -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" }; /** Loading
core/java/android/os/IDeviceIdleController.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -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); }