From f3f3a60d350f449938c7a3493d008b9bdbb5fb07 Mon Sep 17 00:00:00 2001 From: Arthur Hsu Date: Tue, 21 Feb 2017 14:01:53 -0800 Subject: [PATCH] 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 --- core/res/res/values/config.xml | 4 ++++ core/res/res/values/symbols.xml | 1 + .../server/am/ActivityManagerShellCommand.java | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index ee7ea6a84bd06..16efe06af1e8b 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2608,6 +2608,10 @@ true + + false + false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 89ded8d5fbe69..b299ef9a34b22 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -312,6 +312,7 @@ + diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index 80df26b4ed424..aaad12c1f2892 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -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();