/cts/tests/tests/content/src/android/content/pm/cts/ |
D | PermissionFeatureTest.java | 24 PackageManager pm = getContext().getPackageManager(); in testPermissionRequiredFeatureDefined() 27 getContext().getPackageName())); in testPermissionRequiredFeatureDefined() 31 PackageManager pm = getContext().getPackageManager(); in testPermissionRequiredFeatureUndefined() 34 getContext().getPackageName())); in testPermissionRequiredFeatureUndefined() 38 PackageManager pm = getContext().getPackageManager(); in testPermissionRequiredNotFeatureDefined() 41 getContext().getPackageName())); in testPermissionRequiredNotFeatureDefined() 45 PackageManager pm = getContext().getPackageManager(); in testPermissionRequiredNotFeatureUndefined() 48 getContext().getPackageName())); in testPermissionRequiredNotFeatureUndefined() 52 PackageManager pm = getContext().getPackageManager(); in testPermissionRequiredMultiDeny() 55 getContext().getPackageName())); in testPermissionRequiredMultiDeny() [all …]
|
/cts/tests/tests/tv/src/android/media/tv/cts/ |
D | TvInputInfoTest.java | 56 if (!Utils.hasTvInputFramework(getContext())) { in setUp() 60 (TvInputManager) getContext().getSystemService(Context.TV_INPUT_SERVICE); in setUp() 68 mPackageManager = getContext().getPackageManager(); in setUp() 72 if (!Utils.hasTvInputFramework(getContext())) { in testTvInputInfoOp() 83 new ComponentName(getContext(), StubTunerTvInputService.class); in testTvInputInfoOp() 88 assertEquals(getContext().getPackageManager().getServiceInfo(componentName, 0).name, in testTvInputInfoOp() 103 TvInputInfoTest.compareTvInputInfos(getContext(), mStubInfo, infoFromParcel)); in testTvInputInfoOp() 110 assertEquals(mStubInfo.loadIcon(getContext()).getConstantState(), in testTvInputInfoOp() 111 infoFromParcel.loadIcon(getContext()).getConstantState()); in testTvInputInfoOp() 112 assertEquals(mStubInfo.loadLabel(getContext()), infoFromParcel.loadLabel(getContext())); in testTvInputInfoOp() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp22/src/com/android/cts/usepermission/ |
D | UsePermissionTest22.java | 47 final Context context = getInstrumentation().getContext(); in testCompatDefault() 64 assertMediaReadWriteAccess(getInstrumentation().getContext().getContentResolver()); in testCompatDefault() 75 final Context context = getInstrumentation().getContext(); in testCompatRevoked_part2() 94 assertMediaNoAccess(getInstrumentation().getContext().getContentResolver(), true); in testCompatRevoked_part2() 98 "/Android/data/" + getInstrumentation().getContext().getPackageName())); in testCompatRevoked_part2() 103 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testAllPermissionsGrantedByDefault() 105 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testAllPermissionsGrantedByDefault() 108 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testAllPermissionsGrantedByDefault() 110 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testAllPermissionsGrantedByDefault() 112 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testAllPermissionsGrantedByDefault() [all …]
|
/cts/tests/tests/provider/src/android/provider/cts/contacts/ |
D | Contacts_PhonesTest.java | 26 String display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 30 CharSequence[] labels = getContext().getResources().getTextArray( in testGetDisplayLabel() 32 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 36 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 40 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 44 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 48 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 52 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 56 display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabel() 72 String display = Phones.getDisplayLabel(getContext(), in testGetDisplayLabelCharSequenceArray() [all …]
|
D | Contacts_ContactMethodsTest.java | 56 String display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_EMAIL, in test() 60 CharSequence[] labels = getContext().getResources().getTextArray( in test() 62 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_EMAIL, in test() 66 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_EMAIL, in test() 70 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_EMAIL, in test() 74 String untitled = getContext().getString(R.string.untitled); in test() 75 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_IM, in test() 79 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_ORGANIZATION, in test() 83 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_PHONE, in test() 87 display = ContactMethods.getDisplayLabel(getContext(), Contacts.KIND_POSTAL, in test() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/ |
D | StorageTest.java | 53 private Context getContext() { in getContext() method in StorageTest 54 return getInstrumentation().getContext(); in getContext() 58 useSpace(getContext()); in testAllocate() 62 final StorageStatsManager stats = getContext() in testFullDisk() 65 final File dataDir = getContext().getDataDir(); in testFullDisk() 73 getContext().getPackageManager().setComponentEnabledSetting( in testTweakComponent() 74 new ComponentName(getContext().getPackageName(), UtilsReceiver.class.getName()), in testTweakComponent() 83 getSizeManual(getContext().getDataDir())); in testVerifySpaceManual() 85 getSizeManual(getContext().getExternalCacheDir().getParentFile())); in testVerifySpaceManual() 92 final StorageManager sm = getContext().getSystemService(StorageManager.class); in testVerifySpaceApi() [all …]
|
/cts/tests/tests/rscpp/src/android/cts/rscpp/ |
D | RSAllocationTest.java | 32 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()
|
D | RSObjectTest.java | 32 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()
|
D | RSElementTest.java | 32 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()
|
/cts/tests/filesystem/src/android/filesystem/cts/ |
D | AlmostFullTest.java | 19 import static android.support.test.InstrumentationRegistry.getContext; 63 long freeDisk = SystemUtil.getFreeDiskSize(getContext()); in setUp() 81 FileUtil.createNewFilledFile(getContext(), in setUp() 86 Log.i(TAG, "free disk " + SystemUtil.getFreeDiskSize(getContext())); in setUp() 91 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown() 95 FileUtil.removeFileOrDir(getContext(), DIR_INITIAL_FILL); in tearDown() 97 FileUtil.removeFileOrDir(getContext(), DIR_SEQ_UPDATE); in tearDown() 98 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown() 99 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown() 100 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown() [all …]
|
/cts/tests/tests/permission/src/android/permission/cts/ |
D | TelephonyManagerPermissionTest.java | 48 mHasTelephony = getContext().getPackageManager().hasSystemFeature( in setUp() 51 (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE); in setUp() 53 mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); in setUp() 209 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 214 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 219 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 225 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 231 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 237 getContext().sendBroadcast(intent); in testProtectedBroadcasts() 242 getContext().sendBroadcast(intent); in testProtectedBroadcasts() [all …]
|
D | ContactsProviderTest.java | 38 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/multiuser/src/android/content/pm/cts/shortcut/multiuser/ |
D | ShortcutManagerManagedUserTest.java | 34 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() 100 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in test05_getAndLaunch_managed() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/ |
D | UsePermissionTest23.java | 47 PackageManager pm = getInstrumentation().getContext().getPackageManager(); in initialize() 71 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testDefault() 72 assertMediaNoAccess(getInstrumentation().getContext().getContentResolver(), false); in testDefault() 79 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testGranted() 81 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testGranted() 85 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testGranted() 86 assertMediaReadWriteAccess(getInstrumentation().getContext().getContentResolver()); in testGranted() 94 assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext() in testInteractiveGrant() 96 assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext() in testInteractiveGrant() 100 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testInteractiveGrant() [all …]
|
/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | KeyPairGeneratorSpecTest.java | 43 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() 65 KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_Encrypted_Success() 74 assertEquals("Context should be the one specified", getContext(), spec.getContext()); in testBuilder_Encrypted_Success() 97 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingAlias_Failure() 110 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSubjectDN_Failure() 123 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingSerialNumber_Failure() 136 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingStartDate_Failure() 149 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_MissingEndDate_Failure() 162 new KeyPairGeneratorSpec.Builder(getContext()) in testBuilder_EndBeforeStart_Failure()
|
/cts/tests/tests/os/src/android/os/cts/ |
D | BinderTest.java | 213 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/hostsidetests/devicepolicy/app/DeviceAdminService/src/com/android/cts/deviceadminservice/ |
D | ComponentController.java | 27 getContext().getPackageManager().setComponentEnabledSetting(cn, in enableComponent() 35 enableComponent(new ComponentName(getContext(), MyService.class), true); in testEnableService1() 39 enableComponent(new ComponentName(getContext(), MyService.class), false); in testDisableService1() 43 enableComponent(new ComponentName(getContext(), MyService2.class), true); in testEnableService2() 47 enableComponent(new ComponentName(getContext(), MyService2.class), false); in testDisableService2()
|
/cts/hostsidetests/shortcuts/deviceside/upgrade/src/android/content/pm/cts/shortcut/upgrade/ |
D | ShortcutManagerPreUpgradeTest.java | 36 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()
|
D | ShortcutManagerPostUpgradeTest.java | 50 final Icon icon1 = Icon.createWithResource(getContext(), R.drawable.black_32x32); in testPostUpgrade() 51 final Icon icon2 = Icon.createWithResource(getContext(), R.drawable.black_64x64); in testPostUpgrade() 54 Launcher.setAsDefaultLauncher(getInstrumentation(), getContext()); in testPostUpgrade() 57 assertIconDimensions(getContext().getPackageName(), "s1", icon1); in testPostUpgrade() 58 assertIconDimensions(getContext().getPackageName(), "s2", icon2); in testPostUpgrade() 63 assertIconDimensions(getContext().getPackageName(), "s1", icon2); in testPostUpgrade()
|
/cts/hostsidetests/appsecurity/test-apps/InstantUpgradeApp/src/com/android/cts/instantupgradeapp/ |
D | ClientTest.java | 50 assertTrue(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testInstantApplicationWritePreferences() 52 InstrumentationRegistry.getContext().getSharedPreferences("preferences", 0); in testInstantApplicationWritePreferences() 58 assertFalse(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testFullApplicationReadPreferences() 60 InstrumentationRegistry.getContext().getSharedPreferences("preferences", 0); in testFullApplicationReadPreferences() 66 assertTrue(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testInstantApplicationWriteFile() 68 .getContext().openFileOutput("test.txt", Context.MODE_PRIVATE)) { in testInstantApplicationWriteFile() 75 assertFalse(InstrumentationRegistry.getContext().getPackageManager().isInstantApp()); in testFullApplicationReadFile() 77 .getContext().openFileInput("test.txt")) { in testFullApplicationReadFile()
|
/cts/tests/app/src/android/app/cts/ |
D | LaunchTest.java | 31 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/provider/src/android/provider/cts/ |
D | SettingsTest.java | 54 ContentResolver cr = getContext().getContentResolver(); in testSystemTable() 114 ContentResolver cr = getContext().getContentResolver(); in testSecureTable() 138 ContentResolver cr = getContext().getContentResolver(); in tryBadTableAccess() 209 final ResolveInfo ri = getContext().getPackageManager().resolveActivity( in testUserDictionarySettingsExists() 215 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 220 Settings.System.putInt(getInstrumentation().getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 222 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 227 Settings.System.putInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 233 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess() 240 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ |
D | ClientTest.java | 122 InstrumentationRegistry.getContext() in setUp() 128 InstrumentationRegistry.getContext().unregisterReceiver(mReceiver); in tearDown() 136 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery() 159 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery() 182 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery() 207 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery() 232 final List<ResolveInfo> resolveInfo = InstrumentationRegistry.getContext() in testQuery() 251 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery() 273 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery() 291 .getContext().getPackageManager().queryIntentServices(queryIntent, 0 /*flags*/); in testQuery() [all …]
|
/cts/tests/tests/location/src/android/location/cts/ |
D | GeocoderTest.java | 35 new Geocoder(getContext()); in testConstructor() 37 new Geocoder(getContext(), Locale.ENGLISH); in testConstructor() 40 new Geocoder(getContext(), null); in testConstructor() 48 Geocoder geocoder = new Geocoder(getContext()); in testIsPresent() 57 Context context = getContext(); in isServiceMissing() 67 Geocoder geocoder = new Geocoder(getContext()); in testGetFromLocation() 120 Geocoder geocoder = new Geocoder(getContext(), Locale.US); in testGetFromLocationName()
|
/cts/hostsidetests/appsecurity/test-apps/InstantCookieApp/src/test/instant/cookie/ |
D | CookieTest.java | 34 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieUpdateAndRetrieval() 64 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedAcrossInstantInstalls1() 72 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedAcrossInstantInstalls2() 80 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedUpgradeFromInstant1() 91 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookiePersistedUpgradeFromInstant2() 102 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieResetOnNonInstantReinstall1() 110 PackageManager pm = InstrumentationRegistry.getContext().getPackageManager(); in testCookieResetOnNonInstantReinstall2()
|