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

Commit 626e0cc0 authored by Matthew Ng's avatar Matthew Ng
Browse files

Added supports-split-screen-multi-window command to am

The supports-split-screen-multi-window command allows the ability to
check if the device has split screen multiwindow support in shell. The
other changes allows the code to determine if the device has support for
it as well.

This will also help CTS tests to determine if the device has split
screen before trying to run the test.

Test: manual - adb shell am supports-split-screen-multi-window
Change-Id: I3da32b5b03712a8537104469d67100ec796de9e6
parent 5686ade0
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -1004,6 +1004,16 @@ public class ActivityManager {
                    com.android.internal.R.bool.config_supportsMultiWindow);
                    com.android.internal.R.bool.config_supportsMultiWindow);
    }
    }


    /**
     * Returns true if the system supports split screen multi-window.
     * @hide
     */
    static public boolean supportsSplitScreenMultiWindow() {
        return supportsMultiWindow()
                && Resources.getSystem().getBoolean(
                    com.android.internal.R.bool.config_supportsSplitScreenMultiWindow);
    }

    /**
    /**
     * Information you can set and retrieve about the current activity within the recent task list.
     * Information you can set and retrieve about the current activity within the recent task list.
     */
     */
+1 −0
Original line number Original line Diff line number Diff line
@@ -65,4 +65,5 @@


    <!-- The small screens of watch devices makes multi-window support undesireable. -->
    <!-- The small screens of watch devices makes multi-window support undesireable. -->
    <bool name="config_supportsMultiWindow">false</bool>
    <bool name="config_supportsMultiWindow">false</bool>
    <bool name="config_supportsSplitScreenMultiWindow">false</bool>
</resources>
</resources>
+3 −0
Original line number Original line Diff line number Diff line
@@ -2568,6 +2568,9 @@
         E.g. freeform, split-screen, picture-in-picture. -->
         E.g. freeform, split-screen, picture-in-picture. -->
    <bool name="config_supportsMultiWindow">true</bool>
    <bool name="config_supportsMultiWindow">true</bool>


    <!-- True if the device supports split screen as a form of multi-window. -->
    <bool name="config_supportsSplitScreenMultiWindow">true</bool>

    <!-- True if the device requires AppWidgetService even if it does not have
    <!-- True if the device requires AppWidgetService even if it does not have
         the PackageManager.FEATURE_APP_WIDGETS feature -->
         the PackageManager.FEATURE_APP_WIDGETS feature -->
    <bool name="config_enableAppWidgetService">false</bool>
    <bool name="config_enableAppWidgetService">false</bool>
+1 −0
Original line number Original line Diff line number Diff line
@@ -307,6 +307,7 @@
  <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" />
  <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" />
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="bool" name="config_freeformWindowManagement" />
  <java-symbol type="bool" name="config_supportsMultiWindow" />
  <java-symbol type="bool" name="config_supportsMultiWindow" />
  <java-symbol type="bool" name="config_supportsSplitScreenMultiWindow" />
  <java-symbol type="bool" name="config_guestUserEphemeral" />
  <java-symbol type="bool" name="config_guestUserEphemeral" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
  <java-symbol type="integer" name="config_defaultDisplayDefaultColorMode" />
  <java-symbol type="integer" name="config_defaultDisplayDefaultColorMode" />
+4 −0
Original line number Original line Diff line number Diff line
@@ -1362,6 +1362,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    boolean mAlwaysFinishActivities = false;
    boolean mAlwaysFinishActivities = false;
    boolean mForceResizableActivities;
    boolean mForceResizableActivities;
    boolean mSupportsMultiWindow;
    boolean mSupportsMultiWindow;
    boolean mSupportsSplitScreenMultiWindow;
    boolean mSupportsFreeformWindowManagement;
    boolean mSupportsFreeformWindowManagement;
    boolean mSupportsPictureInPicture;
    boolean mSupportsPictureInPicture;
    boolean mSupportsLeanbackOnly;
    boolean mSupportsLeanbackOnly;
@@ -13125,6 +13126,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE);
                mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE);
        final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
        final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
        final boolean supportsSplitScreenMultiWindow =
                ActivityManager.supportsSplitScreenMultiWindow();
        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 =
@@ -13160,6 +13163,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                mSupportsFreeformWindowManagement = false;
                mSupportsFreeformWindowManagement = false;
                mSupportsPictureInPicture = false;
                mSupportsPictureInPicture = false;
            }
            }
            mSupportsSplitScreenMultiWindow = supportsSplitScreenMultiWindow;
            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
Loading