Home
last modified time | relevance | path

Searched refs:uri (Results 1 – 25 of 134) sorted by relevance

123456

/cts/tests/tests/net/src/android/net/cts/
DUriTest.java96 Uri uri = Uri.parse("http://localhost:42"); in testStringUri() local
97 assertEquals("localhost", uri.getHost()); in testStringUri()
98 assertEquals(42, uri.getPort()); in testStringUri()
100 uri = Uri.parse("http://bob@localhost:42"); in testStringUri()
101 assertEquals("bob", uri.getUserInfo()); in testStringUri()
102 assertEquals("localhost", uri.getHost()); in testStringUri()
103 assertEquals(42, uri.getPort()); in testStringUri()
105 uri = Uri.parse("http://bob%20lee@localhost:42"); in testStringUri()
106 assertEquals("bob lee", uri.getUserInfo()); in testStringUri()
107 assertEquals("bob%20lee", uri.getEncodedUserInfo()); in testStringUri()
[all …]
DUri_BuilderTest.java25 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/tests/tests/provider/src/android/provider/cts/
DContactsContract_StatusUpdatesTest.java62 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 …]
DContactsContract_DumpFileProviderTest.java53 Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_throwsErrorWithIllegalFileName() local
54 assertOpenFileDescriptorThrowsError(uri); in testOpenFileDescriptor_throwsErrorWithIllegalFileName()
60 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_worksWithValidFileName() local
62 mResolver.openFileDescriptor(uri, "r"); in testOpenFileDescriptor_worksWithValidFileName()
71 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_throwsErrorWithIllegalFileName() local
72 assertQueryThrowsError(uri); in testQuery_throwsErrorWithIllegalFileName()
78 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_worksWithValidFileName() local
79 mResolver.query(uri, null, null, null, null); in testQuery_worksWithValidFileName()
83 private void assertQueryThrowsError(Uri uri) { in assertQueryThrowsError() argument
85 mResolver.query(uri, null, null, null, null); in assertQueryThrowsError()
[all …]
DSettings_NameValueTableTest.java30 Uri uri = Settings.System.CONTENT_URI; in testPutString() local
35 Cursor c = cr.query(uri, null, null, null, null); in testPutString()
41 MyNameValueTable.putString(cr, uri, name, value); in testPutString()
42 c = cr.query(uri, null, null, null, null); in testPutString()
49 c = cr.query(uri, null, selection, null, null); in testPutString()
58 cr.delete(uri, selection, null); in testPutString()
59 c = cr.query(uri, null, null, null, null); in testPutString()
69 Uri uri = Uri.parse("content://authority/path"); in testGetUriFor() local
72 Uri res = NameValueTable.getUriFor(uri, name); in testGetUriFor()
74 assertEquals(Uri.withAppendedPath(uri, name), res); in testGetUriFor()
[all …]
DContactsContract_PhoneLookup.java103 final Uri uri = PhoneLookup.CONTENT_FILTER_URI.buildUpon() in testPhoneLookup_nomatch() local
106 assertCursorStoredValuesWithContactsFilter(uri, ids /*, empty */); in testPhoneLookup_nomatch()
114 final Uri uri = PhoneLookup.CONTENT_FILTER_URI.buildUpon() in testPhoneLookup_found1() local
121 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testPhoneLookup_found1()
129 final Uri uri = PhoneLookup.CONTENT_FILTER_URI.buildUpon() in testPhoneLookup_found2() local
136 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testPhoneLookup_found2()
144 final Uri uri = PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.buildUpon() in testPhoneLookupEnterprise_nomatch() local
147 assertCursorStoredValuesWithContactsFilter(uri, ids /*, empty */); in testPhoneLookupEnterprise_nomatch()
155 final Uri uri = PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.buildUpon() in testPhoneLookupEnterprise_found1() local
162 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testPhoneLookupEnterprise_found1()
[all …]
DContactsContract_AggregationSuggestionsTest.java63 Uri uri = AggregationSuggestions.builder() in testAggregationSuggestionsByNameReversed() local
68 Cursor cursor = mResolver.query(uri, TEST_PROJECTION, null, null, null); in testAggregationSuggestionsByNameReversed()
85 Uri uri = AggregationSuggestions.builder() in testAggregationSuggestionsByName() local
90 Cursor cursor = mResolver.query(uri, TEST_PROJECTION, null, null, null); in testAggregationSuggestionsByName()
106 Uri uri = AggregationSuggestions.builder() in testAggregationSuggestionsByName_noMatch() local
112 uri, new String[] { Contacts._ID, Contacts.DISPLAY_NAME }, null, null, null); in testAggregationSuggestionsByName_noMatch()
122 Uri uri = AggregationSuggestions.builder() in testAggregationSuggestionsByName_matchSecondNameParameter() local
128 Cursor cursor = mResolver.query(uri, TEST_PROJECTION, null, null, null); in testAggregationSuggestionsByName_matchSecondNameParameter()
143 Uri uri = AggregationSuggestions.builder() in testAggregationSuggestionsByName_matchFirstNameParameter() local
149 Cursor cursor = mResolver.query(uri, TEST_PROJECTION, null, null, null); in testAggregationSuggestionsByName_matchFirstNameParameter()
[all …]
DContactsContract_SearchSnippetsTest.java82 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.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_MatchEmailAddressCorrectSnippet() local
96 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_MatchEmailAddressCorrectSnippet()
101 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_MatchPhoneNumberCorrectSnippet() local
107 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_MatchPhoneNumberCorrectSnippet()
112 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_MatchPostalAddressCorrectSnippet() local
118 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_MatchPostalAddressCorrectSnippet()
123 final Uri uri = ContactsContract.Contacts.CONTENT_FILTER_URI.buildUpon() in testSearchSnippets_LongMatchTruncation() local
129 assertCursorStoredValuesWithContactsFilter(uri, ids, expected); in testSearchSnippets_LongMatchTruncation()
[all …]
/cts/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/
DAccessPermissionWithDiffSigTest.java69 private void assertReadingContentUriNotAllowed(Uri uri, String msg) { in assertReadingContentUriNotAllowed() argument
71 getContext().getContentResolver().query(uri, null, null, null, null); in assertReadingContentUriNotAllowed()
72 fail("expected SecurityException reading " + uri + ": " + msg); in assertReadingContentUriNotAllowed()
78 private void assertReadingContentUriAllowed(Uri uri) { in assertReadingContentUriAllowed() argument
80 getContext().getContentResolver().query(uri, null, null, null, null); in assertReadingContentUriAllowed()
82 fail("unexpected SecurityException reading " + uri + ": " + e.getMessage()); in assertReadingContentUriAllowed()
89 Uri uri = item.getUri(); in assertReadingClipNotAllowed() local
90 if (uri != null) { in assertReadingClipNotAllowed()
91 assertReadingContentUriNotAllowed(uri, msg); in assertReadingClipNotAllowed()
94 uri = intent.getData(); in assertReadingClipNotAllowed()
[all …]
/cts/tests/tests/content/src/android/content/cts/
DIntentFilter_AuthorityEntryTest.java55 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 …]
DMockContentProvider.java132 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
137 switch (URL_MATCHER.match(uri)) { in delete()
146 segment = uri.getPathSegments().get(1); in delete()
155 segment = uri.getPathSegments().get(1); in delete()
167 throw new IllegalArgumentException("Unknown URL " + uri); in delete()
170 getContext().getContentResolver().notifyChange(uri, null); in delete()
175 public String getType(Uri uri) { in getType() argument
176 switch (URL_MATCHER.match(uri)) { in getType()
189 throw new IllegalArgumentException("Unknown URL " + uri); in getType()
194 public Uri insert(Uri uri, ContentValues initialValues) { in insert() argument
[all …]
DContentProviderTest.java53 Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + in testOpenAssetFile() local
57 mockContentProvider.openAssetFile(uri, "r"); in testOpenAssetFile()
113 Uri uri = Uri.parse("content://browser/bookmarks"); in testBulkInsert() local
114 assertEquals(count, mockContentProvider.bulkInsert(uri, values)); in testBulkInsert()
172 Uri uri = Uri.parse("content://test"); in testOpenFile() local
173 mockContentProvider.openFile(uri, "r"); in testOpenFile()
194 Uri uri = Uri.parse("content://test"); in testOpenFileHelper() local
195 assertNotNull(cp.openFile(uri, "r")); in testOpenFileHelper()
198 uri = Uri.parse("content://test"); in testOpenFileHelper()
199 cp.openFile(uri, "wrong"); in testOpenFileHelper()
[all …]
DDummyProvider.java100 public Uri insert(Uri uri, ContentValues values) { in insert() argument
101 String tbName = getTableName(uri); in insert()
107 getContext().getContentResolver().notifyChange(uri, null); in insert()
108 return uri; in insert()
118 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
120 String tbName = getTableName(uri); in query()
126 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local
130 private String getTableName(Uri uri) { in getTableName() argument
131 switch (sMatcher.match(uri)) { in getTableName()
165 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
[all …]
DAvailableIntentsTest.java55 Uri uri = Uri.parse(NORMAL_URL); in testViewNormalUrl() local
56 Intent intent = new Intent(Intent.ACTION_VIEW, uri); in testViewNormalUrl()
65 Uri uri = Uri.parse(SECURE_URL); in testViewSecureUrl() local
66 Intent intent = new Intent(Intent.ACTION_VIEW, uri); in testViewSecureUrl()
75 Uri uri = Uri.parse(NORMAL_URL); in testWebSearchNormalUrl() local
77 intent.putExtra(SearchManager.QUERY, uri); in testWebSearchNormalUrl()
86 Uri uri = Uri.parse(SECURE_URL); in testWebSearchSecureUrl() local
88 intent.putExtra(SearchManager.QUERY, uri); in testWebSearchSecureUrl()
109 Uri uri = Uri.parse("tel:2125551212"); in testCallPhoneNumber() local
110 Intent intent = new Intent(Intent.ACTION_CALL, uri); in testCallPhoneNumber()
[all …]
/cts/hostsidetests/devicepolicy/app/IntentSender/src/com/android/cts/intent/sender/
DContentTest.java70 Uri uri = getUriWithTextInFile("reading_test", MESSAGE); in testReceiverCanRead() local
71 assertTrue(uri != null); in testReceiverCanRead()
73 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanRead()
90 Uri uri = getUriWithTextInFile("writing_test", ""); in testReceiverCanWrite() local
91 assertTrue(uri != null); in testReceiverCanWrite()
93 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanWrite()
99 assertEquals(MESSAGE, getFirstLineFromUri(uri)); in testReceiverCanWrite()
103 Uri uri = getUriWithTextInFile("persistable_test", MESSAGE); in testPersistablePermission() local
104 grantPersistableReadPermission(uri); in testPersistablePermission()
108 intent.setClipData(ClipData.newRawUri("", uri)); in testPersistablePermission()
[all …]
/cts/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/
DIntentReceiverActivity.java65 final Uri uri = clipData != null ? clipData.getItemAt(0).getUri() : null; in onCreate() local
78 message = getFirstLineFromUri(uri); in onCreate()
80 Log.i(TAG, "Caught a SecurityException while trying to read " + uri, e); in onCreate()
83 Log.i(TAG, "Caught a IOException while trying to read " + uri, e); in onCreate()
89 Log.i(TAG, "Taking persistable uri permission to " + uri); in onCreate()
90 getContentResolver().takePersistableUriPermission(uri, in onCreate()
98 writeToUri(uri, message); in onCreate()
100 Log.i(TAG, "Caught a SecurityException while trying to write to " + uri, e); in onCreate()
103 Log.i(TAG, "Caught a IOException while trying to write to " + uri, e); in onCreate()
115 private String getFirstLineFromUri(Uri uri) throws IOException { in getFirstLineFromUri() argument
[all …]
/cts/tests/tests/netsecpolicy/src/android/security/
DNetworkSecurityPolicyTestBase.java87 Uri uri = Uri.parse(url.toString()).buildUpon().scheme(null).authority(null).build(); in assertCleartextHttpURLConnectionSucceeds() local
88 assertTrue(mHttpOnlyWebServer.wasResourceRequested(uri.toString())); in assertCleartextHttpURLConnectionSucceeds()
110 Uri uri = Uri.parse(url.toString()).buildUpon().scheme(null).authority(null).build(); in assertCleartextHttpURLConnectionBlocked() local
111 assertFalse(mHttpOnlyWebServer.wasResourceRequested(uri.toString())); in assertCleartextHttpURLConnectionBlocked()
131 Uri uri = Uri.parse(url.toString()).buildUpon().scheme(null).authority(null).build(); in assertAndroidHttpClientCleartextRequestSucceeds() local
132 assertTrue(mHttpOnlyWebServer.wasResourceRequested(uri.toString())); in assertAndroidHttpClientCleartextRequestSucceeds()
148 Uri uri = Uri.parse(url.toString()).buildUpon().scheme(null).authority(null).build(); in assertAndroidHttpClientCleartextRequestBlocked() local
149 assertFalse(mHttpOnlyWebServer.wasResourceRequested(uri.toString())); in assertAndroidHttpClientCleartextRequestBlocked()
162 Uri uri = Uri.parse(mHttpOnlyWebServer.getUserAgentUrl()); in assertMediaPlayerCleartextRequestSucceeds() local
163 mediaPlayer.setDataSource(getContext(), uri); in assertMediaPlayerCleartextRequestSucceeds() local
[all …]
/cts/tests/tests/webkit/src/android/webkit/cts/
DMockContentProvider.java46 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
51 public String getType(Uri uri) { in getType() argument
56 public Uri insert(Uri uri, ContentValues initialValues) { in insert() argument
61 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
67 public int update(Uri uri, ContentValues values, String selection, in update() argument
73 public AssetFileDescriptor openAssetFile(Uri uri, String mode) in openAssetFile() argument
75 return new AssetFileDescriptor(openPipeHelper(uri, "text/html", null, in openAssetFile()
76 "<html><title>" + uri.toString() + "</title></html>", this), 0, in openAssetFile()
81 public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType, Bundle opts, in writeDataToPipe() argument
/cts/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/
DDocumentsClientTest.java145 final Uri uri = result.data.getData(); in testOpenSimple() local
148 MoreAsserts.assertEquals("fileone".getBytes(), readFully(uri)); in testOpenSimple()
150 writeFully(uri, "replaced!".getBytes()); in testOpenSimple()
152 MoreAsserts.assertEquals("replaced!".getBytes(), readFully(uri)); in testOpenSimple()
174 final Uri uri = result.data.getData(); in testCreateNew() local
176 writeFully(uri, "meow!".getBytes()); in testCreateNew()
178 assertEquals(DISPLAY_NAME, getColumn(uri, Document.COLUMN_DISPLAY_NAME)); in testCreateNew()
179 assertEquals(MIME_TYPE, getColumn(uri, Document.COLUMN_MIME_TYPE)); in testCreateNew()
205 final Uri uri = result.data.getData(); in testCreateExisting() local
207 MoreAsserts.assertEquals("filetwo".getBytes(), readFully(uri)); in testCreateExisting()
[all …]
/cts/tests/tests/telephony/src/android/telephony/cts/
DMmsPduProvider.java39 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
46 public String getType(Uri uri) { in getType() argument
52 public Uri insert(Uri uri, ContentValues values) { in insert() argument
58 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
64 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
70 public ParcelFileDescriptor openFile(Uri uri, String fileMode) throws FileNotFoundException { in openFile() argument
71 File file = new File(getContext().getCacheDir(), uri.getPath()); in openFile()
/cts/tests/tests/provider/src/android/provider/cts/contacts/
DRawContactUtil.java38 Uri uri = ContentUris.withAppendedId(URI, rawContactId); in update() local
39 resolver.update(uri, values, null, null); in update()
60 Uri uri = resolver.insert(URI, values); in insertRawContact() local
61 return ContentUris.parseId(uri); in insertRawContact()
66 Uri uri = ContentUris.withAppendedId(URI, rawContactId); in queryByRawContactId() local
67 Cursor cursor = resolver.query(uri, projection, null, null, null); in queryByRawContactId()
78 Uri uri = ContentUris.withAppendedId(URI, contactId); in queryByContactId() local
79 Cursor cursor = resolver.query(uri, projection, null, null, null); in queryByContactId()
85 Uri uri = ContentUris.withAppendedId(URI, rawContactId) in delete() local
89 resolver.delete(uri, null, null); in delete()
DDatabaseAsserts.java38 public static void assertDeleteIsUnsupported(ContentResolver resolver, Uri uri) { in assertDeleteIsUnsupported() argument
40 resolver.delete(uri, null, null); in assertDeleteIsUnsupported()
42 + uri); in assertDeleteIsUnsupported()
48 public static void assertInsertIsUnsupported(ContentResolver resolver, Uri uri) { in assertInsertIsUnsupported() argument
51 resolver.insert(uri, values); in assertInsertIsUnsupported()
53 + uri); in assertInsertIsUnsupported()
145 public static void assertStoredValuesInUriMatchExactly(ContentResolver resolver, Uri uri, in assertStoredValuesInUriMatchExactly() argument
147 … assertStoredValuesInUriMatchExactly(resolver, uri, null, null, null, null, false, expectedValues); in assertStoredValuesInUriMatchExactly()
166 public static void assertStoredValuesInUriMatchExactly(ContentResolver resolver, Uri uri, in assertStoredValuesInUriMatchExactly() argument
169 final Cursor cursor = resolver.query(uri, projection, selection, selectionArgs, sortOrder); in assertStoredValuesInUriMatchExactly()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/
DTestResultsProvider.java120 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
125 int match = URI_MATCHER.match(uri); in query()
133 query.appendWhere(uri.getPathSegments().get(1)); in query()
139 query.appendWhere("\"" + uri.getPathSegments().get(1) + "\""); in query()
143 throw new IllegalArgumentException("Unknown URI: " + uri); in query()
151 public Uri insert(Uri uri, ContentValues values) { in insert() argument
154 getContext().getContentResolver().notifyChange(uri, null); in insert()
160 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
161 int match = URI_MATCHER.match(uri); in update()
167 String idSelection = _ID + "=" + uri.getPathSegments().get(1); in update()
[all …]
/cts/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
DPermissionContentProviderGranting.java34 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
40 public String getType(Uri uri) { in getType() argument
45 public Uri insert(Uri uri, ContentValues values) { in insert() argument
55 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
61 public int update(Uri uri, ContentValues values, String selection, in update() argument
67 public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { in openFile() argument
DPermissionContentProviderPathRestricting.java34 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
40 public String getType(Uri uri) { in getType() argument
45 public Uri insert(Uri uri, ContentValues values) { in insert() argument
55 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
61 public int update(Uri uri, ContentValues values, String selection, in update() argument
67 public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { in openFile() argument

123456