Loading core/java/android/app/ContextImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SpecialUsers.CanBeALL; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SuppressLint; import android.annotation.UiContext; import android.companion.virtual.VirtualDeviceManager; Loading Loading @@ -2827,7 +2829,8 @@ class ContextImpl extends Context { } @Override public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) { public Context createContextAsUser( @CanBeALL @CanBeCURRENT UserHandle user, @CreatePackageOptions int flags) { try { return createPackageContextAsUser(getPackageName(), flags, user); } catch (NameNotFoundException e) { Loading core/java/android/app/PendingIntent.java +6 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SpecialUsers.CanBeALL; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SystemApi; import android.annotation.SystemApi.Client; import android.annotation.TestApi; Loading Loading @@ -568,7 +570,8 @@ public final class PendingIntent implements Parcelable { */ @UnsupportedAppUsage public static PendingIntent getActivityAsUser(Context context, int requestCode, @NonNull Intent intent, int flags, Bundle options, UserHandle user) { @NonNull Intent intent, int flags, Bundle options, @CanBeCURRENT UserHandle user) { String packageName = context.getPackageName(); String resolvedType = intent.resolveTypeIfNeeded(context.getContentResolver()); checkPendingIntent(flags, intent, context, /* isActivityResultType */ false); Loading Loading @@ -698,7 +701,7 @@ public final class PendingIntent implements Parcelable { * activity is started, not when the pending intent is created. */ public static PendingIntent getActivitiesAsUser(Context context, int requestCode, @NonNull Intent[] intents, int flags, Bundle options, UserHandle user) { @NonNull Intent[] intents, int flags, Bundle options, @CanBeCURRENT UserHandle user) { String packageName = context.getPackageName(); String[] resolvedTypes = new String[intents.length]; for (int i=0; i<intents.length; i++) { Loading Loading @@ -755,7 +758,7 @@ public final class PendingIntent implements Parcelable { */ @UnsupportedAppUsage public static PendingIntent getBroadcastAsUser(Context context, int requestCode, Intent intent, int flags, UserHandle userHandle) { Intent intent, int flags, @CanBeALL @CanBeCURRENT UserHandle userHandle) { String packageName = context.getPackageName(); String resolvedType = intent.resolveTypeIfNeeded(context.getContentResolver()); checkPendingIntent(flags, intent, context, /* isActivityResultType */ false); Loading core/java/android/content/ContentResolver.java +3 −3 Original line number Diff line number Diff line Loading @@ -2910,13 +2910,13 @@ public abstract class ContentResolver implements ContentInterface { */ @Deprecated public void notifyChange(@NonNull Uri uri, ContentObserver observer, boolean syncToNetwork, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { notifyChange(uri, observer, syncToNetwork ? NOTIFY_SYNC_TO_NETWORK : 0, userHandle); } /** {@hide} */ public void notifyChange(@NonNull Uri uri, ContentObserver observer, @NotifyFlags int flags, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { notifyChange(new Uri[] { uri }, observer, flags, userHandle); } Loading @@ -2926,7 +2926,7 @@ public abstract class ContentResolver implements ContentInterface { * @hide */ public void notifyChange(@NonNull Uri[] uris, ContentObserver observer, @NotifyFlags int flags, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { try { getContentService().notifyChange( uris, observer == null ? null : observer.getContentObserver(), Loading core/java/android/content/Context.java +4 −3 Original line number Diff line number Diff line Loading @@ -7608,7 +7608,8 @@ public abstract class Context { */ @SystemApi @NonNull public Context createContextAsUser(@NonNull UserHandle user, @CreatePackageOptions int flags) { public Context createContextAsUser( @CanBeALL @CanBeCURRENT @NonNull UserHandle user, @CreatePackageOptions int flags) { if (Build.IS_ENG) { throw new IllegalStateException("createContextAsUser not overridden!"); } Loading Loading @@ -7669,7 +7670,7 @@ public abstract class Context { @NonNull @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @TestApi public UserHandle getUser() { public @CanBeALL @CanBeCURRENT UserHandle getUser() { return android.os.Process.myUserHandle(); } Loading @@ -7679,7 +7680,7 @@ public abstract class Context { */ @UnsupportedAppUsage @TestApi public @UserIdInt int getUserId() { public @CanBeALL @CanBeCURRENT @UserIdInt int getUserId() { return android.os.UserHandle.myUserId(); } Loading core/java/android/content/Intent.java +3 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,11 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.UserIdInt; import android.app.Activity; import android.app.ActivityThread; import android.app.AppGlobals; Loading Loading @@ -9317,7 +9319,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ public int getContentUserHint() { public @CanBeCURRENT @UserIdInt int getContentUserHint() { return mContentUserHint; } Loading Loading
core/java/android/app/ContextImpl.java +4 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SpecialUsers.CanBeALL; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SuppressLint; import android.annotation.UiContext; import android.companion.virtual.VirtualDeviceManager; Loading Loading @@ -2827,7 +2829,8 @@ class ContextImpl extends Context { } @Override public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) { public Context createContextAsUser( @CanBeALL @CanBeCURRENT UserHandle user, @CreatePackageOptions int flags) { try { return createPackageContextAsUser(getPackageName(), flags, user); } catch (NameNotFoundException e) { Loading
core/java/android/app/PendingIntent.java +6 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SpecialUsers.CanBeALL; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SystemApi; import android.annotation.SystemApi.Client; import android.annotation.TestApi; Loading Loading @@ -568,7 +570,8 @@ public final class PendingIntent implements Parcelable { */ @UnsupportedAppUsage public static PendingIntent getActivityAsUser(Context context, int requestCode, @NonNull Intent intent, int flags, Bundle options, UserHandle user) { @NonNull Intent intent, int flags, Bundle options, @CanBeCURRENT UserHandle user) { String packageName = context.getPackageName(); String resolvedType = intent.resolveTypeIfNeeded(context.getContentResolver()); checkPendingIntent(flags, intent, context, /* isActivityResultType */ false); Loading Loading @@ -698,7 +701,7 @@ public final class PendingIntent implements Parcelable { * activity is started, not when the pending intent is created. */ public static PendingIntent getActivitiesAsUser(Context context, int requestCode, @NonNull Intent[] intents, int flags, Bundle options, UserHandle user) { @NonNull Intent[] intents, int flags, Bundle options, @CanBeCURRENT UserHandle user) { String packageName = context.getPackageName(); String[] resolvedTypes = new String[intents.length]; for (int i=0; i<intents.length; i++) { Loading Loading @@ -755,7 +758,7 @@ public final class PendingIntent implements Parcelable { */ @UnsupportedAppUsage public static PendingIntent getBroadcastAsUser(Context context, int requestCode, Intent intent, int flags, UserHandle userHandle) { Intent intent, int flags, @CanBeALL @CanBeCURRENT UserHandle userHandle) { String packageName = context.getPackageName(); String resolvedType = intent.resolveTypeIfNeeded(context.getContentResolver()); checkPendingIntent(flags, intent, context, /* isActivityResultType */ false); Loading
core/java/android/content/ContentResolver.java +3 −3 Original line number Diff line number Diff line Loading @@ -2910,13 +2910,13 @@ public abstract class ContentResolver implements ContentInterface { */ @Deprecated public void notifyChange(@NonNull Uri uri, ContentObserver observer, boolean syncToNetwork, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { notifyChange(uri, observer, syncToNetwork ? NOTIFY_SYNC_TO_NETWORK : 0, userHandle); } /** {@hide} */ public void notifyChange(@NonNull Uri uri, ContentObserver observer, @NotifyFlags int flags, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { notifyChange(new Uri[] { uri }, observer, flags, userHandle); } Loading @@ -2926,7 +2926,7 @@ public abstract class ContentResolver implements ContentInterface { * @hide */ public void notifyChange(@NonNull Uri[] uris, ContentObserver observer, @NotifyFlags int flags, @UserIdInt int userHandle) { @CanBeALL @CanBeCURRENT @UserIdInt int userHandle) { try { getContentService().notifyChange( uris, observer == null ? null : observer.getContentObserver(), Loading
core/java/android/content/Context.java +4 −3 Original line number Diff line number Diff line Loading @@ -7608,7 +7608,8 @@ public abstract class Context { */ @SystemApi @NonNull public Context createContextAsUser(@NonNull UserHandle user, @CreatePackageOptions int flags) { public Context createContextAsUser( @CanBeALL @CanBeCURRENT @NonNull UserHandle user, @CreatePackageOptions int flags) { if (Build.IS_ENG) { throw new IllegalStateException("createContextAsUser not overridden!"); } Loading Loading @@ -7669,7 +7670,7 @@ public abstract class Context { @NonNull @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @TestApi public UserHandle getUser() { public @CanBeALL @CanBeCURRENT UserHandle getUser() { return android.os.Process.myUserHandle(); } Loading @@ -7679,7 +7680,7 @@ public abstract class Context { */ @UnsupportedAppUsage @TestApi public @UserIdInt int getUserId() { public @CanBeALL @CanBeCURRENT @UserIdInt int getUserId() { return android.os.UserHandle.myUserId(); } Loading
core/java/android/content/Intent.java +3 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,11 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SpecialUsers.CanBeCURRENT; import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.UserIdInt; import android.app.Activity; import android.app.ActivityThread; import android.app.AppGlobals; Loading Loading @@ -9317,7 +9319,7 @@ public class Intent implements Parcelable, Cloneable { } /** @hide */ public int getContentUserHint() { public @CanBeCURRENT @UserIdInt int getContentUserHint() { return mContentUserHint; } Loading