Merge "Support multi-window on low-memory watches." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c6372cceb1
@@ -1139,8 +1139,12 @@ public class ActivityManager {
|
||||
* E.g. freeform, split-screen, picture-in-picture.
|
||||
* @hide
|
||||
*/
|
||||
static public boolean supportsMultiWindow() {
|
||||
return !isLowRamDeviceStatic()
|
||||
static public boolean supportsMultiWindow(Context context) {
|
||||
// On watches, multi-window is used to present essential system UI, and thus it must be
|
||||
// supported regardless of device memory characteristics.
|
||||
boolean isWatch = context.getPackageManager().hasSystemFeature(
|
||||
PackageManager.FEATURE_WATCH);
|
||||
return (!isLowRamDeviceStatic() || isWatch)
|
||||
&& Resources.getSystem().getBoolean(
|
||||
com.android.internal.R.bool.config_supportsMultiWindow);
|
||||
}
|
||||
@@ -1149,8 +1153,8 @@ public class ActivityManager {
|
||||
* Returns true if the system supports split screen multi-window.
|
||||
* @hide
|
||||
*/
|
||||
static public boolean supportsSplitScreenMultiWindow() {
|
||||
return supportsMultiWindow()
|
||||
static public boolean supportsSplitScreenMultiWindow(Context context) {
|
||||
return supportsMultiWindow(context)
|
||||
&& Resources.getSystem().getBoolean(
|
||||
com.android.internal.R.bool.config_supportsSplitScreenMultiWindow);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class RecentsViewTouchHandler {
|
||||
}
|
||||
|
||||
mVisibleDockStates.clear();
|
||||
if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()
|
||||
if (ActivityManager.supportsMultiWindow(mRv.getContext()) && !ssp.hasDockedTask()
|
||||
&& mDividerSnapAlgorithm.isSplitScreenFeasible()) {
|
||||
Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(),
|
||||
event.task.resizeMode);
|
||||
|
||||
@@ -59,7 +59,7 @@ public class TaskViewAccessibilityDelegate extends View.AccessibilityDelegate {
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||
if (ActivityManager.supportsSplitScreenMultiWindow()
|
||||
if (ActivityManager.supportsSplitScreenMultiWindow(mTaskView.getContext())
|
||||
&& !Recents.getSystemServices().hasDockedTask()) {
|
||||
TaskStack.DockState[] dockStates = Recents.getConfiguration()
|
||||
.getDockStatesForCurrentOrientation();
|
||||
|
||||
@@ -545,7 +545,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
|
||||
}
|
||||
|
||||
private boolean onLongPressRecents() {
|
||||
if (mRecents == null || !ActivityManager.supportsMultiWindow()
|
||||
if (mRecents == null || !ActivityManager.supportsMultiWindow(getContext())
|
||||
|| !mDivider.getView().getSnapAlgorithm().isSplitScreenFeasible()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -13924,9 +13924,9 @@ public class ActivityManagerService extends IActivityManager.Stub
|
||||
final boolean supportsPictureInPicture =
|
||||
mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE);
|
||||
|
||||
final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
|
||||
final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow(mContext);
|
||||
final boolean supportsSplitScreenMultiWindow =
|
||||
ActivityManager.supportsSplitScreenMultiWindow();
|
||||
ActivityManager.supportsSplitScreenMultiWindow(mContext);
|
||||
final boolean supportsMultiDisplay = mContext.getPackageManager()
|
||||
.hasSystemFeature(FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS);
|
||||
final String debugApp = Settings.Global.getString(resolver, DEBUG_APP);
|
||||
|
||||
@@ -2382,7 +2382,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
|
||||
if (res == null) {
|
||||
return -1;
|
||||
}
|
||||
pw.println(ActivityManager.supportsMultiWindow());
|
||||
pw.println(ActivityManager.supportsMultiWindow(mInternal.mContext));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2391,7 +2391,7 @@ final class ActivityManagerShellCommand extends ShellCommand {
|
||||
if (res == null) {
|
||||
return -1;
|
||||
}
|
||||
pw.println(ActivityManager.supportsSplitScreenMultiWindow());
|
||||
pw.println(ActivityManager.supportsSplitScreenMultiWindow(mInternal.mContext));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user