diff options
| author | 2022-03-01 10:06:11 +0000 | |
|---|---|---|
| committer | 2022-03-02 03:16:59 +0000 | |
| commit | c2817ca17fbd322946edbad75abc008aa207b95c (patch) | |
| tree | dfebc09787db40370be46d8ed15f2d500ca7f55b | |
| parent | de4a9a6a069ba28c9d97d818dd030808987ac34b (diff) | |
Promote startActivityAsUser to SystemApi
Currently, Context#startActivityAsUser(Intent, UserHandle) has
already been a System API. This CL furthur makes
startActivityAsUser with ActivityOptions a System API.
This is enssential to launch an Activity to the secondary display
by setting launched display ID in ActivityOptions.
This also align the behavior of startActivity. We made all versions
of startActivity public APIs.
Bug: 199829817
Test: presubit
CTS-Coverage-Bug: 222189824
Change-Id: Ia1db353d4b91a8952d4d21b970253e1ac03e8173
| -rw-r--r-- | core/api/system-current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/content/Context.java | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 83464f0ca1df..40e925464928 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -468,7 +468,6 @@ package android.app { method public boolean convertToTranslucent(android.app.Activity.TranslucentConversionListener, android.app.ActivityOptions); method @Deprecated public boolean isBackgroundVisibleBehind(); method @Deprecated public void onBackgroundVisibleBehindChanged(boolean); - method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void startActivityAsUser(@NonNull android.content.Intent, @Nullable android.os.Bundle, @NonNull android.os.UserHandle); method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void startActivityForResultAsUser(@NonNull android.content.Intent, int, @NonNull android.os.UserHandle); method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void startActivityForResultAsUser(@NonNull android.content.Intent, int, @Nullable android.os.Bundle, @NonNull android.os.UserHandle); method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public void startActivityForResultAsUser(@NonNull android.content.Intent, @NonNull String, int, @Nullable android.os.Bundle, @NonNull android.os.UserHandle); @@ -2931,6 +2930,7 @@ package android.content { method public void sendBroadcastMultiplePermissions(@NonNull android.content.Intent, @NonNull String[], @Nullable android.app.BroadcastOptions); method public abstract void sendOrderedBroadcast(@NonNull android.content.Intent, @Nullable String, @Nullable android.os.Bundle, @Nullable android.content.BroadcastReceiver, @Nullable android.os.Handler, int, @Nullable String, @Nullable android.os.Bundle); method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public void startActivityAsUser(@NonNull @RequiresPermission android.content.Intent, @NonNull android.os.UserHandle); + method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public void startActivityAsUser(@NonNull @RequiresPermission android.content.Intent, @Nullable android.os.Bundle, @NonNull android.os.UserHandle); field public static final String AMBIENT_CONTEXT_SERVICE = "ambient_context"; field public static final String APP_HIBERNATION_SERVICE = "app_hibernation"; field public static final String APP_INTEGRITY_SERVICE = "app_integrity"; diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 2bda020192d5..60efb4d3ec81 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2011,9 +2011,9 @@ public abstract class Context { * @hide */ @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) - @UnsupportedAppUsage - public void startActivityAsUser(@RequiresPermission Intent intent, @Nullable Bundle options, - UserHandle userId) { + @SystemApi + public void startActivityAsUser(@RequiresPermission @NonNull Intent intent, + @Nullable Bundle options, @NonNull UserHandle userId) { throw new RuntimeException("Not implemented. Must override in a subclass."); } |