/cts/tests/tests/net/src/android/net/cts/ |
D | UriTest.java | 103 Uri uri = Uri.parse("http://localhost:42"); in testStringUri() local 104 assertEquals("localhost", uri.getHost()); in testStringUri() 105 assertEquals(42, uri.getPort()); in testStringUri() 107 uri = Uri.parse("http://bob@localhost:42"); in testStringUri() 108 assertEquals("bob", uri.getUserInfo()); in testStringUri() 109 assertEquals("localhost", uri.getHost()); in testStringUri() 110 assertEquals(42, uri.getPort()); in testStringUri() 112 uri = Uri.parse("http://bob%20lee@localhost:42"); in testStringUri() 113 assertEquals("bob lee", uri.getUserInfo()); in testStringUri() 114 assertEquals("bob%20lee", uri.getEncodedUserInfo()); in testStringUri() [all …]
|
D | Uri_BuilderTest.java | 25 Uri uri = Uri.parse("http://google.com/p1?query#fragment"); in testBuilderOperations() local 26 Builder builder = uri.buildUpon(); in testBuilderOperations() 27 uri = builder.appendPath("p2").build(); in testBuilderOperations() 28 assertEquals("http", uri.getScheme()); in testBuilderOperations() 29 assertEquals("google.com", uri.getAuthority()); in testBuilderOperations() 30 assertEquals("/p1/p2", uri.getPath()); in testBuilderOperations() 31 assertEquals("query", uri.getQuery()); in testBuilderOperations() 32 assertEquals("fragment", uri.getFragment()); in testBuilderOperations() 33 assertEquals(uri.toString(), builder.toString()); in testBuilderOperations() 35 uri = Uri.parse("mailto:nobody"); in testBuilderOperations() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/ |
D | Asserts.java | 46 Uri uri = item.getUri(); in assertAccess() local 47 if (uri != null) { in assertAccess() 48 assertAccess(uri, mode); in assertAccess() 51 uri = intent.getData(); in assertAccess() 52 if (uri != null) { in assertAccess() 53 assertAccess(uri, mode); in assertAccess() 63 static void assertAccess(Uri uri, int mode) { in assertAccess() argument 65 assertReadingContentUriAllowed(uri); in assertAccess() 67 assertReadingContentUriNotAllowed(uri, null); in assertAccess() 70 assertWritingContentUriAllowed(uri); in assertAccess() [all …]
|
D | UriGrantsResultTest.java | 67 for (Uri uri : GRANTABLE) { in testGrantableToResult() 69 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToResult() 70 assertGrantableToResult(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToResult() 71 assertGrantableToResult(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToResult() 76 private void assertGrantableToResult(Uri uri, int mode, in assertGrantableToResult() argument 80 assertGrantableToResultInternal(uri, mode, clipper); in assertGrantableToResult() 86 private void assertGrantableToResultInternal(Uri uri, int mode, in assertGrantableToResultInternal() argument 88 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToResultInternal() 92 assertAccess(uri, 0); in assertGrantableToResultInternal() 103 assertAccess(uri, 0); in assertGrantableToResultInternal() [all …]
|
D | UriGrantsServiceTest.java | 51 for (Uri uri : GRANTABLE) { in testGrantableToService() 53 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToService() 54 assertGrantableToService(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToService() 55 assertGrantableToService(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToService() 60 private void assertGrantableToService(Uri uri, int mode, Function<Uri, ClipData> clipper) { in assertGrantableToService() argument 61 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToService() 63 final Uri sub2Uri = Uri.withAppendedPath(uri, "yes"); in assertGrantableToService() 71 assertAccess(uri, 0); in assertGrantableToService() 87 assertAccess(uri, 0); in assertGrantableToService() 102 assertAccess(uri, 0); in assertGrantableToService() [all …]
|
D | UriGrantsActivityTest.java | 60 for (Uri uri : GRANTABLE) { in testGrantableToActivity() 62 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToActivity() 63 assertGrantableToActivity(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToActivity() 64 assertGrantableToActivity(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToActivity() 69 private void assertGrantableToActivity(Uri uri, int mode, Function<Uri, ClipData> clipper) { in assertGrantableToActivity() argument 70 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToActivity() 72 final Uri sub2Uri = Uri.withAppendedPath(uri, "yes"); in assertGrantableToActivity() 78 assertAccess(uri, 0); in assertGrantableToActivity() 92 assertAccess(uri, 0); in assertGrantableToActivity() 106 assertAccess(uri, 0); in assertGrantableToActivity() [all …]
|
/cts/tests/tests/contactsprovider/src/android/provider/cts/contacts/ |
D | ContactsContract_AllUriTest.java | 271 private String[] getColumns(Uri uri) { in getColumns() argument 272 try (Cursor c = mResolver.query(uri, in getColumns() 282 private void checkQueryExecutable(Uri uri, in checkQueryExecutable() argument 286 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable() 291 addFailure("Query failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 295 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable() 300 addFailure("Query with cancel failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 305 uri.buildUpon().appendQueryParameter( in checkQueryExecutable() 311 addFailure("Query with limit failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 317 uri.buildUpon() in checkQueryExecutable() [all …]
|
D | ContactsContract_StatusUpdatesTest.java | 62 assertNotNull(results[0].uri); in setUp() 63 assertNotNull(results[1].uri); in setUp() 65 dataId = ContentUris.parseId(results[1].uri); in setUp() 69 Uri uri = insertStatusUpdate(dataId, StatusUpdates.DO_NOT_DISTURB, null, null); in testInsertStatus() local 70 assertPresence(uri, StatusUpdates.DO_NOT_DISTURB); in testInsertStatus() 71 assertStatus(uri, null); in testInsertStatus() 72 assertHasTimestamp(uri, false); in testInsertStatus() 73 assertRowCount(uri, 1); in testInsertStatus() 76 assertEquals(uri, uri2); in testInsertStatus() 78 assertPresence(uri, StatusUpdates.AVAILABLE); in testInsertStatus() [all …]
|
D | ContactsContract_DumpFileProviderTest.java | 52 Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_throwsErrorWithIllegalFileName() local 53 assertOpenFileDescriptorThrowsError(uri); in testOpenFileDescriptor_throwsErrorWithIllegalFileName() 59 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_worksWithValidFileName() local 61 mResolver.openFileDescriptor(uri, "r"); in testOpenFileDescriptor_worksWithValidFileName() 70 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_throwsErrorWithIllegalFileName() local 71 assertQueryThrowsError(uri); in testQuery_throwsErrorWithIllegalFileName() 77 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_worksWithValidFileName() local 78 mResolver.query(uri, null, null, null, null); in testQuery_worksWithValidFileName() 82 private void assertQueryThrowsError(Uri uri) { in assertQueryThrowsError() argument 84 mResolver.query(uri, null, null, null, null); in assertQueryThrowsError() [all …]
|
D | ContactsContract_SearchSnippetsTest.java | 82 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_NoMatch() local 85 assertCursorStoredValuesWithContactsFilter(uri, ids); in testSearchSnippets_NoMatch() 90 final Uri uri = ContactsContract.Contacts.ENTERPRISE_CONTENT_FILTER_URI.buildUpon() in testEnterpriseSearchSnippets_NoMatch() local 94 assertCursorStoredValuesWithContactsFilter(uri, ids); in testEnterpriseSearchSnippets_NoMatch() 99 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_MatchEmailAddressCorrectSnippet() local 105 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_MatchEmailAddressCorrectSnippet() 110 final Uri uri = ContactsContract.Contacts.ENTERPRISE_CONTENT_FILTER_URI.buildUpon() in testEnterpriseSearchSnippets_MatchEmailAddressCorrectSnippet() local 117 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testEnterpriseSearchSnippets_MatchEmailAddressCorrectSnippet() 122 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_MatchPhoneNumberCorrectSnippet() local 128 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_MatchPhoneNumberCorrectSnippet() [all …]
|
/cts/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ |
D | SmsTest.java | 75 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsInsert() local 76 assertThat(uri).isNotNull(); in testSmsInsert() 78 Cursor cursor = mContentResolver.query(uri, null, null, null); in testSmsInsert() 91 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsDelete() local 92 assertThat(uri).isNotNull(); in testSmsDelete() 94 int deletedRows = mContentResolver.delete(uri, null, null); in testSmsDelete() 98 Cursor cursor = mContentResolver.query(uri, null, null, null); in testSmsDelete() 109 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsUpdate() local 110 assertThat(uri).isNotNull(); in testSmsUpdate() 112 mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.BODY, uri, TEST_SMS_BODY); in testSmsUpdate() [all …]
|
/cts/tests/framework/base/windowmanager/util/src/android/server/wm/settings/ |
D | SettingsSession.java | 88 public SettingsSession(final Uri uri, final SettingsGetter<T> getter, in SettingsSession() argument 90 mUri = uri; in SettingsSession() 96 initialValue = get(uri, getter); in SettingsSession() 105 Log.i(TAG, "start: uri=" + uri in SettingsSession() 107 sSessionCounters.open(uri); in SettingsSession() 144 private static <T> void put(final Uri uri, final SettingsSetter<T> setter, T value) { in put() argument 146 setter.set(getContentResolver(), uri.getLastPathSegment(), value); in put() 150 private static <T> T get(final Uri uri, final SettingsGetter<T> getter) in get() argument 152 return getter.get(getContentResolver(), uri.getLastPathSegment()); in get() 155 protected static void delete(final Uri uri) { in delete() argument [all …]
|
/cts/hostsidetests/devicepolicy/app/IntentSender/src/com/android/cts/intent/sender/ |
D | ContentTest.java | 83 Uri uri = getUriWithTextInFile("reading_test", MESSAGE); in testReceiverCanRead() local 84 assertNotNull(uri); in testReceiverCanRead() 86 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanRead() 103 Uri uri = getUriWithTextInFile("writing_test", ""); in testReceiverCanWrite() local 104 assertTrue(uri != null); in testReceiverCanWrite() 106 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanWrite() 112 assertEquals(MESSAGE, getFirstLineFromUri(uri)); in testReceiverCanWrite() 116 Uri uri = getUriWithTextInFile("persistable_test", MESSAGE); in testPersistablePermission() local 117 grantPersistableReadPermission(uri); in testPersistablePermission() 121 intent.setClipData(ClipData.newRawUri("", uri)); in testPersistablePermission() [all …]
|
/cts/tests/tests/content/src/android/content/cts/ |
D | MockContentProvider.java | 142 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument 147 switch (URL_MATCHER.match(uri)) { in delete() 156 segment = uri.getPathSegments().get(1); in delete() 165 segment = uri.getPathSegments().get(1); in delete() 177 throw new IllegalArgumentException("Unknown URL " + uri); in delete() 180 getContext().getContentResolver().notifyChange(uri, null); in delete() 185 public String getType(Uri uri) { in getType() argument 186 switch (URL_MATCHER.match(uri)) { in getType() 199 throw new IllegalArgumentException("Unknown URL " + uri); in getType() 204 public String[] getStreamTypes(@NonNull Uri uri, @NonNull String mimeTypeFilter) { in getStreamTypes() argument [all …]
|
D | IntentFilter_AuthorityEntryTest.java | 55 Uri uri = Uri.parse("testUri"); in testMatch() local 56 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 57 uri = Uri.parse("content://contacts/deleted_people"); in testMatch() 58 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 59 uri = Uri.parse("test"); in testMatch() 61 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 62 uri = Uri.parse("http://" + mHost); in testMatch() 64 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch() 66 uri = Uri.parse("http://" + mHost + ":90"); in testMatch() 68 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch() [all …]
|
D | DummyProvider.java | 97 public Uri insert(Uri uri, ContentValues values) { in insert() argument 98 String tbName = getTableName(uri); in insert() 104 getContext().getContentResolver().notifyChange(uri, null); in insert() 105 return uri; in insert() 115 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 117 String tbName = getTableName(uri); in query() 123 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 127 private String getTableName(Uri uri) { in getTableName() argument 128 switch (sMatcher.match(uri)) { in getTableName() 162 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
D | ContentProviderTest.java | 56 Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + in testOpenAssetFile() local 60 mockContentProvider.openAssetFile(uri, "r"); in testOpenAssetFile() 116 Uri uri = Uri.parse("content://browser/bookmarks"); in testBulkInsert() local 117 assertEquals(count, mockContentProvider.bulkInsert(uri, values)); in testBulkInsert() 175 Uri uri = Uri.parse("content://test"); in testOpenFile() local 176 mockContentProvider.openFile(uri, "r"); in testOpenFile() 197 Uri uri = Uri.parse("content://test"); in testOpenFileHelper() local 198 assertNotNull(cp.openFile(uri, "r")); in testOpenFileHelper() 201 uri = Uri.parse("content://test"); in testOpenFileHelper() 202 cp.openFile(uri, "wrong"); in testOpenFileHelper() [all …]
|
/cts/tests/tests/provider/src/android/provider/cts/media/ |
D | MediaStorePlacementTest.java | 87 final Uri uri = ProviderTestUtils.stageMedia(R.drawable.scenery, in testDefault() local 91 final File before = ProviderTestUtils.getRelativeFile(uri); in testDefault() 99 final Uri uri = ProviderTestUtils.stageMedia(R.drawable.scenery, in testIgnored() local 105 assertEquals(0, mContentResolver.update(uri, values, null, null)); in testIgnored() 117 mContentResolver.update(uri, values, null, null); in testIgnored() 126 final Uri uri = ProviderTestUtils.stageMedia(R.drawable.scenery, in testDisplayName_SameMime() local 130 final File before = ProviderTestUtils.getRelativeFile(uri); in testDisplayName_SameMime() 132 assertTrue(updatePlacement(uri, null, Optional.of(name))); in testDisplayName_SameMime() 134 final File after = ProviderTestUtils.getRelativeFile(uri); in testDisplayName_SameMime() 141 final Uri uri = ProviderTestUtils.stageMedia(R.drawable.scenery, in testDisplayName_DifferentMime() local [all …]
|
/cts/tests/JobScheduler/src/android/jobscheduler/ |
D | DummyJobContentProvider.java | 86 public Uri insert(Uri uri, ContentValues values) { in insert() argument 87 String tbName = getTableName(uri); in insert() 93 getContext().getContentResolver().notifyChange(uri, null); in insert() 94 return uri; in insert() 104 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 106 String tbName = getTableName(uri); in query() 112 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 116 private String getTableName(Uri uri) { in getTableName() argument 117 switch (sMatcher.match(uri)) { in getTableName() 131 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
/cts/tests/JobSchedulerSharedUid/src/android/jobscheduler/ |
D | DummyJobContentProvider.java | 86 public Uri insert(Uri uri, ContentValues values) { in insert() argument 87 String tbName = getTableName(uri); in insert() 93 getContext().getContentResolver().notifyChange(uri, null); in insert() 94 return uri; in insert() 104 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 106 String tbName = getTableName(uri); in query() 112 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 116 private String getTableName(Uri uri) { in getTableName() argument 117 switch (sMatcher.match(uri)) { in getTableName() 131 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
/cts/tests/tests/slice/src/android/slice/cts/ |
D | SliceBindingTest.java | 92 Uri uri = BASE_URI.buildUpon().appendPath("subslice").build(); in testSubSlice() local 93 Slice s = mSliceManager.bindSlice(uri, Collections.emptySet()); in testSubSlice() 94 assertEquals(uri, s.getUri()); in testSubSlice() 101 assertTrue(item.getSlice().getUri().toString().startsWith(uri.toString())); in testSubSlice() 102 assertNotEquals(uri, item.getSlice().getUri()); in testSubSlice() 110 Uri uri = BASE_URI.buildUpon().appendPath("text").build(); in testText() local 111 Slice s = mSliceManager.bindSlice(uri, in testText() 113 assertEquals(uri, s.getUri()); in testText() 127 Uri uri = BASE_URI.buildUpon().appendPath("icon").build(); in testIcon() local 128 Slice s = mSliceManager.bindSlice(uri, in testIcon() [all …]
|
D | SlicePermissionsTest.java | 86 Uri uri = BASE_URI.buildUpon() in testGrantParent() local 91 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParent() 96 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParent() 104 Uri uri = BASE_URI.buildUpon() in testGrantParentExpands() local 109 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands() 111 mSliceManager.grantSlicePermission(mTestPkg, uri); in testGrantParentExpands() 115 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands() 123 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands() 133 Uri uri = BASE_URI.buildUpon() in testGrantChild() local 140 mSliceManager.grantSlicePermission(mTestPkg, uri); in testGrantChild() [all …]
|
/cts/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/ |
D | IntentReceiverActivity.java | 82 final Uri uri = clipData != null ? clipData.getItemAt(0).getUri() : null; in onCreate() local 95 message = getFirstLineFromUri(uri); in onCreate() 97 Log.i(TAG, "Caught a SecurityException while trying to read " + uri, e); in onCreate() 100 Log.i(TAG, "Caught a IOException while trying to read " + uri, e); in onCreate() 106 Log.i(TAG, "Taking persistable uri permission to " + uri); in onCreate() 107 getContentResolver().takePersistableUriPermission(uri, in onCreate() 115 writeToUri(uri, message); in onCreate() 117 Log.i(TAG, "Caught a SecurityException while trying to write to " + uri, e); in onCreate() 120 Log.i(TAG, "Caught a IOException while trying to write to " + uri, e); in onCreate() 124 Log.i(TAG, "Notifying a uri change to " + uri); in onCreate() [all …]
|
/cts/hostsidetests/inputmethodservice/deviceside/provider/src/android/inputmethodservice/cts/provider/ |
D | EventProvider.java | 70 public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, in query() argument 72 final UriHelper uriHelper = mUriFactory.newInstance(uri); in query() 75 + " uri=" + uri in query() 88 cursor.setNotificationUri(getContext().getContentResolver(), uri); in query() local 93 public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { in insert() argument 94 final UriHelper uriHelper = mUriFactory.newInstance(uri); in insert() 96 Log.d(TAG, "insert: uri=" + uri + " values={" + values + "}"); in insert() 99 final Uri insertedUri = ContentUris.withAppendedId(uri, rowId); in insert() 108 public int delete(@NonNull Uri uri, @Nullable String selection, in delete() argument 110 final UriHelper uriHelper = mUriFactory.newInstance(uri); in delete() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/ |
D | TestResultsProvider.java | 115 final Uri uri = getResultContentUri(context); in setTestResult() local 117 int numUpdated = resolver.update(uri, values, in setTestResult() 122 resolver.insert(uri, values); in setTestResult() 165 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 170 int match = URI_MATCHER.match(uri); in query() 178 query.appendWhere(uri.getPathSegments().get(1)); in query() 184 query.appendWhere("\"" + uri.getPathSegments().get(1) + "\""); in query() 201 throw new IllegalArgumentException("Unknown URI: " + uri); in query() 209 public Uri insert(Uri uri, ContentValues values) { in insert() argument 210 int match = URI_MATCHER.match(uri); in insert() [all …]
|