Home
last modified time | relevance | path

Searched refs:getContext (Results 1 – 25 of 1445) sorted by relevance

12345678910>>...58

/cts/tests/tests/tv/src/android/media/tv/cts/
DTvInputInfoTest.java59 if (!Utils.hasTvInputFramework(getContext())) { in setUp()
63 (TvInputManager) getContext().getSystemService(Context.TV_INPUT_SERVICE); in setUp()
71 mPackageManager = getContext().getPackageManager(); in setUp()
75 if (!Utils.hasTvInputFramework(getContext())) { in testTvInputInfoOp()
86 new ComponentName(getContext(), StubTunerTvInputService.class); in testTvInputInfoOp()
91 assertEquals(getContext().getPackageManager().getServiceInfo(componentName, 0).name, in testTvInputInfoOp()
106 TvInputInfoTest.compareTvInputInfos(getContext(), mStubInfo, infoFromParcel)); in testTvInputInfoOp()
113 assertEquals(mStubInfo.loadIcon(getContext()).getConstantState(), in testTvInputInfoOp()
114 infoFromParcel.loadIcon(getContext()).getConstantState()); in testTvInputInfoOp()
115 assertEquals(mStubInfo.loadLabel(getContext()), infoFromParcel.loadLabel(getContext())); in testTvInputInfoOp()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DBinderIntegrationTest.java216 getContext().bindService(mService, conn1, 0); in testTransact()
217 getContext().startService(mService); in testTransact()
221 getContext().bindService(mService, conn2, 0); in testTransact()
224 getContext().unbindService(conn2); in testTransact()
229 getContext().stopService(mService); in testTransact()
230 getContext().unbindService(conn1); in testTransact()
231 getContext().unbindService(conn2); in testTransact()
240 getContext().stopService(mService); in testTransact()
243 getContext().unbindService(conn1); in testTransact()
252 getContext().bindService(mService, conn1, 0); in testTransact()
[all …]
/cts/tests/filesystem/src/android/filesystem/cts/
DAlmostFullTest.java19 import static androidx.test.InstrumentationRegistry.getContext;
66 long freeDisk = SystemUtil.getFreeDiskSize(getContext()); in setUp()
84 FileUtil.createNewFilledFile(getContext(), in setUp()
89 Log.i(TAG, "free disk " + SystemUtil.getFreeDiskSize(getContext())); in setUp()
95 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
99 FileUtil.removeFileOrDir(getContext(), DIR_INITIAL_FILL); in tearDown()
101 FileUtil.removeFileOrDir(getContext(), DIR_SEQ_UPDATE); in tearDown()
102 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown()
103 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown()
104 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
[all …]
DRandomRWTest.java19 import static androidx.test.InstrumentationRegistry.getContext;
57 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown()
58 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown()
65 final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), READ_BUFFER_SIZE); in testRandomRead()
69 FileActivity.startFileActivity(getContext()); in testRandomRead()
72 double mbps = FileUtil.doRandomReadTest(getContext(), DIR_RANDOM_RD, report, fileSize, in testRandomRead()
95 FileActivity.startFileActivity(getContext()); in testRandomUpdate()
101 mbps = FileUtil.doRandomWriteTest(getContext(), DIR_RANDOM_WR, report, fileSize, in testRandomUpdate()
/cts/tests/tests/rscpp/src/android/cts/rscpp/
DRSAllocationTest.java32 assertTrue(typedTest(this.getContext().getCacheDir().toString())); in testRSAllocationTypes()
37 assertTrue(test1DCopy(this.getContext().getCacheDir().toString())); in testRSAllocationCopy1D()
42 assertTrue(test2DCopy(this.getContext().getCacheDir().toString())); in testRSAllocationCopy2D()
47 assertTrue(test3DCopy(this.getContext().getCacheDir().toString())); in testRSAllocationCopy3D()
52 assertTrue(test1DCopyPadded(this.getContext().getCacheDir().toString())); in testRSAllocationCopy1DPadded()
57 assertTrue(test2DCopyPadded(this.getContext().getCacheDir().toString())); in testRSAllocationCopy2DPadded()
62 assertTrue(test3DCopyPadded(this.getContext().getCacheDir().toString())); in testRSAllocationCopy3DPadded()
67 assertTrue(testSetElementAt(this.getContext().getCacheDir().toString())); in testRSAllocationSetElementAt()
DRSElementTest.java32 assertTrue(testCreatePixel(this.getContext().getCacheDir().toString())); in testRSElementTestCreatePixel()
37 assertTrue(testCreateVector(this.getContext().getCacheDir().toString())); in testRSElementTestCreateVector()
42 assertTrue(testPrebuiltElements(this.getContext().getCacheDir().toString())); in testRSElementTestPrebuiltElements()
47 assertTrue(testIsCompatible(this.getContext().getCacheDir().toString())); in testRSElementTestIsCompatible()
52 assertTrue(testElementBuilder(this.getContext().getCacheDir().toString())); in testRSElementElementBuilder()
DRSObjectTest.java32 assertTrue(testClearObjectElement(this.getContext().getCacheDir().toString())); in testRSObjectTestClearObjectElement()
37 assertTrue(testClearObjectType(this.getContext().getCacheDir().toString())); in testRSObjectTestClearObjectType()
42 assertTrue(testClearObjectAllocation(this.getContext().getCacheDir().toString())); in testRSObjectTestClearObjectAllocation()
47 assertTrue(testClearObjectSampler(this.getContext().getCacheDir().toString())); in testRSObjectTestClearObjectSampler()
52 assertTrue(testClearObjectScript(this.getContext().getCacheDir().toString())); in testRSObjectTestClearObjectScript()
/cts/hostsidetests/shortcuts/deviceside/multiuser/src/android/content/pm/cts/shortcut/multiuser/
DShortcutManagerManagedUserTest.java34 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test01_managedProfileNotStarted()
51 new ShortcutInfo.Builder(getContext(), "s1") in test02_createShortuctsOnPrimaryUser()
54 new ComponentName(getContext(), MainActivity.class))).build()))); in test02_createShortuctsOnPrimaryUser()
59 new ShortcutInfo.Builder(getContext(), "s1") in test03_createShortuctsOnManagedProfile()
62 new ComponentName(getContext(), MainActivity.class))).build()))); in test03_createShortuctsOnManagedProfile()
66 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test04_getAndLaunch_primary()
73 .setPackage(getContext().getPackageName()) in test04_getAndLaunch_primary()
91 getLauncherApps().startShortcut(getContext().getPackageName(), "s1", null, null, in test04_getAndLaunch_primary()
95 getLauncherApps().startShortcut(getContext().getPackageName(), "s1", null, null, in test04_getAndLaunch_primary()
101 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test05_getAndLaunch_managed()
[all …]
/cts/tests/tests/externalservice/src/android/externalservice/cts/
DSharedIsolatedServiceTest.java43 getContext().unbindService(mConnection); in tearDown()
53 assertTrue(getContext().bindIsolatedService( in testBasicConnection()
59 getContext().getMainExecutor(), in testBasicConnection()
63 assertEquals(getContext().getPackageName(), mConnection.mName.getPackageName()); in testBasicConnection()
74 getContext().bindIsolatedService( in testSharedIsolatedProcessNotAllowed()
80 getContext().getMainExecutor(), in testSharedIsolatedProcessNotAllowed()
89 assertTrue(getContext().bindIsolatedService( in testMultipleServicesWithSingleInstance()
95 getContext().getMainExecutor(), in testMultipleServicesWithSingleInstance()
99 assertEquals(getContext().getPackageName(), mConnection.mName.getPackageName()); in testMultipleServicesWithSingleInstance()
110 assertTrue(getContext().bindIsolatedService( in testMultipleServicesWithSingleInstance()
[all …]
DExternalServiceTest.java49 getContext().unbindService(mConnection); in tearDown()
57 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindIsolated()
68 getContext().bindService(intent, mConnection, in testFailBindExternalIsolated()
81 getContext().bindService(intent, mConnection, in testFailBindExternalExported()
94 getContext().bindService(intent, mConnection, in testFailBindExternalNonExported()
107 getContext().bindService(intent, mConnection, in testFailBindExternalNonIsolated()
119 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindWithoutBindExternal()
132 assertTrue(getContext().bindService(intent, mConnection, in testBindExternalService()
136 assertEquals(getContext().getPackageName(), mConnection.name.getPackageName()); in testBindExternalService()
147 assertEquals(getContext().getPackageName(), id.packageName); in testBindExternalService()
[all …]
/cts/tests/tests/contactsprovider/src/android/provider/cts/contacts/
DContacts_PhonesTest.java26 String display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel()
42 String display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
46 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
50 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
54 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
58 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
62 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
66 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
70 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray()
/cts/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/src/com/android/cts/instantupgradeapp/
DClientTest.java43 assertTrue(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testInstantApplicationWritePreferences()
45 InstrumentationRegistry.getContext().getSharedPreferences("preferences", 0); in testInstantApplicationWritePreferences()
51 assertFalse(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testFullApplicationReadPreferences()
53 InstrumentationRegistry.getContext().getSharedPreferences("preferences", 0); in testFullApplicationReadPreferences()
59 assertTrue(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testInstantApplicationWriteFile()
61 .getContext().openFileOutput("test.txt", Context.MODE_PRIVATE)) { in testInstantApplicationWriteFile()
68 assertFalse(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testFullApplicationReadFile()
70 .getContext().openFileInput("test.txt")) { in testFullApplicationReadFile()
/cts/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/
DStorageTest.java66 private Context getContext() { in getContext() method in StorageTest
67 return getInstrumentation().getContext(); in getContext()
71 useSpace(getContext()); in testAllocate()
75 final StorageStatsManager stats = getContext() in testFullDisk()
78 final File dataDir = getContext().getDataDir(); in testFullDisk()
86 getContext().getPackageManager().setComponentEnabledSetting( in testTweakComponent()
87 new ComponentName(getContext().getPackageName(), UtilsReceiver.class.getName()), in testTweakComponent()
93 assertTrue(getContext().getDataDir().getUsableSpace() < 256_000_000); in testClearSpace()
117 assertTrue(getContext().getDataDir().getUsableSpace() > 256_000_000); in testClearSpace()
195 getSizeManual(getContext().getDataDir())); in testVerifySpaceManual()
[all …]
/cts/hostsidetests/shortcuts/deviceside/upgrade/src/android/content/pm/cts/shortcut/upgrade/
DShortcutManagerPreUpgradeTest.java37 final Icon icon1 = Icon.createWithResource(getContext(), R.drawable.black_32x32); in testPreUpgrade()
38 final Icon icon2 = Icon.createWithResource(getContext(), R.drawable.black_64x64); in testPreUpgrade()
43 final ShortcutInfo s1 = new ShortcutInfo.Builder(getContext(), "s1") in testPreUpgrade()
52 final ShortcutInfo s2 = new ShortcutInfo.Builder(getContext(), "s2") in testPreUpgrade()
62 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in testPreUpgrade()
65 assertIconDimensions(getContext().getPackageName(), "s1", icon1); in testPreUpgrade()
66 assertIconDimensions(getContext().getPackageName(), "s2", icon2); in testPreUpgrade()
71 assertIconDimensions(getContext().getPackageName(), "s1", icon2); in testPreUpgrade()
DShortcutManagerPostUpgradeTest.java51 final Icon icon1 = Icon.createWithResource(getContext(), R.drawable.black_32x32); in testPostUpgrade()
52 final Icon icon2 = Icon.createWithResource(getContext(), R.drawable.black_64x64); in testPostUpgrade()
55 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in testPostUpgrade()
58 assertIconDimensions(getContext().getPackageName(), "s1", icon1); in testPostUpgrade()
59 assertIconDimensions(getContext().getPackageName(), "s2", icon2); in testPostUpgrade()
64 assertIconDimensions(getContext().getPackageName(), "s1", icon2); in testPostUpgrade()
/cts/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/
DClientTest.java126 InstrumentationRegistry.getContext() in setUp()
132 InstrumentationRegistry.getContext().unregisterReceiver(mReceiver); in tearDown()
140 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery()
163 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery()
186 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery()
211 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery()
236 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery()
255 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery()
277 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery()
295 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery()
[all …]
/cts/tests/app/src/android/app/cts/
DLaunchTest.java31 mIntent.putExtra("component", new ComponentName(getContext(), ClearTop.class)); in testClearTopWhilResumed()
37 mIntent.putExtra("component", new ComponentName(getContext(), ClearTop.class)); in testClearTopInCreate()
46 mIntent.putExtra("component", new ComponentName(getContext(), LocalScreen.class)); in testLocalScreen()
51 mIntent.putExtra("component", new ComponentName(getContext(), TestedScreen.class)); in testColdScreen()
56 mIntent.putExtra("component", new ComponentName(getContext(), LocalActivity.class)); in testLocalActivity()
61 mIntent.putExtra("component", new ComponentName(getContext(), TestedActivity.class)); in testColdActivity()
/cts/tests/tests/keystore/src/android/keystore/cts/
DKeyPairGeneratorSpecTest.java53 private Context getContext() { in getContext() method in KeyPairGeneratorSpecTest
59 KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_Unencrypted_Success()
67 assertEquals("Context should be the one specified", getContext(), spec.getContext()); in testBuilder_Unencrypted_Success()
92 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingAlias_Failure()
106 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSubjectDN_Failure()
120 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSerialNumber_Failure()
134 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingStartDate_Failure()
148 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingEndDate_Failure()
162 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_EndBeforeStart_Failure()
/cts/hostsidetests/devicepolicy/app/DeviceAdminService/src/com/android/cts/deviceadminservice/
DComponentController.java28 getContext().getPackageManager().setComponentEnabledSetting(cn, in enableComponent()
37 enableComponent(new ComponentName(getContext(), MyService.class), true); in testEnableService1()
41 enableComponent(new ComponentName(getContext(), MyService.class), false); in testDisableService1()
45 enableComponent(new ComponentName(getContext(), MyService2.class), true); in testEnableService2()
49 enableComponent(new ComponentName(getContext(), MyService2.class), false); in testDisableService2()
/cts/tests/tests/provider/src/android/provider/cts/settings/
DSettingsTest.java98 ContentResolver cr = getContext().getContentResolver(); in testSystemTable()
149 ContentResolver cr = getContext().getContentResolver(); in testSecureTable()
173 ContentResolver cr = getContext().getContentResolver(); in tryBadTableAccess()
246 final ResolveInfo ri = getContext().getPackageManager().resolveActivity( in testUserDictionarySettingsExists()
253 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
258 Settings.System.putInt(getInstrumentation().getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
260 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
265 Settings.System.putInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
272 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
279 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
[all …]
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DCarrierServiceTest.java48 PackageManager packageManager = getInstrumentation().getContext().getPackageManager(); in hasCellular()
50 getInstrumentation().getContext().getSystemService(TelephonyManager.class); in hasCellular()
66 Intent intent = new Intent(getContext(), TestCarrierService.class); in notifyCarrierNetworkChangeWithoutCarrierPrivileges()
77 Intent intent = new Intent(getContext(), TestCarrierService.class); in notifyCarrierNetworkChangeWithCarrierPrivileges()
82 getContext(), in notifyCarrierNetworkChangeWithCarrierPrivileges()
104 Intent intent = new Intent(getContext(), TestCarrierService.class); in notifyCarrierNetworkChangeForSubIdWithoutCarrierPrivileges()
117 Intent intent = new Intent(getContext(), TestCarrierService.class); in notifyCarrierNetworkChangeForSubIdWithCarrierPrivileges()
123 getContext(), in notifyCarrierNetworkChangeForSubIdWithCarrierPrivileges()
/cts/tests/tests/telephony/current/src/android/telephony/satellite/cts/
DSatelliteManagerTest.java89 getContext().getMainExecutor(), satelliteProvisionStateCallback); in beforeAllTests()
108 getContext().getMainExecutor(), callback); in beforeAllTests()
135 getContext().getMainExecutor(), callback); in afterAllTests()
153 getContext().getMainExecutor(), satelliteProvisionStateCallback); in afterAllTests()
203 getContext().getMainExecutor(), error::offer, callback)); in testSatelliteTransmissionUpdates()
207 getContext().getMainExecutor(), error::offer, callback); in testSatelliteTransmissionUpdates()
215 getContext().getSystemService(SatelliteManager.class).stopTransmissionUpdates( in testSatelliteTransmissionUpdates()
216 callback, getContext().getMainExecutor(), error::offer); in testSatelliteTransmissionUpdates()
222 callback, getContext().getMainExecutor(), error::offer); in testSatelliteTransmissionUpdates()
241 getContext().getMainExecutor(), error::offer)); in testProvisionSatelliteService()
[all …]
/cts/hostsidetests/appsecurity/test-apps/InstantCookieApp/src/test/instant/cookie/
DCookieTest.java36 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieUpdateAndRetrieval()
66 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedAcrossInstantInstalls1()
74 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedAcrossInstantInstalls2()
82 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedUpgradeFromInstant1()
93 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedUpgradeFromInstant2()
104 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieResetOnNonInstantReinstall1()
112 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieResetOnNonInstantReinstall2()
/cts/hostsidetests/appsecurity/test-apps/WriteExternalStorageApp/src/com/android/cts/writeexternalstorageapp/
DWriteGiftTest.java38 final List<File> writeList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_WRITE); in testStageNonGifts()
50 final List<File> noneList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_NONE); in testNoGifts()
55 final List<File> writeList = getAllPackageSpecificNoGiftPaths(getContext(), PACKAGE_WRITE); in testNoGifts()
66 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testObbGifts()
82 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testAccessObbGifts()
93 final List<File> noneList = getAllPackageSpecificObbGiftPaths(getContext(), PACKAGE_NONE); in testCantAccessObbGifts()
101 for (File dir : getAllPackageSpecificPaths(getContext())) { in testClearingWrite()
109 for (File dir : getAllPackageSpecificPaths(getContext())) { in testClearingRead()
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/
DManagementTest.java41 AdminReceiver.getComponentName(getContext()))); in testIsManagedProfile()
42 assertTrue(mDevicePolicyManager.isProfileOwnerApp(getContext().getPackageName())); in testIsManagedProfile()
44 AdminReceiver.getComponentName(getContext()))); in testIsManagedProfile()
50 AdminReceiver.getComponentName(getContext()))); in testIsDeviceOwner()
51 assertTrue(mDevicePolicyManager.isDeviceOwnerApp(getContext().getPackageName())); in testIsDeviceOwner()
53 AdminReceiver.getComponentName(getContext()))); in testIsDeviceOwner()

12345678910>>...58