Home
last modified time | relevance | path

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

12345678910>>...43

/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/filesystem/src/android/filesystem/cts/
DAlmostFullTest.java19 import static androidx.test.InstrumentationRegistry.getContext;
65 long freeDisk = SystemUtil.getFreeDiskSize(getContext()); in setUp()
83 FileUtil.createNewFilledFile(getContext(), in setUp()
88 Log.i(TAG, "free disk " + SystemUtil.getFreeDiskSize(getContext())); in setUp()
93 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
97 FileUtil.removeFileOrDir(getContext(), DIR_INITIAL_FILL); in tearDown()
99 FileUtil.removeFileOrDir(getContext(), DIR_SEQ_UPDATE); in tearDown()
100 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown()
101 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown()
102 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
[all …]
/cts/hostsidetests/shortcuts/deviceside/multiuser/src/android/content/pm/cts/shortcut/multiuser/
DShortcutManagerManagedUserTest.java35 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test01_managedProfileNotStarted()
52 new ShortcutInfo.Builder(getContext(), "s1") in test02_createShortuctsOnPrimaryUser()
55 new ComponentName(getContext(), MainActivity.class))).build()))); in test02_createShortuctsOnPrimaryUser()
60 new ShortcutInfo.Builder(getContext(), "s1") in test03_createShortuctsOnManagedProfile()
63 new ComponentName(getContext(), MainActivity.class))).build()))); in test03_createShortuctsOnManagedProfile()
67 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test04_getAndLaunch_primary()
74 .setPackage(getContext().getPackageName()) in test04_getAndLaunch_primary()
92 getLauncherApps().startShortcut(getContext().getPackageName(), "s1", null, null, in test04_getAndLaunch_primary()
96 getLauncherApps().startShortcut(getContext().getPackageName(), "s1", null, null, in test04_getAndLaunch_primary()
102 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test05_getAndLaunch_managed()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DBinderTest.java213 getContext().bindService(mService, conn1, 0); in testTransact()
214 getContext().startService(mService); in testTransact()
218 getContext().bindService(mService, conn2, 0); in testTransact()
221 getContext().unbindService(conn2); in testTransact()
226 getContext().stopService(mService); in testTransact()
227 getContext().unbindService(conn1); in testTransact()
228 getContext().unbindService(conn2); in testTransact()
237 getContext().stopService(mService); in testTransact()
240 getContext().unbindService(conn1); in testTransact()
249 getContext().bindService(mService, conn1, 0); in testTransact()
[all …]
/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/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/
DStorageTest.java65 private Context getContext() { in getContext() method in StorageTest
66 return getInstrumentation().getContext(); in getContext()
70 useSpace(getContext()); in testAllocate()
74 final StorageStatsManager stats = getContext() in testFullDisk()
77 final File dataDir = getContext().getDataDir(); in testFullDisk()
85 getContext().getPackageManager().setComponentEnabledSetting( in testTweakComponent()
86 new ComponentName(getContext().getPackageName(), UtilsReceiver.class.getName()), in testTweakComponent()
92 assertTrue(getContext().getDataDir().getUsableSpace() < 256_000_000); in testClearSpace()
116 assertTrue(getContext().getDataDir().getUsableSpace() > 256_000_000); in testClearSpace()
183 getSizeManual(getContext().getDataDir())); in testVerifySpaceManual()
[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/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/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/tests/tests/provider/src/android/provider/cts/settings/
DSettingsTest.java90 ContentResolver cr = getContext().getContentResolver(); in testSystemTable()
141 ContentResolver cr = getContext().getContentResolver(); in testSecureTable()
165 ContentResolver cr = getContext().getContentResolver(); in tryBadTableAccess()
238 final ResolveInfo ri = getContext().getPackageManager().resolveActivity( in testUserDictionarySettingsExists()
245 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
250 Settings.System.putInt(getInstrumentation().getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
252 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
257 Settings.System.putInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
264 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
271 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
[all …]
/cts/tests/tests/keystore/src/android/keystore/cts/
DKeyPairGeneratorSpecTest.java43 KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_Unencrypted_Success()
51 assertEquals("Context should be the one specified", getContext(), spec.getContext()); in testBuilder_Unencrypted_Success()
74 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingAlias_Failure()
87 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSubjectDN_Failure()
100 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSerialNumber_Failure()
113 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingStartDate_Failure()
126 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingEndDate_Failure()
139 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_EndBeforeStart_Failure()
/cts/tests/tests/permission/src/android/permission/cts/
DContactsProviderTest.java38 getContext().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, in testQueryContacts()
56 getContext().getContentResolver().insert(ContactsContract.Contacts.CONTENT_URI, in testInsertContacts()
74 getContext().getContentResolver().query(ContactsContract.Profile.CONTENT_URI, in testQueryProfile()
94 getContext().getContentResolver().insert(ContactsContract.Profile.CONTENT_URI, in testInsertProfile()
112 getContext().getContentResolver().update(ContactsContract.Profile.CONTENT_URI, in testUpdateProfile()
130 getContext().getContentResolver().query( in testQueryPhoneEnterprise()
149 getContext().getContentResolver().query( in testRawContactsEntityCorp()
/cts/hostsidetests/shortcuts/deviceside/upgrade/src/android/content/pm/cts/shortcut/upgrade/
DShortcutManagerPreUpgradeTest.java36 final Icon icon1 = Icon.createWithResource(getContext(), R.drawable.black_32x32); in testPreUpgrade()
37 final Icon icon2 = Icon.createWithResource(getContext(), R.drawable.black_64x64); in testPreUpgrade()
42 final ShortcutInfo s1 = new ShortcutInfo.Builder(getContext(), "s1") in testPreUpgrade()
51 final ShortcutInfo s2 = new ShortcutInfo.Builder(getContext(), "s2") in testPreUpgrade()
61 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in testPreUpgrade()
64 assertIconDimensions(getContext().getPackageName(), "s1", icon1); in testPreUpgrade()
65 assertIconDimensions(getContext().getPackageName(), "s2", icon2); in testPreUpgrade()
70 assertIconDimensions(getContext().getPackageName(), "s1", icon2); in testPreUpgrade()
/cts/tests/tests/permission/telephony/src/android/permission/cts/telephony/
DTelephonyManagerPermissionTest.java52 mHasTelephony = getContext().getPackageManager().hasSystemFeature( in setUp()
55 (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); in setUp()
57 mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); in setUp()
226 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
231 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
236 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
242 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
248 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
254 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
259 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
[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/wifi/src/android/net/wifi/cts/
DWifiHotspot2Test.java63 if (!WifiFeature.isWifiSupported(getContext())) { in setUp()
80 if (!WifiFeature.isWifiSupported(getContext())) { in testGetMeteredOverride()
94 if (!WifiFeature.isWifiSupported(getContext())) { in testGetSubscriptionExpirationTimeMillis()
109 if (!WifiFeature.isWifiSupported(getContext())) { in testGetUniqueId()
142 if (!WifiFeature.isWifiSupported(getContext())) { in testIsAutojoinEnabled()
156 if (!WifiFeature.isWifiSupported(getContext())) { in testIsMacRandomizationEnabled()
170 if (!WifiFeature.isWifiSupported(getContext())) { in testIsOsuProvisioned()
184 if (!WifiFeature.isWifiSupported(getContext())) { in testPasspointConfigurationCopyConstructor()
200 if (!WifiFeature.isWifiSupported(getContext())) { in testHomeSpCopyConstructor()
215 if (!WifiFeature.isWifiSupported(getContext())) { in testCredentialCopyConstructor()
[all …]
/cts/tests/autofillservice/src/android/autofillservice/cts/
DSessionLifecycleTest.java27 import static android.autofillservice.cts.testcore.Helper.getContext;
132 return getDestroyedMarker(getContext()).exists(); in finishLoginActivityOnAnotherProcess()
139 return getStoppedMarker(getContext()).exists(); in killOfProcessLoginActivityProcess()
151 final Intent outOfProcessAcvitityStartIntent = new Intent(getContext(), in startAndWaitExternalActivity()
153 getStartedMarker(getContext()).delete(); in startAndWaitExternalActivity()
154 getContext().startActivity(outOfProcessAcvitityStartIntent); in startAndWaitExternalActivity()
156 return getStartedMarker(getContext()).exists(); in startAndWaitExternalActivity()
158 getStartedMarker(getContext()).delete(); in startAndWaitExternalActivity()
168 final ActivityManager activityManager = (ActivityManager) getContext() in testDatasetAuthResponseWhileAutofilledAppIsLifecycled()
185 IntentSender authentication = PendingIntent.getActivity(getContext(), 0, in testDatasetAuthResponseWhileAutofilledAppIsLifecycled()
[all …]
/cts/tests/tests/content/src/android/content/pm/cts/
DApplicationInfoTest.java74 mPackageName = getContext().getPackageName(); in setUp()
77 private Context getContext() { in getContext() method in ApplicationInfoTest
93 mApplicationInfo = getContext().getPackageManager().getApplicationInfo(mPackageName, 0); in testWriteToParcel()
124 mApplicationInfo = getContext().getPackageManager().getApplicationInfo(mPackageName, 0); in testDescribeContents()
145 mApplicationInfo = getContext().getPackageManager().getApplicationInfo(mPackageName, 0); in testLoadDescription()
147 assertNull(mApplicationInfo.loadDescription(getContext().getPackageManager())); in testLoadDescription()
150 assertEquals(getContext().getResources().getString(R.string.hello_world), in testLoadDescription()
151 mApplicationInfo.loadDescription(getContext().getPackageManager())); in testLoadDescription()
156 mApplicationInfo = getContext().getPackageManager().getApplicationInfo(mPackageName, 0); in verifyOwnInfo()
169 mApplicationInfo = getContext().getPackageManager().getApplicationInfo( in verifyDefaultValues()
[all …]
/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/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/SplitApp/src/com/android/cts/splitapp/
DSplitAppTest.java136 final Resources r = getContext().getResources(); in testSingleBase()
137 final PackageManager pm = getContext().getPackageManager(); in testSingleBase()
200 final Resources r = getContext().getResources(); in testDensitySingle()
213 final Resources r = getContext().getResources(); in testDensityAll()
235 final Resources r = getContext().getResources(); in testDensityBest1()
244 final Resources r = getContext().getResources(); in testDensityBest2()
253 final Resources r = getContext().getResources(); in testApi()
254 final PackageManager pm = getContext().getPackageManager(); in testApi()
270 final Resources r = getContext().getResources(); in testLocale()
343 final Resources r = getContext().getResources(); in testFeatureWarmBase()
[all …]
/cts/tests/tests/externalservice/src/android/externalservice/cts/
DExternalServiceTest.java51 getContext().unbindService(mConnection); in tearDown()
59 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindIsolated()
70 getContext().bindService(intent, mConnection, in testFailBindExternalIsolated()
83 getContext().bindService(intent, mConnection, in testFailBindExternalExported()
96 getContext().bindService(intent, mConnection, in testFailBindExternalNonExported()
109 getContext().bindService(intent, mConnection, in testFailBindExternalNonIsolated()
121 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindWithoutBindExternal()
134 assertTrue(getContext().bindService(intent, mConnection, in testBindExternalService()
138 assertEquals(getContext().getPackageName(), mConnection.name.getPackageName()); in testBindExternalService()
149 assertEquals(getContext().getPackageName(), id.packageName); in testBindExternalService()
[all …]
/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()

12345678910>>...43