Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eafd9db6 authored by Andrii Kulian's avatar Andrii Kulian
Browse files

Add system config to specify Multi-Display support

Added config_supportsMultiDisplay. Devices that have the config set
to false will not allow launching activities on secondary screens.

Bug: 36776777
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testMultiDisplayDisabled
Change-Id: Iebb79044440866b1693897b0b53ccb987b5fd8e0
parent 154bbb00
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -66,4 +66,8 @@
    <!-- The small screens of watch devices makes multi-window support undesireable. -->
    <bool name="config_supportsMultiWindow">false</bool>
    <bool name="config_supportsSplitScreenMultiWindow">false</bool>

    <!-- Disable Multi-Display because of small screen space and lack of external display connection
         options. -->
    <bool name="config_supportsMultiDisplay">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -2651,6 +2651,9 @@
    <!-- True if the device supports split screen as a form of multi-window. -->
    <bool name="config_supportsSplitScreenMultiWindow">true</bool>

    <!-- True if the device supports running activities on secondary displays. -->
    <bool name="config_supportsMultiDisplay">true</bool>

    <!-- True if the device has no home screen. That is a launcher activity
         where the user can launch other applications from.  -->
    <bool name="config_noHomeScreen">false</bool>
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="bool" name="config_supportsMultiWindow" />
  <java-symbol type="bool" name="config_supportsSplitScreenMultiWindow" />
  <java-symbol type="bool" name="config_supportsMultiDisplay" />
  <java-symbol type="bool" name="config_noHomeScreen" />
  <java-symbol type="bool" name="config_guestUserEphemeral" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
+3 −0
Original line number Diff line number Diff line
@@ -1553,6 +1553,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    boolean mSupportsSplitScreenMultiWindow;
    boolean mSupportsFreeformWindowManagement;
    boolean mSupportsPictureInPicture;
    boolean mSupportsMultiDisplay;
    boolean mSupportsLeanbackOnly;
    IActivityController mController = null;
    boolean mControllerIsAMonkey = false;
@@ -13926,6 +13927,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                    com.android.internal.R.fraction.thumbnail_fullscreen_scale, 1, 1);
            }
            mWaitForNetworkTimeoutMs = waitForNetworkTimeoutMs;
            mSupportsMultiDisplay = res.getBoolean(
                    com.android.internal.R.bool.config_supportsMultiDisplay);
        }
    }
+13 −0
Original line number Diff line number Diff line
@@ -247,6 +247,8 @@ 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":
@@ -2398,6 +2400,15 @@ 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(res.getBoolean(com.android.internal.R.bool.config_supportsMultiDisplay));
        return 0;
    }

    int runUpdateApplicationInfo(PrintWriter pw) throws RemoteException {
        int userid = UserHandle.parseUserArg(getNextArgRequired());
        ArrayList<String> packages = new ArrayList<>();
@@ -2627,6 +2638,8 @@ 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");
Loading