/cts/tests/tests/tv/src/android/media/tv/cts/ |
D | TvInputInfoTest.java | 59 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/ |
D | AlmostFullTest.java | 19 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 …]
|
D | RandomRWTest.java | 19 import static androidx.test.InstrumentationRegistry.getContext; 50 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown() 51 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown() 58 final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), READ_BUFFER_SIZE); in testRandomRead() 62 FileActivity.startFileActivity(getContext()); in testRandomRead() 65 double mbps = FileUtil.doRandomReadTest(getContext(), DIR_RANDOM_RD, report, fileSize, in testRandomRead() 88 FileActivity.startFileActivity(getContext()); in testRandomUpdate() 94 mbps = FileUtil.doRandomWriteTest(getContext(), DIR_RANDOM_WR, report, fileSize, in testRandomUpdate()
|
/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/hostsidetests/shortcuts/deviceside/multiuser/src/android/content/pm/cts/shortcut/multiuser/ |
D | ShortcutManagerManagedUserTest.java | 35 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/ |
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/tests/tests/contactsprovider/src/android/provider/cts/contacts/ |
D | Contacts_PhonesTest.java | 26 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/ |
D | ClientTest.java | 43 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/ |
D | StorageTest.java | 65 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() 195 getSizeManual(getContext().getDataDir())); in testVerifySpaceManual() [all …]
|
/cts/tests/tests/permission/src/android/permission/cts/ |
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/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/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ |
D | ClientTest.java | 126 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/tests/provider/src/android/provider/cts/settings/ |
D | SettingsTest.java | 93 ContentResolver cr = getContext().getContentResolver(); in testSystemTable() 144 ContentResolver cr = getContext().getContentResolver(); in testSecureTable() 168 ContentResolver cr = getContext().getContentResolver(); in tryBadTableAccess() 241 final ResolveInfo ri = getContext().getPackageManager().resolveActivity( in testUserDictionarySettingsExists() 248 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 253 Settings.System.putInt(getInstrumentation().getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 255 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 260 Settings.System.putInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess() 267 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess() 274 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess() [all …]
|
/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | KeyPairGeneratorSpecTest.java | 53 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/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/bluetooth/src/android/bluetooth/cts/ |
D | BasicBluetoothGattTest.java | 47 if (!TestUtils.isBleSupported(getContext())) { in setUp() 75 if (!TestUtils.isBleSupported(getContext())) { in tearDown() 87 if (!TestUtils.isBleSupported(getContext())) { in testGetServices() 98 if (!TestUtils.isBleSupported(getContext())) { in testConnect() 106 if (!TestUtils.isBleSupported(getContext())) { in testSetPreferredPhy() 115 if (!TestUtils.isBleSupported(getContext())) { in testGetConnectedDevices() 124 if (!TestUtils.isBleSupported(getContext())) { in testGetConnectionState() 133 if (!TestUtils.isBleSupported(getContext())) { in testGetDevicesMatchingConnectionStates()
|
/cts/hostsidetests/devicepolicy/app/DeviceAdminService/src/com/android/cts/deviceadminservice/ |
D | ComponentController.java | 28 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/telephony/current/src/android/telephony/cts/ |
D | CarrierServiceTest.java | 48 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/permission/telephony/src/android/permission/cts/telephony/ |
D | TelephonyManagerPermissionTest.java | 52 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/hostsidetests/appsecurity/test-apps/InstantCookieApp/src/test/instant/cookie/ |
D | CookieTest.java | 36 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/ |
D | WriteGiftTest.java | 38 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/incident/apps/batterystatsapp/src/com/android/server/cts/device/batterystats/ |
D | BatteryStatsSyncTest.java | 34 private static Context getContext() { in getContext() method in BatteryStatsSyncTest 35 return InstrumentationRegistry.getContext(); in getContext() 40 BatteryStatsAuthenticator.removeAllAccounts(getContext()); in setUp() 45 BatteryStatsAuthenticator.removeAllAccounts(getContext()); in tearDown() 56 BatteryStatsAuthenticator.ensureTestAccount(getContext()); in testRunSyncs()
|