Home
last modified time | relevance | path

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

123456

/cts/tests/tests/net/src/android/net/cts/
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 …]
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 …]
/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 …]
/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 …]
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 …]
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 …]
/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/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 …]
DBasicContentProvider.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
/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/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/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/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/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
DPrivateContentProviderGranting.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
DPermissionContentProviderPath.java18 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
24 public String getType(Uri uri) { in getType() argument
29 public Uri insert(Uri uri, ContentValues values) { in insert() argument
39 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
45 public int update(Uri uri, ContentValues values, String selection, in update() argument
51 public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { in openFile() argument
DPrivateContentProvider.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
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
DAmbiguousContentProvider.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
DPermissionContentProvider.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
/cts/hostsidetests/appsecurity/test-apps/PermissionDeclareAppCompat/src/com/android/cts/permissiondeclareappcompat/
DAmbiguousContentProvider.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
/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()

123456