Home
last modified time | relevance | path

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

1234567

/cts/suite/audio_quality/lib/src/
DAdb.cpp34 android::String8 command; in setPortForwarding() local
35 if (command.appendFormat("forward tcp:%d tcp:%d", hostPort, devicePort) != 0) { in setPortForwarding()
38 if (executeCommand(command) != 0) { in setPortForwarding()
46 android::String8 command; in launchClient() local
47 if (command.appendFormat("install -r %s", clientBinary.string()) != 0) { in launchClient()
50 if (executeCommand(command) != 0) { in launchClient()
53 command.clear(); in launchClient()
54 if (command.appendFormat("shell am start -W -n %s", component.string()) != 0) { in launchClient()
57 if (executeCommand(command) != 0) { in launchClient()
64 int Adb::executeCommand(const android::String8& command) in executeCommand() argument
[all …]
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DLocationUtils.java29 StringBuilder command = new StringBuilder(); in registerMockLocationProvider() local
30 command.append("appops set "); in registerMockLocationProvider()
31 command.append(instrumentation.getContext().getPackageName()); in registerMockLocationProvider()
32 command.append(" android:mock_location "); in registerMockLocationProvider()
33 command.append(enable ? "allow" : "deny"); in registerMockLocationProvider()
35 SystemUtil.runShellCommand(instrumentation, command.toString()); in registerMockLocationProvider()
37 Log.e(TAG, "Error managing mock location app. Command: " + command, e); in registerMockLocationProvider()
DShellUtils.java40 final String command = String.format(template, args); in runShellCommand() local
41 Log.d(TAG, "runShellCommand(): " + command); in runShellCommand()
44 .runShellCommand(InstrumentationRegistry.getInstrumentation(), command); in runShellCommand()
47 throw new RuntimeException("Command '" + command + "' failed: ", e); in runShellCommand()
/cts/common/device-side/util/src/com/android/compatibility/common/util/
DLocationUtils.java29 StringBuilder command = new StringBuilder(); in registerMockLocationProvider() local
30 command.append("appops set "); in registerMockLocationProvider()
31 command.append(instrumentation.getContext().getPackageName()); in registerMockLocationProvider()
32 command.append(" android:mock_location "); in registerMockLocationProvider()
33 command.append(enable ? "allow" : "deny"); in registerMockLocationProvider()
35 SystemUtil.runShellCommand(instrumentation, command.toString()); in registerMockLocationProvider()
37 Log.e(TAG, "Error managing mock location app. Command: " + command, e); in registerMockLocationProvider()
/cts/tests/inputmethod/mockime/src/com/android/cts/mockime/
DMockIme.java115 private void onReceiveCommand(@NonNull ImeCommand command) { in onReceiveCommand() argument
116 getTracer().onReceiveCommand(command, () -> { in onReceiveCommand()
117 if (command.shouldDispatchToMainThread()) { in onReceiveCommand()
118 mMainHandler.post(() -> onHandleCommand(command)); in onReceiveCommand()
120 onHandleCommand(command); in onReceiveCommand()
126 private void onHandleCommand(@NonNull ImeCommand command) { in onHandleCommand() argument
127 getTracer().onHandleCommand(command, () -> { in onHandleCommand()
128 if (command.shouldDispatchToMainThread()) { in onHandleCommand()
130 throw new IllegalStateException("command " + command in onHandleCommand()
133 switch (command.getName()) { in onHandleCommand()
[all …]
/cts/suite/audio_quality/lib/src/audio/
DAudioProtocol.cpp58 uint32_t command = ntohl(data[0]); in handleReplyHeader() local
59 if ((command & 0xffff0000) != 0x43210000) { in handleReplyHeader()
60 LOGE("Wrong header %x %x", command, data[0]); in handleReplyHeader()
63 command = (command & 0xffff) | 0x12340000; // convert to id in handleReplyHeader()
64 if (command < ECmdStart) { in handleReplyHeader()
65 LOGE("Wrong header %x %x", command, data[0]); in handleReplyHeader()
68 if (command > (ECmdLast - 1)) { in handleReplyHeader()
69 LOGE("Wrong header %x %x", command, data[0]); in handleReplyHeader()
72 id = (CommandId)command; in handleReplyHeader()
73 LOGD("received reply with command %x", command); in handleReplyHeader()
[all …]
/cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/
DBaseDevicePolicyTest.java227 protected void executeShellCommand(final String command) throws Exception { in executeShellCommand() argument
228 CLog.d("Starting command " + command); in executeShellCommand()
229 String commandOutput = getDevice().executeShellCommand(command); in executeShellCommand()
230 CLog.d("Output for command " + command + ": " + commandOutput); in executeShellCommand()
259 String command = "pm list users"; in getUserFlags() local
260 String commandOutput = getDevice().executeShellCommand(command); in getUserFlags()
261 CLog.i("Output for command " + command + ": " + commandOutput); in getUserFlags()
520 String command = "pm list features"; in hasDeviceFeature() local
521 String commandOutput = getDevice().executeShellCommand(command); in hasDeviceFeature()
522 CLog.i("Output for command " + command + ": " + commandOutput); in hasDeviceFeature()
[all …]
/cts/tests/tests/security/src/android/security/cts/
DAudioSecurityTest.java150 byte command[] = new byte[8]; in testAudioEffectGetParameter()
151 Arrays.fill(command, (byte)1); in testAudioEffectGetParameter()
156 audioEffect, EFFECT_CMD_OFFLOAD, command, reply); in testAudioEffectGetParameter()
161 byte command[] = new byte[30]; in testAudioEffectGetParameter()
162 Arrays.fill(command, (byte)0xDD); in testAudioEffectGetParameter()
167 audioEffect, EFFECT_CMD_GET_PARAM, command, reply); in testAudioEffectGetParameter()
193 byte command[] = new byte[8]; in testAudioEffectGetParameter2()
194 Arrays.fill(command, (byte)1); in testAudioEffectGetParameter2()
199 audioEffect, EFFECT_CMD_OFFLOAD, command, reply); in testAudioEffectGetParameter2()
206 byte command[] = ByteBuffer.allocate(5 * 4 /* capacity */) in testAudioEffectGetParameter2()
[all …]
DEffectBundleTest.java126 final int command = Equalizer.PARAM_GET_PRESET_NAME; in testParamPresetName() local
132 if (!eqGetParam(media, command, invalidBand, reply)) { in testParamPresetName()
163 final int command = Equalizer.PARAM_BAND_LEVEL; in testEqualizer_setParamBandLevel() local
167 if (!eqSetParam(MEDIA_SHORT, command, invalidBand, value)) { in testEqualizer_setParamBandLevel()
179 final int command = Equalizer.PARAM_BAND_LEVEL; in testEqualizer_setParamBandLevel_long() local
183 if (!eqSetParam(MEDIA_LONG, command, invalidBand, value)) { in testEqualizer_setParamBandLevel_long()
286 byte command[] = concatArrays(/*status*/ intToByteArray(0), in eqSetParamProperties()
296 byte[].class).invoke(af, cmdCode, command, reply); in eqSetParamProperties()
329 byte command[] = concatArrays(/*status*/ intToByteArray(0), in eqGetParamFreqRangeCommand()
335 byte reply[] = new byte[command.length]; in eqGetParamFreqRangeCommand()
[all …]
/cts/tests/accessibility/common/src/android/accessibility/cts/common/
DShellCommandBuilder.java62 for (Runnable command : mCommands) { in run()
63 command.run(); in run()
84 public ShellCommandBuilder addCommand(String command) { in addCommand() argument
86 execShellCommand(mUiAutomation, command); in addCommand()
91 public static void execShellCommand(UiAutomation automation, String command) { in execShellCommand() argument
92 Log.i(LOG_TAG, "command [" + command + "]"); in execShellCommand()
93 try (ParcelFileDescriptor fd = automation.executeShellCommand(command)) { in execShellCommand()
103 throw new RuntimeException("Failed to exec shell command [" + command + "]", e); in execShellCommand()
/cts/tests/app/app/src/android/app/stubs/
DCommandReceiver.java59 int command = intent.getIntExtra(EXTRA_COMMAND, -1); in onReceive() local
60 Log.d(TAG + "_" + context.getPackageName(), "Got command " + command + ", intent=" in onReceive()
62 switch (command) { in onReceive()
112 int command = LocalForegroundService.COMMAND_START_FOREGROUND; in doStartForegroundService() local
113 fgsIntent.putExtras(LocalForegroundService.newCommand(new Binder(), command)); in doStartForegroundService()
119 int command = LocalForegroundServiceLocation.COMMAND_START_FOREGROUND_WITH_TYPE; in doStartForegroundServiceWithType() local
120 fgsIntent.putExtras(LocalForegroundService.newCommand(new Binder(), command)); in doStartForegroundServiceWithType()
138 public static void sendCommand(Context context, int command, String sourcePackage, in sendCommand() argument
141 if (command == COMMAND_BIND_SERVICE || command == COMMAND_START_FOREGROUND_SERVICE) { in sendCommand()
145 intent.putExtra(EXTRA_COMMAND, command); in sendCommand()
DLocalForegroundService.java67 int command = intent.getIntExtra(EXTRA_COMMAND, -1); in onStart() local
69 Log.d(TAG, "service start cmd " + command + ", intent " + intent); in onStart()
71 switch (command) { in onStart()
102 Log.e(TAG, "Unknown command: " + command); in onStart()
116 public static Bundle newCommand(IBinder stateReceiver, int command) { in newCommand() argument
119 bundle.putInt(EXTRA_COMMAND, command); in newCommand()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DSetPolicyActivity.java75 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
76 Log.i(TAG, "Command: " + command); in handleIntent()
78 if (COMMAND_ADD_USER_RESTRICTION.equals(command)) { in handleIntent()
83 } else if (COMMAND_CLEAR_USER_RESTRICTION.equals(command)) { in handleIntent()
89 } else if (COMMAND_BLOCK_ACCOUNT_TYPE.equals(command)) { in handleIntent()
95 } else if (COMMAND_UNBLOCK_ACCOUNT_TYPE.equals(command)) { in handleIntent()
101 } else if (COMMAND_SET_APP_RESTRICTIONS_MANAGER.equals(command)) { in handleIntent()
110 } else if (COMMAND_SET_DELEGATED_SCOPES.equals(command)) { in handleIntent()
119 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/cts/tests/tests/media/src/android/media/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/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/multiuser/src/android/host/multiuser/
DBaseMultiUserTest.java87 final String command = "pm create-user --profileOf " + userId + " --restricted " in createRestrictedProfile() local
89 CLog.d("Starting command: " + command); in createRestrictedProfile()
90 final String output = getDevice().executeShellCommand(command); in createRestrictedProfile()
91 CLog.d("Output for command " + command + ": " + output); in createRestrictedProfile()
110 final String command = "pm create-user " in createUser() local
112 CLog.d("Starting command: " + command); in createUser()
113 final String output = getDevice().executeShellCommand(command); in createUser()
114 CLog.d("Output for command " + command + ": " + output); in createUser()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DSetPolicyActivity.java68 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
69 Log.i(TAG, "Command: \"" + command); in handleIntent()
71 if (ADD_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
76 } else if (CLEAR_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
82 } else if (ADD_CROSS_PROFILE_WIDGET_COMMAND.equals(command)) { in handleIntent()
88 } else if (REMOVE_CROSS_PROFILE_WIDGET_COMMAND.equals(command)) { in handleIntent()
95 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/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/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DSetPolicyActivity.java64 String command = intent.getStringExtra(EXTRA_COMMAND); in handleIntent() local
65 Log.i(TAG, "Command: \"" + command); in handleIntent()
67 if (ADD_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
72 } else if (CLEAR_RESTRICTION_COMMAND.equals(command)) { in handleIntent()
78 Log.e(TAG, "Invalid command: " + command); in handleIntent()
/cts/tests/framework/base/windowmanager/util/src/android/server/wm/
DCommandSession.java240 public void sendCommand(String command) {
241 sendCommand(command, null /* data */);
245 public void sendCommand(String command, Bundle data) {
254 intent.putExtra(KEY_COMMAND, command);
262 public Bundle sendCommandAndWaitReply(String command) {
263 return sendCommandAndWaitReply(command, null /* data */);
267 public Bundle sendCommandAndWaitReply(String command, Bundle data) {
277 mPendingCommand = command;
280 sendCommand(command, data);
514 void receiveCommand(String command, Bundle data);
[all …]
/cts/hostsidetests/incident/src/com/android/server/cts/
DProtoDumpTestCase.java99 public <T extends MessageLite> T getDump(Parser<T> parser, String command) throws Exception { in getDump() argument
101 getDevice().executeShellCommand(command, receiver); in getDump()
173 protected String execCommandAndGet(String command) throws Exception { in execCommandAndGet() argument
175 getDevice().executeShellCommand(command, receiver); in execCommandAndGet()
183 protected Matcher execCommandAndFind(String command, String pattern, int patternFlags) in execCommandAndFind() argument
185 final String output = execCommandAndGet(command); in execCommandAndFind()
195 protected Matcher execCommandAndFind(String command, String pattern) throws Exception { in execCommandAndFind() argument
196 return execCommandAndFind(command, pattern, 0); in execCommandAndFind()
203 protected String execCommandAndGetFirstGroup(String command, String pattern) throws Exception { in execCommandAndGetFirstGroup() argument
204 final Matcher matcher = execCommandAndFind(command, pattern); in execCommandAndGetFirstGroup()
/cts/tests/tests/notificationlegacy/notificationlegacy20/src/android/app/notification/legacy20/cts/
DLegacyNotificationManager20Test.java156 String command = " cmd notification " + (on ? "allow_dnd " : "disallow_dnd ") + packageName; in toggleNotificationPolicyAccess() local
158 runCommand(command, instrumentation); in toggleNotificationPolicyAccess()
168 String command = " cmd package " + (suspend ? "suspend " in suspendPackage() local
171 runCommand(command, instrumentation); in suspendPackage()
177 String command = " cmd notification " + (on ? "allow_listener " : "disallow_listener ") in toggleListenerAccess() local
180 runCommand(command, instrumentation); in toggleListenerAccess()
188 private void runCommand(String command, Instrumentation instrumentation) throws IOException { in runCommand() argument
191 try (ParcelFileDescriptor fd = uiAutomation.executeShellCommand(command)) { in runCommand()
192 Assert.assertNotNull("Failed to execute shell command: " + command, fd); in runCommand()
198 throw new IOException("Could not read stdout of command: " + command, e); in runCommand()
/cts/tools/utils/
Drerun.py81 command = ctsPath + "/tools/cts-tradefed run singleCommand cts"
83 command += " --serial " + deviceSerial
84 command += " --class " + className + " --method " + methodName
85 print command
86 os.system(command)
/cts/suite/audio_quality/lib/include/audio/
DRemoteAudio.h76 void sendCommand(android::sp<android::MessageHandler>& command);
79 bool waitForCompletion(android::sp<android::MessageHandler>& command, int timeInMSec);
86 CommandHandler* toCommandHandler(android::sp<android::MessageHandler>& command) { in toCommandHandler() argument
87 return reinterpret_cast<CommandHandler*>(command.get()); in toCommandHandler()
114 CommandHandler(RemoteAudio& thread, int command) in CommandHandler() argument
116 mMessage(command), in CommandHandler()
/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()

1234567