Home
last modified time | relevance | path

Searched refs:command (Results 1 – 25 of 240) sorted by relevance

12345678910

/cts/tests/tests/time/shell_utils/common/android/app/time/cts/shell/
DDeviceShellCommandExecutor.java28 public final String executeToString(@NonNull String command) throws Exception { in executeToString() argument
29 byte[] bytes = executeToBytesInternal(command); in executeToString()
31 log("Executed '" + command + "': Result='" + result + "'"); in executeToString()
37 public final String executeToTrimmedString(@NonNull String command) throws Exception { in executeToTrimmedString() argument
38 byte[] bytes = executeToBytesInternal(command); in executeToTrimmedString()
40 log("Executed '" + command + "': Result='" + result + "'"); in executeToTrimmedString()
49 public final boolean executeToBoolean(@NonNull String command) throws Exception { in executeToBoolean() argument
50 byte[] bytes = executeToBytesInternal(command); in executeToBoolean()
52 log("Executed '" + command + "': Result='" + result + "'"); in executeToBoolean()
58 public final byte[] executeToBytes(@NonNull String command) throws Exception { in executeToBytes() argument
[all …]
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/utils/
DShellCommandUtils.java77 static String executeCommand(String command) throws AdbException { in executeCommand() argument
78 return executeCommand(command, /* allowEmptyOutput=*/ false, /* stdInBytes= */ null); in executeCommand()
81 static String executeCommand(String command, boolean allowEmptyOutput, byte[] stdInBytes) in executeCommand() argument
83 logCommand(command, allowEmptyOutput, stdInBytes); in executeCommand()
86 return executeCommandPreS(command, allowEmptyOutput, stdInBytes); in executeCommand()
92 ParcelFileDescriptor[] fds = uiAutomation().executeShellCommandRwe(command); in executeCommand()
103 throw new AdbException("Error executing command", command, out, err); in executeCommand()
112 throw new AdbException("Error executing command", command, e); in executeCommand()
116 static byte[] executeCommandForBytes(String command) throws AdbException { in executeCommandForBytes() argument
117 return executeCommandForBytes(command, /* stdInBytes= */ null); in executeCommandForBytes()
[all …]
DShellCommand.java41 public static Builder builder(String command) { in builder() argument
42 if (command == null) { in builder()
45 return new Builder(command); in builder()
52 public static Builder builderForUser(@Nullable UserReference userReference, String command) { in builderForUser() argument
53 Builder builder = builder(command); in builderForUser()
70 private Builder(String command) { in Builder() argument
71 commandBuilder = new StringBuilder(command); in Builder()
/cts/common/device-side/bedstead/nene/common/src/main/java/com/android/bedstead/nene/exceptions/
DAdbException.java30 public AdbException(String message, String command, String output) { in AdbException() argument
31 this(message, command, output, /* err= */ (String) null); in AdbException()
34 public AdbException(String message, String command, String output, String err) { in AdbException() argument
36 if (command == null) { in AdbException()
39 this.mCommand = command; in AdbException()
44 public AdbException(String message, String command, Throwable cause) { in AdbException() argument
45 this(message, command, /* output= */ null, cause); in AdbException()
48 public AdbException(String message, String command, String output, Throwable cause) { in AdbException() argument
50 if (command == null) { in AdbException()
53 this.mCommand = command; in AdbException()
[all …]
/cts/tests/accessibility/common/src/android/accessibility/cts/common/
DShellCommandBuilder.java64 for (Runnable command : mCommands) { in run()
65 command.run(); in run()
86 public ShellCommandBuilder addCommand(String command) { in addCommand() argument
88 execShellCommand(mUiAutomation, command); in addCommand()
93 public ShellCommandBuilder addCommandPrintOnLogCat(String command) { in addCommandPrintOnLogCat() argument
95 execShellCommandAndPrintOnLogcat(mUiAutomation, command); in addCommandPrintOnLogCat()
100 public static void execShellCommandAndPrintOnLogcat(UiAutomation automation, String command) { in execShellCommandAndPrintOnLogcat() argument
101 Log.i(LOG_TAG, "command [" + command + "]"); in execShellCommandAndPrintOnLogcat()
103 final String output = SystemUtil.runShellCommand(automation, command); in execShellCommandAndPrintOnLogcat()
108 throw new RuntimeException("Failed to exec shell command [" + command + "]", e); in execShellCommandAndPrintOnLogcat()
[all …]
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2020-0069/
Dpoc.c81 instructions[command.buffer_size / 8] = (x); \
82 command.buffer_size += 8;
88 struct cmdqCommandStruct command; in work_out_ioctl_code() local
91 memset(&command, 0, sizeof(command)); in work_out_ioctl_code()
93 command.buffer = (uint64_t)&instructions; in work_out_ioctl_code()
104 ioctl(fd, CMDQ_IOCTL_EXEC_COMMAND | (ii << 16), &command); in work_out_ioctl_code()
122 struct cmdqCommandStruct command; in perform_pa_read() local
140 memset(&command, 0, sizeof(command)); in perform_pa_read()
141 command.buffer = (uint64_t)instructions; in perform_pa_read()
142 command.read_address.count = size; in perform_pa_read()
[all …]
/cts/hostsidetests/packagemanager/multiuser/src/com/android/tests/packagemanager/multiuser/host/
DPackageManagerMultiUserTestBase.java95 String command = "pm create-user TestUser_" + System.currentTimeMillis(); in createUser() local
96 LogUtil.CLog.d("Starting command " + command); in createUser()
97 String commandOutput = getDevice().executeShellCommand(command); in createUser()
98 LogUtil.CLog.d("Output for command " + command + ": " + commandOutput); in createUser()
116 String command = "pm remove-user " + userId; in removeUser() local
117 LogUtil.CLog.d("Starting command " + command); in removeUser()
118 String commandOutput = getDevice().executeShellCommand(command); in removeUser()
119 LogUtil.CLog.d("Output for command " + command + ": " + commandOutput); in removeUser()
123 String command = "pm install-existing --user " + userId + " " + pkgName; in installExistingPackageForUser() local
124 LogUtil.CLog.d("Starting command " + command); in installExistingPackageForUser()
[all …]
/cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/
DBaseLauncherAppsTest.java51 String command = "am startservice --user " + userId in startCallbackService() local
54 CLog.d("Output for command " + command + ": " + getDevice().executeShellCommand(command)); in startCallbackService()
58 String command = "dumpsys activity services " + LAUNCHER_TESTS_SUPPORT_COMPONENT in isCallbackServiceReady() local
60 String result = getDevice().executeShellCommand(command); in isCallbackServiceReady()
61 CLog.d("Check service started by " + command + ": " + result); in isCallbackServiceReady()
DBaseDevicePolicyTest.java290 protected void waitForOutput(String message, String command, Predicate<String> predicate, in waitForOutput() argument
293 while (!predicate.test(getDevice().executeShellCommand(command))) { in waitForOutput()
397 protected String executeShellCommand(String command) throws Exception { in executeShellCommand() argument
398 CLog.d("Starting command %s", command); in executeShellCommand()
399 String commandOutput = getDevice().executeShellCommand(command); in executeShellCommand()
400 CLog.d("Output for command %s: %s", command, commandOutput); in executeShellCommand()
456 String command = "pm list users"; in getUserFlags() local
457 String commandOutput = getDevice().executeShellCommand(command); in getUserFlags()
458 CLog.i("Output for command " + command + ": " + commandOutput); in getUserFlags()
698 String command ="pm create-user " + (guest ? "--guest " : "") in createUser() local
[all …]
/cts/tests/inputmethod/mocka11yime/service/src/com/android/cts/mocka11yime/
DMockA11yIme.java127 mCommandReceiver = new CommandReceiver(actionName, command -> { in onCreate()
128 if (command.shouldDispatchToMainThread()) { in onCreate()
129 handler.post(() -> onHandleCommand(command)); in onCreate()
131 onHandleCommand(command); in onCreate()
198 private void onHandleCommand(@NonNull MockA11yImeCommand command) { in onHandleCommand() argument
199 getTracer().onHandleCommand(command, () -> { in onHandleCommand()
200 if (command.shouldDispatchToMainThread()) { in onHandleCommand()
202 throw new IllegalStateException("command " + command in onHandleCommand()
205 switch (command.getName()) { in onHandleCommand()
251 final CharSequence text = command.getExtras().getCharSequence("text"); in onHandleCommand()
[all …]
/cts/tests/tests/security/src/android/security/cts/
DAudioSecurityTest.java162 byte command[] = new byte[8]; in testAudioEffectGetParameter()
163 Arrays.fill(command, (byte)1); in testAudioEffectGetParameter()
168 audioEffect, EFFECT_CMD_OFFLOAD, command, reply); in testAudioEffectGetParameter()
173 byte command[] = new byte[30]; in testAudioEffectGetParameter()
174 Arrays.fill(command, (byte)0xDD); in testAudioEffectGetParameter()
179 audioEffect, EFFECT_CMD_GET_PARAM, command, reply); in testAudioEffectGetParameter()
205 byte command[] = new byte[8]; in testAudioEffectGetParameter2()
206 Arrays.fill(command, (byte)1); in testAudioEffectGetParameter2()
211 audioEffect, EFFECT_CMD_OFFLOAD, command, reply); in testAudioEffectGetParameter2()
218 byte command[] = ByteBuffer.allocate(5 * 4 /* capacity */) in testAudioEffectGetParameter2()
[all …]
DEffectBundleTest.java140 final int command = Equalizer.PARAM_GET_PRESET_NAME; in testParamPresetName() local
146 if (!eqGetParam(media, command, invalidBand, reply)) { in testParamPresetName()
178 final int command = Equalizer.PARAM_BAND_LEVEL; in testEqualizer_setParamBandLevel() local
182 if (!eqSetParam(MEDIA_SHORT, command, invalidBand, value)) { in testEqualizer_setParamBandLevel()
195 final int command = Equalizer.PARAM_BAND_LEVEL; in testEqualizer_setParamBandLevel_long() local
199 if (!eqSetParam(MEDIA_LONG, command, invalidBand, value)) { in testEqualizer_setParamBandLevel_long()
309 byte command[] = concatArrays(/*status*/ intToByteArray(0), in eqSetParamProperties()
319 byte[].class).invoke(af, cmdCode, command, reply); in eqSetParamProperties()
352 byte command[] = concatArrays(/*status*/ intToByteArray(0), in eqGetParamFreqRangeCommand()
358 byte reply[] = new byte[command.length]; in eqGetParamFreqRangeCommand()
[all …]
/cts/tests/tests/telephony2/src/android/telephony2/cts/
DPhoneNumberTest.java39 StringBuilder command = new StringBuilder(); in setDefaultSmsApp() local
40 command.append("appops set "); in setDefaultSmsApp()
41 command.append(getInstrumentation().getContext().getPackageName()); in setDefaultSmsApp()
42 command.append(" WRITE_SMS "); in setDefaultSmsApp()
43 command.append(setToSmsApp ? "allow" : "default"); in setDefaultSmsApp()
46 .executeShellCommand(command.toString()); in setDefaultSmsApp()
/cts/hostsidetests/shortcuts/hostside/src/android/content/pm/cts/shortcuthost/
DBaseShortcutManagerHostTest.java91 protected String executeShellCommandWithLog(String command) throws DeviceNotAvailableException { in executeShellCommandWithLog() argument
92 CLog.i("Executing command: " + command); in executeShellCommandWithLog()
93 final String output = getDevice().executeShellCommand(command); in executeShellCommandWithLog()
174 final String command = "pm create-user --profileOf " + parentUserId in createProfile() local
176 CLog.d("Starting command: " + command); in createProfile()
177 final String output = getDevice().executeShellCommand(command); in createProfile()
178 CLog.d("Output for command " + command + ": " + output); in createProfile()
262 private String runCommand(String command) throws Exception { in runCommand() argument
263 return runCommand(command, "", true); in runCommand()
266 private String runCommand(String command, String expectedOutputPattern) throws Exception { in runCommand() argument
[all …]
/cts/tests/inputmethod/src/android/view/inputmethod/cts/
DInputConnectionEndToEndTest.java667 final ImeCommand command = session.callGetTextAfterCursor(expectedN, expectedFlags); in testGetTextAfterCursor()
669 expectCommand(stream, command, TIMEOUT).getReturnCharSequenceValue(); in testGetTextAfterCursor()
704 final ImeCommand command = session.callGetTextAfterCursor(-1, 0); in testGetTextAfterCursorFailWithNegativeLength()
705 final ImeEvent result = expectCommand(stream, command, LONG_TIMEOUT); in testGetTextAfterCursorFailWithNegativeLength()
744 final ImeCommand command = session.callGetTextAfterCursor(expectedN, expectedFlags); in testGetTextAfterCursorFailWithTimeout()
746 final ImeEvent result = expectCommand(stream, command, LONG_TIMEOUT); in testGetTextAfterCursorFailWithTimeout()
829 final ImeCommand command = session.callGetTextBeforeCursor(expectedN, expectedFlags); in testGetTextBeforeCursor()
831 expectCommand(stream, command, TIMEOUT).getReturnCharSequenceValue(); in testGetTextBeforeCursor()
866 final ImeCommand command = session.callGetTextBeforeCursor(-1, 0); in testGetTextBeforeCursorFailWithNegativeLength()
867 final ImeEvent result = expectCommand(stream, command, LONG_TIMEOUT); in testGetTextBeforeCursorFailWithNegativeLength()
[all …]
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DSetPolicyActivity.java58 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
59 Log.i(TAG, "Command: \"" + command); in handleIntent()
61 if (ADD_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
66 } else if (CLEAR_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
72 } else if (ADD_CROSS_PROFILE_WIDGET_COMMAND.equals(command)) { in handleIntent()
78 } else if (REMOVE_CROSS_PROFILE_WIDGET_COMMAND.equals(command)) { in handleIntent()
85 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/cts/tests/inputmethod/mockime/src/com/android/cts/mockime/
DMockIme.java170 private void onReceiveCommand(@NonNull ImeCommand command) { in onReceiveCommand() argument
171 getTracer().onReceiveCommand(command, () -> { in onReceiveCommand()
172 if (command.shouldDispatchToMainThread()) { in onReceiveCommand()
173 mMainHandler.post(() -> onHandleCommand(command)); in onReceiveCommand()
175 onHandleCommand(command); in onReceiveCommand()
181 private void onHandleCommand(@NonNull ImeCommand command) { in onHandleCommand() argument
182 getTracer().onHandleCommand(command, () -> { in onHandleCommand()
183 if (command.shouldDispatchToMainThread()) { in onHandleCommand()
185 throw new IllegalStateException("command " + command in onHandleCommand()
198 switch (command.getName()) { in onHandleCommand()
[all …]
/cts/tests/tests/media/misc/src/android/media/misc/cts/
DSession2CommandTest.java49 Session2Command command = new Session2Command(Session2Command.COMMAND_CODE_CUSTOM); in testConstructorWithCommandCodeCustom() local
59 Session2Command command = new Session2Command(null, null); in testConstructorWithNullAction() local
99 Session2Command command = new Session2Command(TEST_COMMAND_CODE); in testDescribeContents() local
100 assertEquals(expected, command.describeContents()); in testDescribeContents()
105 Session2Command command = new Session2Command(TEST_CUSTOM_ACTION, null); in testWriteToParcel() local
107 command.writeToParcel(dest, 0); in testWriteToParcel()
109 assertEquals(command.getCommandCode(), dest.readInt()); in testWriteToParcel()
110 assertEquals(command.getCustomAction(), dest.readString()); in testWriteToParcel()
111 assertEquals(command.getCustomExtras(), dest.readBundle()); in testWriteToParcel()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DSetPolicyActivity.java72 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
73 Log.i(TAG, "Command: " + command + " UID: " + Process.myUid() + " DPM: " + dpm); in handleIntent()
75 if (COMMAND_ADD_USER_RESTRICTION.equals(command)) { in handleIntent()
80 } else if (COMMAND_CLEAR_USER_RESTRICTION.equals(command)) { in handleIntent()
86 } else if (COMMAND_BLOCK_ACCOUNT_TYPE.equals(command)) { in handleIntent()
92 } else if (COMMAND_UNBLOCK_ACCOUNT_TYPE.equals(command)) { in handleIntent()
98 } else if (COMMAND_SET_APP_RESTRICTIONS_MANAGER.equals(command)) { in handleIntent()
107 } else if (COMMAND_SET_DELEGATED_SCOPES.equals(command)) { in handleIntent()
116 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/cts/tests/app/app/src/android/app/stubs/
DCommandReceiver.java111 int command = intent.getIntExtra(EXTRA_COMMAND, -1); in onReceive() local
112 Log.d(TAG + "_" + context.getPackageName(), "Got command " + command + ", intent=" in onReceive()
114 switch (command) { in onReceive()
206 int command = LocalForegroundService.COMMAND_START_FOREGROUND; in doStartForegroundService() local
207 fgsIntent.putExtras(LocalForegroundService.newCommand(command)); in doStartForegroundService()
229 int command = LocalForegroundServiceLocation.COMMAND_START_FOREGROUND_WITH_TYPE; in doStartForegroundServiceWithType() local
230 fgsIntent.putExtras(LocalForegroundService.newCommand(command)); in doStartForegroundServiceWithType()
244 int command = LocalForegroundService.COMMAND_START_FOREGROUND; in doStartForegroundServiceSticky() local
245 fgsIntent.putExtras(LocalForegroundService.newCommand(command)); in doStartForegroundServiceSticky()
301 int command = LocalForegroundServiceLocation.COMMAND_START_FOREGROUND_WITH_TYPE; in doCreateFgslPendingIntent() local
[all …]
DLocalForegroundService.java82 final int command = intent.getIntExtra(EXTRA_COMMAND, -1); in onStartCommand() local
84 Log.d(getTag(), "service start cmd " + command + ", intent " + intent); in onStartCommand()
86 switch (command) { in onStartCommand()
91 final boolean showNow = (command == COMMAND_START_FOREGROUND); in onStartCommand()
129 Log.e(getTag(), "Unknown command: " + command); in onStartCommand() local
147 public static Bundle newCommand(IBinder stateReceiver, int command) { in newCommand() argument
150 bundle.putInt(EXTRA_COMMAND, command); in newCommand()
154 public static Bundle newCommand(int command) { in newCommand() argument
157 bundle.putInt(EXTRA_COMMAND, command); in newCommand()
/cts/tests/backup/src/android/backup/cts/
DBaseBackupCtsTest.java43 protected InputStream executeShellCommand(String command) {
44 return executeInstrumentationShellCommand(getInstrumentation(), command);
50 protected InputStream executeShellCommand(String command) {
51 return executeInstrumentationShellCommand(getInstrumentation(), command);
103 Instrumentation instrumentation, String command) { in executeInstrumentationShellCommand() argument
105 instrumentation.getUiAutomation().executeShellCommand(command); in executeInstrumentationShellCommand()
/cts/tests/tests/voiceinteraction/src/android/voiceinteraction/cts/testcore/
DVoiceInteractionSessionControl.java87 final Bundle command = new Bundle(); in executeCommand() local
88 command.putString(Utils.VOICE_INTERACTION_KEY_COMMAND, action); in executeCommand()
89 command.putParcelable(Utils.VOICE_INTERACTION_DIRECT_ACTIONS_KEY_ACTION, directAction); in executeCommand()
90 command.putBundle(Utils.VOICE_INTERACTION_KEY_ARGUMENTS, arguments); in executeCommand()
91 command.putParcelable(Utils.VOICE_INTERACTION_KEY_CALLBACK, callback); in executeCommand()
94 + Utils.toBundleString(command)); in executeCommand()
95 mControl.sendResult(command); in executeCommand()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DSetPolicyActivity.java57 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
58 Log.i(TAG, "Command: \"" + command + " DPM: " + dpm); in handleIntent()
60 if (ADD_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
65 } else if (CLEAR_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
71 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/cts/hostsidetests/securitybulletin/src/android/security/cts/
DLaunchSomeWhere.java78 String command = "am start"; in launchSomeWhere() local
86 command += " " + s; in launchSomeWhere()
89 AdbUtils.runCommandLine(command, device); in launchSomeWhere()

12345678910