Home
last modified time | relevance | path

Searched refs:uri (Results 1 – 25 of 149) 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 …]
/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 …]
DDummyProvider.java97 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 …]
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/tests/JobScheduler/src/android/jobscheduler/
DDummyJobContentProvider.java86 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/hostsidetests/services/windowmanager/dndtargetapp/src/android/wm/cts/dndtargetapp/
DDropTarget.java143 Uri uri = item.getUri(); in processDrop() local
144 if (uri == null) { in processDrop()
157 return processUri(uri); in processDrop()
165 abstract protected String processUri(Uri uri); in processUri() argument
177 protected String processUri(Uri uri) { in processUri() argument
178 return checkQueryResult(uri, MAGIC_VALUE); in processUri()
181 protected String checkQueryResult(Uri uri, String expectedValue) { in checkQueryResult() argument
184 cursor = getContentResolver().query(uri, null, null, null, null); in checkQueryResult()
207 protected String processUri(Uri uri) { in processUri() argument
210 getContentResolver().update(uri, values, null, null); in processUri()
[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/apps/CtsVerifier/src/com/android/cts/verifier/
DTestResultsProvider.java134 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
139 int match = URI_MATCHER.match(uri); in query()
147 query.appendWhere(uri.getPathSegments().get(1)); in query()
153 query.appendWhere("\"" + uri.getPathSegments().get(1) + "\""); in query()
157 throw new IllegalArgumentException("Unknown URI: " + uri); in query()
165 public Uri insert(Uri uri, ContentValues values) { in insert() argument
168 getContext().getContentResolver().notifyChange(uri, null); in insert()
174 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
175 int match = URI_MATCHER.match(uri); in update()
181 String idSelection = _ID + "=" + uri.getPathSegments().get(1); in update()
[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/hostsidetests/services/windowmanager/dndsourceapp/src/android/wm/cts/dndsourceapp/
DDragSourceContentProvider.java43 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
45 switch (sMatcher.match(uri)) { in query()
47 return new DragSourceCursor(uri.getLastPathSegment()); in query()
53 public String getType(Uri uri) { in getType() argument
58 public Uri insert(Uri uri, ContentValues values) { in insert() argument
63 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
68 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
/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/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()
/cts/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
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
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
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
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
/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

123456