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

Commit f3f3a60d authored by Arthur Hsu's avatar Arthur Hsu
Browse files

Create am no-home-screen command.

The no-home-screen command allows checking if the device had
no home screen. This is needed for CTS tests to correctly
detect that ARC++ devices have no home screen.

This is ported from ag/1851936 since it could not cherry-pick cleanly.
Original CL: I9c933f0b684cc82c74db948edf592fd067091a31

Bug: 33456072
Test: manual - adb shell am no-home-screen reports false by default.
Change-Id: I3df465a34393aa6e3f2934722a66ad909979824d
parent b29785db
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2608,6 +2608,10 @@
    <!-- True if the device supports split screen as a form of multi-window. -->
    <bool name="config_supportsSplitScreenMultiWindow">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>

    <!-- True if the device requires AppWidgetService even if it does not have
         the PackageManager.FEATURE_APP_WIDGETS feature -->
    <bool name="config_enableAppWidgetService">false</bool>
+1 −0
Original line number Diff line number Diff line
@@ -312,6 +312,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_noHomeScreen" />
  <java-symbol type="bool" name="config_guestUserEphemeral" />
  <java-symbol type="bool" name="config_localDisplaysMirrorContent" />
  <java-symbol type="integer" name="config_defaultDisplayDefaultColorMode" />
+11 −0
Original line number Diff line number Diff line
@@ -240,6 +240,8 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    return runSupportsSplitScreenMultiwindow(pw);
                case "update-appinfo":
                    return runUpdateApplicationInfo(pw);
                case "no-home-screen":
                    return runNoHomeScreen(pw);
                default:
                    return handleDefaultCommands(cmd);
            }
@@ -2386,6 +2388,15 @@ final class ActivityManagerShellCommand extends ShellCommand {
        return 0;
    }

    int runNoHomeScreen(PrintWriter pw) throws RemoteException {
        final Resources res = getResources(pw);
        if (res == null) {
            return -1;
        }
        pw.println(res.getBoolean(com.android.internal.R.bool.config_noHomeScreen));
        return 0;
    }

    private Resources getResources(PrintWriter pw) throws RemoteException {
        // system resources does not contain all the device configuration, construct it manually.
        Configuration config = mInterface.getConfiguration();