Merge "Add hidden API to check support of Multi-Display" into oc-dev

This commit is contained in:
Andrii Kulian
2017-04-07 20:22:54 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 6 deletions

View File

@@ -1117,6 +1117,16 @@ public class ActivityManager {
com.android.internal.R.bool.config_supportsSplitScreenMultiWindow); 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 * 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. * the user interacts with the activity currently in picture-in-picture mode.

View File

@@ -13763,6 +13763,7 @@ public class ActivityManagerService extends IActivityManager.Stub
final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow(); final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
final boolean supportsSplitScreenMultiWindow = final boolean supportsSplitScreenMultiWindow =
ActivityManager.supportsSplitScreenMultiWindow(); ActivityManager.supportsSplitScreenMultiWindow();
final boolean supportsMultiDisplay = ActivityManager.supportsMultiDisplay();
final String debugApp = Settings.Global.getString(resolver, DEBUG_APP); final String debugApp = Settings.Global.getString(resolver, DEBUG_APP);
final boolean waitForDebugger = Settings.Global.getInt(resolver, WAIT_FOR_DEBUGGER, 0) != 0; final boolean waitForDebugger = Settings.Global.getInt(resolver, WAIT_FOR_DEBUGGER, 0) != 0;
final boolean alwaysFinishActivities = final boolean alwaysFinishActivities =
@@ -13800,6 +13801,7 @@ public class ActivityManagerService extends IActivityManager.Stub
} }
mSupportsSplitScreenMultiWindow = supportsSplitScreenMultiWindow; mSupportsSplitScreenMultiWindow = supportsSplitScreenMultiWindow;
mSupportsPictureInPicture = supportsPictureInPicture; mSupportsPictureInPicture = supportsPictureInPicture;
mSupportsMultiDisplay = supportsMultiDisplay;
mWindowManager.setForceResizableTasks(mForceResizableActivities); mWindowManager.setForceResizableTasks(mForceResizableActivities);
mWindowManager.setSupportsPictureInPicture(mSupportsPictureInPicture); mWindowManager.setSupportsPictureInPicture(mSupportsPictureInPicture);
// This happens before any activities are started, so we can change global configuration // This happens before any activities are started, so we can change global configuration
@@ -13828,8 +13830,6 @@ public class ActivityManagerService extends IActivityManager.Stub
com.android.internal.R.fraction.thumbnail_fullscreen_scale, 1, 1); com.android.internal.R.fraction.thumbnail_fullscreen_scale, 1, 1);
} }
mWaitForNetworkTimeoutMs = waitForNetworkTimeoutMs; mWaitForNetworkTimeoutMs = waitForNetworkTimeoutMs;
mSupportsMultiDisplay = res.getBoolean(
com.android.internal.R.bool.config_supportsMultiDisplay);
} }
} }

View File

@@ -2386,7 +2386,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
if (res == null) { if (res == null) {
return -1; return -1;
} }
pw.println(res.getBoolean(com.android.internal.R.bool.config_supportsMultiWindow)); pw.println(ActivityManager.supportsMultiWindow());
return 0; return 0;
} }
@@ -2395,8 +2395,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
if (res == null) { if (res == null) {
return -1; return -1;
} }
pw.println( pw.println(ActivityManager.supportsSplitScreenMultiWindow());
res.getBoolean(com.android.internal.R.bool.config_supportsSplitScreenMultiWindow));
return 0; return 0;
} }
@@ -2405,7 +2404,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
if (res == null) { if (res == null) {
return -1; return -1;
} }
pw.println(res.getBoolean(com.android.internal.R.bool.config_supportsMultiDisplay)); pw.println(ActivityManager.supportsMultiDisplay());
return 0; return 0;
} }