diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/IActivityManager.aidl | 1 | ||||
| -rw-r--r-- | core/java/android/app/PendingIntent.java | 13 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 38 |
3 files changed, 52 insertions, 0 deletions
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl index fb65da14a087..412d7f45986c 100644 --- a/core/java/android/app/IActivityManager.aidl +++ b/core/java/android/app/IActivityManager.aidl @@ -277,6 +277,7 @@ interface IActivityManager { void unstableProviderDied(in IBinder connection); boolean isIntentSenderAnActivity(in IIntentSender sender); boolean isIntentSenderAForegroundService(in IIntentSender sender); + boolean isIntentSenderABroadcast(in IIntentSender sender); int startActivityAsUser(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 75d95b2c2508..55014ebf1fcb 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -1113,6 +1113,19 @@ public final class PendingIntent implements Parcelable { /** * @hide + * Check whether this PendingIntent will launch an Activity. + */ + public boolean isBroadcast() { + try { + return ActivityManager.getService() + .isIntentSenderABroadcast(mTarget); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * @hide * Return the Intent of this PendingIntent. */ @UnsupportedAppUsage diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 852b65a05034..6ff017127834 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -11766,6 +11766,44 @@ public final class Settings { public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants"; /** + * Broadcast dispatch tuning parameters specific to foreground broadcasts. + * + * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true" + * + * The following keys are supported: + * <pre> + * bcast_timeout (long) + * bcast_slow_time (long) + * bcast_deferral (long) + * bcast_deferral_decay_factor (float) + * bcast_deferral_floor (long) + * </pre> + * + * @hide + */ + public static final String BROADCAST_FG_CONSTANTS = "bcast_fg_constants"; + + /** + * Broadcast dispatch tuning parameters specific to background broadcasts. + * + * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". + * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. + * + * @hide + */ + public static final String BROADCAST_BG_CONSTANTS = "bcast_bg_constants"; + + /** + * Broadcast dispatch tuning parameters specific to specific "offline" broadcasts. + * + * This is encoded as a key=value list, separated by commas. Ex: "foo=1,bar=true". + * See {@link #BROADCAST_FG_CONSTANTS} for the list of supported keys. + * + * @hide + */ + public static final String BROADCAST_OFFLOAD_CONSTANTS = "bcast_offload_constants"; + + /** * Whether or not App Standby feature is enabled by system. This controls throttling of apps * based on usage patterns and predictions. Platform will turn on this feature if both this * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on. |
