Home
last modified time | relevance | path

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

12345678910>>...21

/cts/tests/tests/tv/src/android/media/tv/cts/
DTvInputInfoTest.java56 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()
105 TvInputInfoTest.compareTvInputInfos(getContext(), mStubInfo, infoFromParcel)); in testTvInputInfoOp()
112 assertEquals(mStubInfo.loadIcon(getContext()).getConstantState(), in testTvInputInfoOp()
113 infoFromParcel.loadIcon(getContext()).getConstantState()); in testTvInputInfoOp()
114 assertEquals(mStubInfo.loadLabel(getContext()), infoFromParcel.loadLabel(getContext())); in testTvInputInfoOp()
[all …]
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp22/src/com/android/cts/usepermission/
DUsePermissionTest22.java47 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/
DContacts_PhonesTest.java26 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 …]
DContacts_ContactMethodsTest.java56 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 …]
DSettingsTest.java53 ContentResolver cr = getContext().getContentResolver(); in testSystemTable()
113 ContentResolver cr = getContext().getContentResolver(); in testSecureTable()
137 ContentResolver cr = getContext().getContentResolver(); in tryBadTableAccess()
208 final ResolveInfo ri = getContext().getPackageManager().resolveActivity( in testUserDictionarySettingsExists()
214 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
219 Settings.System.putInt(getInstrumentation().getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
221 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
226 Settings.System.putInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromSameProcess()
232 final int initialValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
239 final int actualValue = Settings.System.getInt(getContext().getContentResolver(), in testNoStaleValueModifiedFromOtherProcess()
[all …]
/cts/tests/tests/widget/src/android/widget/cts/
DViewSwitcherTest.java47 new ViewSwitcher(getContext()); in testConstructor()
49 new ViewSwitcher(getContext(), null); in testConstructor()
51 XmlPullParser parser = getContext().getResources().getXml(R.layout.viewswitcher_layout); in testConstructor()
53 new ViewSwitcher(getContext(), attrs); in testConstructor()
57 mViewSwitcher = new ViewSwitcher(getContext()); in testSetFactory()
65 mViewSwitcher = new ViewSwitcher(getContext()); in testReset()
67 ListView lv1 = new ListView(getContext()); in testReset()
68 ListView lv2 = new ListView(getContext()); in testReset()
80 mViewSwitcher = new ViewSwitcher(getContext()); in testGetNextView()
82 ListView lv1 = new ListView(getContext()); in testGetNextView()
[all …]
DImageSwitcherTest.java46 new ImageSwitcher(getContext()); in testConstructor()
48 new ImageSwitcher(getContext(), null); in testConstructor()
50 XmlPullParser parser = getContext().getResources().getXml(R.layout.imageswitcher_test); in testConstructor()
53 new ImageSwitcher(getContext(), attrs); in testConstructor()
58 ImageSwitcher imageSwitcher = new ImageSwitcher(getContext()); in testSetImageResource()
59 ImageView iv = new ImageView(getContext()); in testSetImageResource()
61 ImageView iv1 = new ImageView(getContext()); in testSetImageResource()
67 Resources resources = getContext().getResources(); in testSetImageResource()
88 ImageSwitcher imageSwitcher = new ImageSwitcher(getContext()); in testSetImageURI()
89 ImageView iv = new ImageView(getContext()); in testSetImageURI()
[all …]
/cts/tests/filesystem/src/android/filesystem/cts/
DAlmostFullTest.java58 long freeDisk = SystemUtil.getFreeDiskSize(getContext()); in setUp()
74 FileUtil.createNewFilledFile(getContext(), in setUp()
79 Log.i(TAG, "free disk " + SystemUtil.getFreeDiskSize(getContext())); in setUp()
84 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
88 FileUtil.removeFileOrDir(getContext(), DIR_INITIAL_FILL); in tearDown()
90 FileUtil.removeFileOrDir(getContext(), DIR_SEQ_UPDATE); in tearDown()
91 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown()
92 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown()
93 Log.i(TAG, "tearDown free disk " + SystemUtil.getFreeDiskSize(getContext())); in tearDown()
101 long freeDisk = SystemUtil.getFreeDiskSize(getContext()); in testSequentialUpdate()
[all …]
DRandomRWTest.java30 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_WR); in tearDown()
31 FileUtil.removeFileOrDir(getContext(), DIR_RANDOM_RD); in tearDown()
37 final long fileSize = FileUtil.getFileSizeExceedingMemory(getContext(), READ_BUFFER_SIZE); in testRandomRead()
43 FileUtil.doRandomReadTest(getContext(), DIR_RANDOM_RD, report, fileSize, in testRandomRead()
54 FileUtil.doRandomWriteTest(getContext(), DIR_RANDOM_WR, report, fileSize, in testRandomUpdate()
/cts/tests/tests/os/src/android/os/cts/
DBinderTest.java210 getContext().bindService(mService, conn1, 0); in testTransact()
211 getContext().startService(mService); in testTransact()
215 getContext().bindService(mService, conn2, 0); in testTransact()
218 getContext().unbindService(conn2); in testTransact()
223 getContext().stopService(mService); in testTransact()
224 getContext().unbindService(conn1); in testTransact()
225 getContext().unbindService(conn2); in testTransact()
234 getContext().stopService(mService); in testTransact()
237 getContext().unbindService(conn1); in testTransact()
246 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()
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()
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()
/cts/hostsidetests/appsecurity/test-apps/UsePermissionApp23/src/com/android/cts/usepermission/
DUsePermissionTest23.java57 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testDefault()
58 assertMediaNoAccess(getInstrumentation().getContext().getContentResolver(), false); in testDefault()
65 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testGranted()
67 assertEquals(PackageManager.PERMISSION_GRANTED, getInstrumentation().getContext() in testGranted()
71 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testGranted()
72 assertMediaReadWriteAccess(getInstrumentation().getContext().getContentResolver()); in testGranted()
80 assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext() in testInteractiveGrant()
82 assertEquals(PackageManager.PERMISSION_DENIED, getInstrumentation().getContext() in testInteractiveGrant()
86 assertDirReadWriteAccess(getInstrumentation().getContext().getExternalCacheDir()); in testInteractiveGrant()
87 assertMediaNoAccess(getInstrumentation().getContext().getContentResolver(), false); in testInteractiveGrant()
[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()
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/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()
DTelephonyManagerPermissionTest.java39 mHasTelephony = getContext().getPackageManager().hasSystemFeature( in setUp()
180 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
185 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
190 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
196 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
202 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
208 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
213 getContext().sendBroadcast(intent); in testProtectedBroadcasts()
/cts/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/
DSplitAppTest.java80 final Resources r = getContext().getResources(); in testSingleBase()
81 final PackageManager pm = getContext().getPackageManager(); in testSingleBase()
136 final Resources r = getContext().getResources(); in testDensitySingle()
148 final Resources r = getContext().getResources(); in testDensityAll()
169 final Resources r = getContext().getResources(); in testDensityBest1()
177 final Resources r = getContext().getResources(); in testDensityBest2()
185 final Resources r = getContext().getResources(); in testApi()
186 final PackageManager pm = getContext().getPackageManager(); in testApi()
201 final Resources r = getContext().getResources(); in testLocale()
224 final Resources r = getContext().getResources(); in testFeatureBase()
[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/permission2/src/android/permission2/cts/
DContactsProviderTest.java36 getContext().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, in testQueryContacts()
47 getContext().getContentResolver().insert(ContactsContract.Contacts.CONTENT_URI, in testInsertContacts()
62 getContext().getContentResolver().query(ContactsContract.Profile.CONTENT_URI, in testQueryProfile()
74 getContext().getContentResolver().insert(ContactsContract.Profile.CONTENT_URI, in testInsertProfile()
89 getContext().getContentResolver().update(ContactsContract.Profile.CONTENT_URI, in testUpdateProfile()
/cts/tests/tests/content/src/android/content/cts/
DContentProviderTest.java75 mockContentProvider.attachInfo(getContext(), info1); in testAttachInfo()
76 assertSame(getContext(), mockContentProvider.getContext()); in testAttachInfo()
84 assertSame(getContext(), mockContentProvider.getContext()); in testAttachInfo()
90 assertNull(mockContentProvider.getContext()); in testAttachInfo()
95 assertNull(mockContentProvider.getContext()); in testAttachInfo()
99 mockContentProvider.attachInfo(getContext(), info1); in testAttachInfo()
100 assertSame(getContext(), mockContentProvider.getContext()); in testAttachInfo()
127 assertNull(mockContentProvider.getContext()); in testGetContext()
129 mockContentProvider.attachInfo(getContext(), null); in testGetContext()
130 assertSame(getContext(), mockContentProvider.getContext()); in testGetContext()
[all …]
/cts/tests/tests/externalservice/src/android/externalservice/cts/
DExternalServiceTest.java50 getContext().unbindService(mConnection); in tearDown()
58 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindIsolated()
69 getContext().bindService(intent, mConnection, in testFailBindExternalIsolated()
82 getContext().bindService(intent, mConnection, in testFailBindExternalExported()
95 getContext().bindService(intent, mConnection, in testFailBindExternalNonExported()
108 getContext().bindService(intent, mConnection, in testFailBindExternalNonIsolated()
120 getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); in testFailBindWithoutBindExternal()
133 assertTrue(getContext().bindService(intent, mConnection, in testBindExternalService()
137 assertEquals(getContext().getPackageName(), mConnection.name.getPackageName()); in testBindExternalService()
148 assertEquals(getContext().getPackageName(), id.packageName); in testBindExternalService()
[all …]
/cts/tests/tests/location/src/android/location/cts/
DGeocoderTest.java32 new Geocoder(getContext()); in testConstructor()
34 new Geocoder(getContext(), Locale.ENGLISH); in testConstructor()
37 new Geocoder(getContext(), null); in testConstructor()
45 Geocoder geocoder = new Geocoder(getContext()); in testIsPresent()
50 Geocoder geocoder = new Geocoder(getContext()); in testGetFromLocation()
103 Geocoder geocoder = new Geocoder(getContext(), Locale.US); in testGetFromLocationName()
/cts/tests/tests/text/src/android/text/cts/
DAutoTextTest.java34 Configuration config = getContext().getResources().getConfiguration(); in testGet()
37 getContext().getResources().updateConfiguration(config, null); in testGet()
40 View view = new View(getContext()); in testGet()
80 Configuration config = getContext().getResources().getConfiguration(); in testGetSize()
83 getContext().getResources().updateConfiguration(config, null); in testGetSize()
85 View view = new View(getContext()); in testGetSize()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DCrossProfileUtils.java55 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddParentCanAccessManagedFilters()
64 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddManagedCanAccessParentFilters()
80 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testRemoveAllFilters()
87 getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); in testDisallowCrossProfileCopyPaste()
94 getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); in testAllowCrossProfileCopyPaste()
101 PackageManager pm = (PackageManager) getContext().getPackageManager(); in testDisableAllBrowsers()
103 getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); in testDisableAllBrowsers()

12345678910>>...21