Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8701,6 +8701,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager); api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9058,6 +9058,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager); api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8726,6 +8726,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager); core/java/android/content/Intent.java +22 −7 Original line number Diff line number Diff line Loading @@ -4797,6 +4797,11 @@ public class Intent implements Parcelable, Cloneable { * @hide */ public static final int FLAG_RECEIVER_EXCLUDE_BACKGROUND = 0x00800000; /** * If set, this broadcast is being sent from the shell. * @hide */ public static final int FLAG_RECEIVER_FROM_SHELL = 0x00400000; /** * @hide Flags that can't be changed with PendingIntent. Loading Loading @@ -7981,6 +7986,7 @@ public class Intent implements Parcelable, Cloneable { * * @see #getFlags * @see #addFlags * @see #removeFlags * * @see #FLAG_GRANT_READ_URI_PERMISSION * @see #FLAG_GRANT_WRITE_URI_PERMISSION Loading Loading @@ -8014,21 +8020,30 @@ public class Intent implements Parcelable, Cloneable { } /** * Add additional flags to the intent (or with existing flags * value). * Add additional flags to the intent (or with existing flags value). * * @param flags The new flags to set. * * @return Returns the same Intent object, for chaining multiple calls * into a single statement. * * @see #setFlags * @return Returns the same Intent object, for chaining multiple calls into * a single statement. * @see #setFlags(int) * @see #removeFlags(int) */ public Intent addFlags(int flags) { mFlags |= flags; return this; } /** * Remove these flags from the intent. * * @param flags The flags to remove. * @see #setFlags(int) * @see #addFlags(int) */ public void removeFlags(int flags) { mFlags &= ~flags; } /** * (Usually optional) Set an explicit application package name that limits * the components this Intent will resolve to. If left to the default Loading services/core/java/com/android/server/am/ActivityManagerService.java +18 −1 Original line number Diff line number Diff line Loading @@ -17947,7 +17947,11 @@ public class ActivityManagerService extends IActivityManager.Stub case Process.PHONE_UID: case Process.BLUETOOTH_UID: case Process.NFC_UID: if ((intent.getFlags() & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) { isCallerSystem = false; } else { isCallerSystem = true; } break; default: isCallerSystem = (callerApp != null) && callerApp.persistent; Loading Loading @@ -18520,6 +18524,19 @@ public class ActivityManagerService extends IActivityManager.Stub "Can't use FLAG_RECEIVER_BOOT_UPGRADE here"); } if ((flags & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) { switch (Binder.getCallingUid()) { case Process.ROOT_UID: case Process.SHELL_UID: break; default: Slog.w(TAG, "Removing FLAG_RECEIVER_FROM_SHELL because caller is UID " + Binder.getCallingUid()); intent.removeFlags(Intent.FLAG_RECEIVER_FROM_SHELL); break; } } return intent; } Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8701,6 +8701,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager);
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -9058,6 +9058,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager);
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -8726,6 +8726,7 @@ package android.content { method public void readFromParcel(android.os.Parcel); method public void removeCategory(java.lang.String); method public void removeExtra(java.lang.String); method public void removeFlags(int); method public android.content.Intent replaceExtras(android.content.Intent); method public android.content.Intent replaceExtras(android.os.Bundle); method public android.content.ComponentName resolveActivity(android.content.pm.PackageManager);
core/java/android/content/Intent.java +22 −7 Original line number Diff line number Diff line Loading @@ -4797,6 +4797,11 @@ public class Intent implements Parcelable, Cloneable { * @hide */ public static final int FLAG_RECEIVER_EXCLUDE_BACKGROUND = 0x00800000; /** * If set, this broadcast is being sent from the shell. * @hide */ public static final int FLAG_RECEIVER_FROM_SHELL = 0x00400000; /** * @hide Flags that can't be changed with PendingIntent. Loading Loading @@ -7981,6 +7986,7 @@ public class Intent implements Parcelable, Cloneable { * * @see #getFlags * @see #addFlags * @see #removeFlags * * @see #FLAG_GRANT_READ_URI_PERMISSION * @see #FLAG_GRANT_WRITE_URI_PERMISSION Loading Loading @@ -8014,21 +8020,30 @@ public class Intent implements Parcelable, Cloneable { } /** * Add additional flags to the intent (or with existing flags * value). * Add additional flags to the intent (or with existing flags value). * * @param flags The new flags to set. * * @return Returns the same Intent object, for chaining multiple calls * into a single statement. * * @see #setFlags * @return Returns the same Intent object, for chaining multiple calls into * a single statement. * @see #setFlags(int) * @see #removeFlags(int) */ public Intent addFlags(int flags) { mFlags |= flags; return this; } /** * Remove these flags from the intent. * * @param flags The flags to remove. * @see #setFlags(int) * @see #addFlags(int) */ public void removeFlags(int flags) { mFlags &= ~flags; } /** * (Usually optional) Set an explicit application package name that limits * the components this Intent will resolve to. If left to the default Loading
services/core/java/com/android/server/am/ActivityManagerService.java +18 −1 Original line number Diff line number Diff line Loading @@ -17947,7 +17947,11 @@ public class ActivityManagerService extends IActivityManager.Stub case Process.PHONE_UID: case Process.BLUETOOTH_UID: case Process.NFC_UID: if ((intent.getFlags() & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) { isCallerSystem = false; } else { isCallerSystem = true; } break; default: isCallerSystem = (callerApp != null) && callerApp.persistent; Loading Loading @@ -18520,6 +18524,19 @@ public class ActivityManagerService extends IActivityManager.Stub "Can't use FLAG_RECEIVER_BOOT_UPGRADE here"); } if ((flags & Intent.FLAG_RECEIVER_FROM_SHELL) != 0) { switch (Binder.getCallingUid()) { case Process.ROOT_UID: case Process.SHELL_UID: break; default: Slog.w(TAG, "Removing FLAG_RECEIVER_FROM_SHELL because caller is UID " + Binder.getCallingUid()); intent.removeFlags(Intent.FLAG_RECEIVER_FROM_SHELL); break; } } return intent; }