diff options
| author | Andrii Kulian <akulian@google.com> | 2017-04-07 16:23:12 -0700 |
|---|---|---|
| committer | Andrii Kulian <akulian@google.com> | 2017-04-07 16:23:12 -0700 |
| commit | 1981f5fd17de4627201363ca57e90927a8a243fd (patch) | |
| tree | 4f866d838252fc255ce5c83e6d7d33c5f6a48795 /core/java/android/app/ActivityOptions.java | |
| parent | 7354ee76aab749fbe3a2b46b3c329add0bb632b6 (diff) | |
Use feature instead of hidden config for multi-display
Using a feature will allow app developers to find out if a
particular device supports running activities on secondary
screens before using the APIs.
Bug: 36776777
Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: I7121bdb782cac9df70121e9df5cbf3fcb76f4a93
Diffstat (limited to 'core/java/android/app/ActivityOptions.java')
| -rw-r--r-- | core/java/android/app/ActivityOptions.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index aa7cdf7b475e..02d18841f489 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -155,6 +155,7 @@ public class ActivityOptions { /** * The display id the activity should be launched into. + * @see #setLaunchDisplayId(int) * @hide */ private static final String KEY_LAUNCH_DISPLAY_ID = "android.activity.launchDisplayId"; @@ -1038,6 +1039,7 @@ public class ActivityOptions { * Gets the id of the display where activity should be launched. * @return The id of the display where activity should be launched, * {@link android.view.Display#INVALID_DISPLAY} if not set. + * @see #setLaunchDisplayId(int) */ public int getLaunchDisplayId() { return mLaunchDisplayId; @@ -1045,6 +1047,12 @@ public class ActivityOptions { /** * Sets the id of the display where activity should be launched. + * An app can launch activities on public displays or private displays that are owned by the app + * or where an app already has activities. Otherwise, trying to launch on a private display + * or providing an invalid display id will result in an exception. + * <p> + * Setting launch display id will be ignored on devices that don't have + * {@link android.content.pm.PackageManager#FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS}. * @param launchDisplayId The id of the display where the activity should be launched. * @return {@code this} {@link ActivityOptions} instance. */ |
