Home
last modified time | relevance | path

Searched refs:receiver (Results 1 – 25 of 83) sorted by relevance

1234

/cts/hostsidetests/monkey/src/com/android/cts/monkey/
DCategoryTest.java29 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in testDefaultCategories() local
31 mDevice.executeShellCommand(cmd, receiver, MAX_TIMEOUT, TimeUnit.MILLISECONDS, 0); in testDefaultCategories()
32 String out = receiver.getOutput(); in testDefaultCategories()
36 receiver.cancel(); in testDefaultCategories()
37 receiver.clearBuffer(); in testDefaultCategories()
38 receiver = null; in testDefaultCategories()
45 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in testSingleCategory() local
47 mDevice.executeShellCommand(cmd, receiver, MAX_TIMEOUT, TimeUnit.MILLISECONDS, 0); in testSingleCategory()
48 String out = receiver.getOutput(); in testSingleCategory()
52 receiver.cancel(); in testSingleCategory()
[all …]
DPackageTest.java38 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in testSinglePackage() local
40 mDevice.executeShellCommand(cmd, receiver, MAX_TIMEOUT, TimeUnit.MILLISECONDS, 0); in testSinglePackage()
41 String out = receiver.getOutput(); in testSinglePackage()
46 receiver.cancel(); in testSinglePackage()
47 receiver.clearBuffer(); in testSinglePackage()
48 receiver = null; in testSinglePackage()
68 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in testMultiplePackages() local
70 mDevice.executeShellCommand(cmd, receiver, MAX_TIMEOUT, TimeUnit.MILLISECONDS, 0); in testMultiplePackages()
71 String out = receiver.getOutput(); in testMultiplePackages()
76 receiver.cancel(); in testMultiplePackages()
[all …]
/cts/tests/app/src/android/app/cts/
DDownloadManagerTest.java62 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testDownloadManager() local
65 mContext.registerReceiver(receiver, intentFilter); in testDownloadManager()
76 receiver.waitForDownloadComplete(SHORT_TIMEOUT, goodId, badId); in testDownloadManager()
84 mContext.unregisterReceiver(receiver); in testDownloadManager()
91 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testDownloadManagerSupportsHttp() local
94 mContext.registerReceiver(receiver, intentFilter); in testDownloadManagerSupportsHttp()
102 receiver.waitForDownloadComplete(SHORT_TIMEOUT, id); in testDownloadManagerSupportsHttp()
108 mContext.unregisterReceiver(receiver); in testDownloadManagerSupportsHttp()
124 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testDownloadManagerSupportsHttpWithExternalWebServer() local
127 mContext.registerReceiver(receiver, intentFilter); in testDownloadManagerSupportsHttpWithExternalWebServer()
[all …]
DNewDocumentTest.java40 try (final Receiver receiver = new Receiver(NewDocumentTestActivity.NOTIFY_RESUME)) { in testNewDocument() argument
42 receiver.await(); in testNewDocument()
45 try (final Receiver receiver = new Receiver(NewDocumentTestActivity.NOTIFY_NEW_INTENT)) { in testNewDocument() argument
47 receiver.await(); in testNewDocument()
/cts/tests/tests/permission2/src/android/permission2/cts/
DNoReceiveSmsPermissionTest.java71 IllegalSmsReceiver receiver = new IllegalSmsReceiver(); in testReceiveTextMessage() local
77 getContext().registerReceiver(receiver, filter); in testReceiveTextMessage()
79 synchronized(receiver) { in testReceiveTextMessage()
81 receiver.wait(WAIT_TIME); in testReceiveTextMessage()
88 receiver.isMessageSent()); in testReceiveTextMessage()
89 assertFalse("Sms received without proper permissions", receiver.isSmsReceived()); in testReceiveTextMessage()
103 AppSpecificSmsReceiver receiver = new AppSpecificSmsReceiver(); in testAppSpecificSmsToken() local
109 getContext().registerReceiver(receiver, filter); in testAppSpecificSmsToken()
117 synchronized(receiver) { in testAppSpecificSmsToken()
119 receiver.wait(WAIT_TIME); in testAppSpecificSmsToken()
[all …]
/cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/
DDownloadManagerApi28Test.java52 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testSetDestinationUri_publicDir() local
55 mContext.registerReceiver(receiver, intentFilter); in testSetDestinationUri_publicDir()
64 receiver.waitForDownloadComplete(SHORT_TIMEOUT, id); in testSetDestinationUri_publicDir()
69 mContext.unregisterReceiver(receiver); in testSetDestinationUri_publicDir()
78 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testSetDestinationUri_sdcardPath() local
81 mContext.registerReceiver(receiver, intentFilter); in testSetDestinationUri_sdcardPath()
90 receiver.waitForDownloadComplete(SHORT_TIMEOUT, id); in testSetDestinationUri_sdcardPath()
95 mContext.unregisterReceiver(receiver); in testSetDestinationUri_sdcardPath()
106 final DownloadCompleteReceiver receiver = new DownloadCompleteReceiver(); in testDestinationInExternalPublicDir() local
109 mContext.registerReceiver(receiver, intentFilter); in testDestinationInExternalPublicDir()
[all …]
/cts/hostsidetests/incident/apps/errorsapp/src/com/android/server/cts/errors/
DErrorsTests.java61 final DropBoxReceiver receiver = in testException() local
72 assertTrue(receiver.await()); in testException()
80 final DropBoxReceiver receiver = in testANR() local
93 Log.i(TAG, "testANR -- sent broadcast to " + receiver); in testANR()
95 assertTrue(receiver.await()); in testANR()
102 final DropBoxReceiver receiver = in testNativeCrash() local
113 assertTrue(receiver.await()); in testNativeCrash()
120 final DropBoxReceiver receiver = in testTombstone() local
131 assertTrue(receiver.await()); in testTombstone()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DAlwaysOnVpnTest.java125 final BlockingBroadcastReceiver receiver = VpnTestHelper.registerOnStartReceiver(mContext); in testVpnLockdownUpdateWhitelist() local
130 assertNotNull(receiver.awaitForBroadcast(VPN_ON_START_TIMEOUT_MS)); in testVpnLockdownUpdateWhitelist()
135 assertNotNull(receiver.awaitForBroadcast(VPN_ON_START_TIMEOUT_MS)); in testVpnLockdownUpdateWhitelist()
140 assertNotNull(receiver.awaitForBroadcast(VPN_ON_START_TIMEOUT_MS)); in testVpnLockdownUpdateWhitelist()
145 assertNotNull(receiver.awaitForBroadcast(VPN_ON_START_TIMEOUT_MS)); in testVpnLockdownUpdateWhitelist()
147 receiver.unregisterQuietly(); in testVpnLockdownUpdateWhitelist()
162 final BlockingBroadcastReceiver receiver = VpnTestHelper.registerOnStartReceiver(mContext); in testVpnLockdownWhitelistVpnComesUp() local
167 assertNotNull(receiver.awaitForBroadcast(VPN_ON_START_TIMEOUT_MS)); in testVpnLockdownWhitelistVpnComesUp()
178 receiver.unregisterQuietly(); in testVpnLockdownWhitelistVpnComesUp()
DAssistScreenCaptureDisabledTest.java82 BlockingBroadcastReceiver receiver = new BlockingBroadcastReceiver( in assertScreenCapturePossible() local
85 receiver.register(); in assertScreenCapturePossible()
92 screenShotIntent = receiver.awaitForBroadcast(); in assertScreenCapturePossible()
98 receiver.unregisterQuietly(); in assertScreenCapturePossible()
/cts/tests/tests/midi/src/android/midi/cts/
DMidiEchoTest.java320 MyLoggingReceiver receiver = new MyLoggingReceiver(); in testEchoSmallMessage() local
321 mc.echoOutputPort.connect(receiver); in testEchoSmallMessage()
335 synchronized (receiver) { in testEchoSmallMessage()
336 receiver.waitForMessages(numMessages, timeoutMs); in testEchoSmallMessage()
338 assertEquals("number of messages.", numMessages, receiver.getMessageCount()); in testEchoSmallMessage()
339 MidiMessage message = receiver.getMessage(0); in testEchoSmallMessage()
349 mc.echoOutputPort.disconnect(receiver); in testEchoSmallMessage()
360 MyLoggingReceiver receiver = new MyLoggingReceiver(); in testEchoLatency() local
361 mc.echoOutputPort.connect(receiver); in testEchoLatency()
377 synchronized (receiver) { in testEchoLatency()
[all …]
/cts/hostsidetests/incident/src/com/android/server/cts/
DProtoDumpTestCase.java100 final CollectingByteOutputReceiver receiver = new CollectingByteOutputReceiver(); in getDump() local
101 getDevice().executeShellCommand(command, receiver); in getDump()
102 return parser.parseFrom(receiver.getOutput()); in getDump()
174 final CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in execCommandAndGet() local
175 getDevice().executeShellCommand(command, receiver); in execCommandAndGet()
176 return receiver.getOutput(); in execCommandAndGet()
217 IShellOutputReceiver receiver = new IShellOutputReceiver() { in checkLogcatForText() local
262 receiver, maxTimeMs, TimeUnit.MILLISECONDS, 0); in checkLogcatForText()
263 return receiver.isCancelled(); in checkLogcatForText()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DSetTimeTest.java60 BroadcastReceiver receiver = new BroadcastReceiver() { in testSetTimeWithValue() local
66 mContext.registerReceiver(receiver, new IntentFilter(Intent.ACTION_TIME_CHANGED)); in testSetTimeWithValue()
75 mContext.unregisterReceiver(receiver); in testSetTimeWithValue()
92 final BroadcastReceiver receiver = new BroadcastReceiver() { in testSetTimeZoneWithValue() local
100 mContext.registerReceiver(receiver, new IntentFilter(Intent.ACTION_TIMEZONE_CHANGED)); in testSetTimeZoneWithValue()
117 mContext.unregisterReceiver(receiver); in testSetTimeZoneWithValue()
DAirplaneModeRestrictionTest.java58 BroadcastReceiver receiver = new BroadcastReceiver() { in testAirplaneModeTurnedOffWhenRestrictionSet() local
65 mContext.registerReceiver(receiver, new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED)); in testAirplaneModeTurnedOffWhenRestrictionSet()
75 mContext.unregisterReceiver(receiver); in testAirplaneModeTurnedOffWhenRestrictionSet()
/cts/tests/tests/wifi/src/android/net/wifi/rtt/cts/
DTestBase.java103 WifiRttBroadcastReceiver receiver = new WifiRttBroadcastReceiver(); in setUp() local
104 mContext.registerReceiver(receiver, intentFilter); in setUp()
107 receiver.waitForStateChange()); in setUp()
201 WifiScansBroadcastReceiver receiver = new WifiScansBroadcastReceiver(); in scanAps() local
202 mContext.registerReceiver(receiver, intentFilter); in scanAps()
205 receiver.waitForStateChange(); in scanAps()
206 mContext.unregisterReceiver(receiver); in scanAps()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DSanityTest.java58 BlockingBroadcastReceiver receiver = in testLaunchAppInstalledInProfileOnly() local
61 receiver.register(); in testLaunchAppInstalledInProfileOnly()
68 Intent receivedBroadcast = receiver.awaitForBroadcast(); in testLaunchAppInstalledInProfileOnly()
72 receiver.unregisterQuietly(); in testLaunchAppInstalledInProfileOnly()
DResetPasswordWithTokenTest.java80 final BlockingBroadcastReceiver receiver = new BlockingBroadcastReceiver(mContext, in testClearPasswordBeforeUnlock() local
82 receiver.register(); in testClearPasswordBeforeUnlock()
85 assertNotNull(receiver.awaitForBroadcast(90_000)); in testClearPasswordBeforeUnlock()
87 receiver.unregisterQuietly(); in testClearPasswordBeforeUnlock()
/cts/hostsidetests/securitybulletin/src/android/security/cts/
DAdbUtils.java105 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in runPoc() local
107 device.executeShellCommand("/data/local/tmp/" + pocName + " " + arguments, receiver, in runPoc()
110 device.executeShellCommand("/data/local/tmp/" + pocName, receiver, timeout, in runPoc()
113 String output = receiver.getOutput(); in runPoc()
141 NullOutputReceiver receiver = new NullOutputReceiver(); in runPocNoOutput() local
143 device.executeShellCommand("/data/local/tmp/" + pocName + " " + arguments, receiver, in runPocNoOutput()
146 device.executeShellCommand("/data/local/tmp/" + pocName, receiver, timeout, in runPocNoOutput()
338 CollectingOutputReceiver receiver = new CollectingOutputReceiver(); in runPocGetExitStatus() local
341 device.executeShellCommand(cmd, receiver, timeout, TimeUnit.SECONDS, 0); in runPocGetExitStatus()
343 String exitStatus = receiver.getOutput().trim(); in runPocGetExitStatus()
/cts/hostsidetests/statsd/src/android/cts/statsd/subscriber/
DShellSubscriberTest.java78 CollectingByteOutputReceiver receiver = new CollectingByteOutputReceiver(); in testShellSubscription() local
79 startSubscription(config, receiver, 10); in testShellSubscription()
80 byte[] output = receiver.getOutput(); in testShellSubscription()
115 CollectingByteOutputReceiver receiver, int waitTimeSec) { in startSubscription() argument
133 String.valueOf(waitTimeSec)), receiver); in startSubscription()
/cts/tests/tests/appwidget/src/android/appwidget/cts/
DWidgetTransitionTest.java178 BlockingBroadcastReceiver receiver = new BlockingBroadcastReceiver() in testWidget_startActivity() local
195 receiver.await(); in testWidget_startActivity()
197 String[] elements = receiver.result in testWidget_startActivity()
281 BlockingBroadcastReceiver receiver = new BlockingBroadcastReceiver().register(CLICK_ACTION); in verifyClickBroadcast() local
284 receiver.await(); in verifyClickBroadcast()
285 assertNotNull(receiver.result); in verifyClickBroadcast()
288 receiver.result.getSourceBounds()); in verifyClickBroadcast()
290 receiver.result.getBundleExtra(RemoteViews.EXTRA_SHARED_ELEMENT_BOUNDS) in verifyClickBroadcast()
/cts/tests/tests/os/src/android/os/cts/
DResultReceiverTest.java39 ResultReceiver receiver = new ResultReceiver(mHandler); in testResultReceiver() local
40 assertEquals(0, receiver.describeContents()); in testResultReceiver()
43 receiver.writeToParcel(p, 0); in testResultReceiver()
/cts/tests/tests/content/src/android/content/cts/
DContextTest.java145 for (BroadcastReceiver receiver : mRegisteredReceiverList) { in tearDown()
146 mContext.unregisterReceiver(receiver); in tearDown()
503 private void registerBroadcastReceiver(BroadcastReceiver receiver, IntentFilter filter) { in registerBroadcastReceiver() argument
504 mContext.registerReceiver(receiver, filter); in registerBroadcastReceiver()
506 mRegisteredReceiverList.add(receiver); in registerBroadcastReceiver()
578 final ResultReceiver receiver = new HighPriorityBroadcastReceiver(); in testSendOrderedBroadcastWithAppOp() local
587 registerBroadcastReceiver(receiver, new IntentFilter(ResultReceiver.MOCK_ACTION)); in testSendOrderedBroadcastWithAppOp()
602 return receiver.hasReceivedBroadCast() in testSendOrderedBroadcastWithAppOp()
607 synchronized (receiver) { in testSendOrderedBroadcastWithAppOp()
608 receiver.notify(); in testSendOrderedBroadcastWithAppOp()
[all …]
/cts/hostsidetests/statsd/apps/statsdapp/src/com/android/server/cts/device/statsd/
DAtomTests.java377 BroadcastReceiver receiver = in testWakeupAlarm() local
383 waitForReceiver(context, 10_000, onReceiveLatch, receiver); in testWakeupAlarm()
430 BroadcastReceiver receiver = registerReceiver(context, onReceiveLatch, intentFilter); in testWifiScan() local
432 waitForReceiver(context, 60_000, onReceiveLatch, receiver); in testWifiScan()
493 BroadcastReceiver receiver = new BroadcastReceiver() { in registerReceiver() local
505 ctx.registerReceiver(receiver, intentFilter, null, handler); in registerReceiver()
506 return receiver; in registerReceiver()
514 int maxWaitTimeMs, CountDownLatch latch, BroadcastReceiver receiver) { in waitForReceiver() argument
527 if (ctx != null && receiver != null) { in waitForReceiver()
528 ctx.unregisterReceiver(receiver); in waitForReceiver()
/cts/tools/vm-tests-tf/src/dot/junit/
DDxTestCase.java82 Object receiver = null; in loadAndRun() local
85 receiver = c.newInstance(); in loadAndRun()
92 method.invoke(receiver, args); in loadAndRun()
/cts/hostsidetests/devicepolicy/app/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/
DDeviceAndProfileOwnerTransferOutgoingTest.java115 BlockingBroadcastReceiver receiver = new BlockingBroadcastReceiver(mContext, in testTransferOwnershipChangedBroadcast() local
118 receiver.register(); in testTransferOwnershipChangedBroadcast()
122 Intent intent = receiver.awaitForBroadcast(); in testTransferOwnershipChangedBroadcast()
125 receiver.unregisterQuietly(); in testTransferOwnershipChangedBroadcast()
/cts/hostsidetests/devicepolicy/app/LauncherTests/src/com/android/cts/launchertests/
DQuietModeTest.java141 BlockingBroadcastReceiver receiver = in trySetQuietModeEnabled() local
144 receiver.register(); in trySetQuietModeEnabled()
149 return receiver.awaitForBroadcast(); in trySetQuietModeEnabled()
151 receiver.unregisterQuietly(); in trySetQuietModeEnabled()

1234