Merge "Use feature instead of hidden config for multi-display" into oc-dev

am: 72790bade5

Change-Id: I557c1b47e960ff2b7715dc71827ac200a21952db
This commit is contained in:
Andrii Kulian
2017-04-08 02:00:57 +00:00
committed by android-build-merger
8 changed files with 22 additions and 24 deletions

View File

@@ -10616,6 +10616,7 @@ package android.content.pm {
field public static final int DONT_KILL_APP = 1; // 0x1
field public static final java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
field public static final java.lang.String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS = "android.software.activities_on_secondary_displays";
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";

View File

@@ -11300,6 +11300,7 @@ package android.content.pm {
field public static final java.lang.String EXTRA_REQUEST_PERMISSIONS_RESULTS = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS";
field public static final java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
field public static final java.lang.String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS = "android.software.activities_on_secondary_displays";
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";

View File

@@ -10655,6 +10655,7 @@ package android.content.pm {
field public static final int DONT_KILL_APP = 1; // 0x1
field public static final java.lang.String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
field public static final java.lang.String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT";
field public static final java.lang.String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS = "android.software.activities_on_secondary_displays";
field public static final java.lang.String FEATURE_APP_WIDGETS = "android.software.app_widgets";
field public static final java.lang.String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
field public static final java.lang.String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output";

View File

@@ -1117,16 +1117,6 @@ public class ActivityManager {
com.android.internal.R.bool.config_supportsSplitScreenMultiWindow);
}
/**
* Returns true if the system supports running activities on secondary displays.
* @hide
*/
static public boolean supportsMultiDisplay() {
return !isLowRamDeviceStatic()
&& Resources.getSystem().getBoolean(
com.android.internal.R.bool.config_supportsMultiDisplay);
}
/**
* Return the maximum number of actions that will be displayed in the picture-in-picture UI when
* the user interacts with the activity currently in picture-in-picture mode.

View File

@@ -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.
*/

View File

@@ -2283,6 +2283,14 @@ public abstract class PackageManager {
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device supports running activities on secondary displays.
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS
= "android.software.activities_on_secondary_displays";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device supports creating secondary users and managed profiles via

View File

@@ -30,6 +30,7 @@ import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.FULLSCREEN_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.content.pm.PackageManager.FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS;
import static android.content.pm.PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT;
import static android.content.pm.PackageManager.FEATURE_LEANBACK_ONLY;
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
@@ -13766,7 +13767,8 @@ public class ActivityManagerService extends IActivityManager.Stub
final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
final boolean supportsSplitScreenMultiWindow =
ActivityManager.supportsSplitScreenMultiWindow();
final boolean supportsMultiDisplay = ActivityManager.supportsMultiDisplay();
final boolean supportsMultiDisplay = mContext.getPackageManager()
.hasSystemFeature(FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS);
final String debugApp = Settings.Global.getString(resolver, DEBUG_APP);
final boolean waitForDebugger = Settings.Global.getInt(resolver, WAIT_FOR_DEBUGGER, 0) != 0;
final boolean alwaysFinishActivities =

View File

@@ -247,8 +247,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
return runSupportsMultiwindow(pw);
case "supports-split-screen-multi-window":
return runSupportsSplitScreenMultiwindow(pw);
case "supports-multi-display":
return runSupportsMultiDisplay(pw);
case "update-appinfo":
return runUpdateApplicationInfo(pw);
case "no-home-screen":
@@ -2399,15 +2397,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
return 0;
}
int runSupportsMultiDisplay(PrintWriter pw) throws RemoteException {
final Resources res = getResources(pw);
if (res == null) {
return -1;
}
pw.println(ActivityManager.supportsMultiDisplay());
return 0;
}
int runUpdateApplicationInfo(PrintWriter pw) throws RemoteException {
int userid = UserHandle.parseUserArg(getNextArgRequired());
ArrayList<String> packages = new ArrayList<>();
@@ -2637,8 +2626,6 @@ final class ActivityManagerShellCommand extends ShellCommand {
pw.println(" Returns true if the device supports multiwindow.");
pw.println(" supports-split-screen-multi-window");
pw.println(" Returns true if the device supports split screen multiwindow.");
pw.println(" supports-multi-display");
pw.println(" Returns true if the device supports multi-display.");
pw.println(" suppress-resize-config-changes <true|false>");
pw.println(" Suppresses configuration changes due to user resizing an activity/task.");
pw.println(" set-inactive [--user <USER_ID>] <PACKAGE> true|false");