Home
last modified time | relevance | path

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

12345

/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/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/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 …]
DSettingsTest.java117 Uri uri = Uri.parse("content://settings/bluetooth_devices"); in testBluetoothDevicesTable() local
119 ContentProviderClient provider = cr.acquireContentProviderClient(uri); in testBluetoothDevicesTable()
130 provider.insert(uri, value); in testBluetoothDevicesTable()
131 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, in testBluetoothDevicesTable()
149 provider.update(uri, value, "name=\"" + insertName + "\"", null); in testBluetoothDevicesTable()
150 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, in testBluetoothDevicesTable()
161 provider.delete(uri, "name=\"" + updateName + "\"", null); in testBluetoothDevicesTable()
162 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, "_id = " + Id, in testBluetoothDevicesTable()
204 Uri uri = Uri.parse("content://settings/" + table); in tryBadTableAccess() local
210 cr.insert(uri, cv); in tryBadTableAccess()
[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 …]
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()
176 Uri uri = Uri.parse("content://test"); in testOpenFile() local
177 mockContentProvider.openFile(uri, "r"); in testOpenFile()
198 Uri uri = Uri.parse("content://test"); in testOpenFileHelper() local
199 assertNotNull(cp.openFile(uri, "r")); in testOpenFileHelper()
202 uri = Uri.parse("content://test"); in testOpenFileHelper()
203 cp.openFile(uri, "wrong"); in testOpenFileHelper()
[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/tests/src/android/content/cts/
DMockContentProvider.java138 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
143 switch (URL_MATCHER.match(uri)) { in delete()
152 segment = uri.getPathSegments().get(1); in delete()
161 segment = uri.getPathSegments().get(1); in delete()
173 throw new IllegalArgumentException("Unknown URL " + uri); in delete()
176 getContext().getContentResolver().notifyChange(uri, null); in delete()
181 public String getType(Uri uri) { in getType() argument
182 switch (URL_MATCHER.match(uri)) { in getType()
195 throw new IllegalArgumentException("Unknown URL " + uri); in getType()
200 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 …]
/cts/tests/tests/provider/src/android/provider/cts/contacts/
DContactUtil.java35 Uri uri = ContentUris.withAppendedId(URI, contactId); in update() local
36 resolver.update(uri, values, null, null); in update()
40 Uri uri = ContentUris.withAppendedId(URI, contactId); in delete() local
41 resolver.delete(uri, null, null); in delete()
48 Uri uri = ContentUris.withAppendedId(URI, contactId); in recordExistsForContactId() local
49 Cursor cursor = resolver.query(uri, projection, null, null, null); in recordExistsForContactId()
61 Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, contactId); in queryContactLastUpdatedTimestamp() local
62 Cursor cursor = resolver.query(uri, projection, null, null, null); in queryContactLastUpdatedTimestamp()
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/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/apps/CtsVerifier/src/com/android/cts/verifier/
DTestResultsProvider.java110 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
115 int match = URI_MATCHER.match(uri); in query()
123 query.appendWhere(uri.getPathSegments().get(1)); in query()
129 query.appendWhere("\"" + uri.getPathSegments().get(1) + "\""); in query()
133 throw new IllegalArgumentException("Unknown URI: " + uri); in query()
141 public Uri insert(Uri uri, ContentValues values) { in insert() argument
144 getContext().getContentResolver().notifyChange(uri, null); in insert()
150 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
151 int match = URI_MATCHER.match(uri); in update()
157 String idSelection = _ID + "=" + uri.getPathSegments().get(1); in update()
[all …]
/cts/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
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
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
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
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
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
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
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
DGrantUriPermission.java48 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in onReceive() local
49 context.grantUriPermission(intent.getStringExtra(EXTRA_PACKAGE_NAME), uri, in onReceive() local
53 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in onReceive() local
54 context.revokeUriPermission(uri, intent.getIntExtra(EXTRA_MODE, 0)); in onReceive()
81 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in verifyOutgoingPersisted() local
84 if (uri != null) { in verifyOutgoingPersisted()
90 if (!perm.getUri().equals(uri)) { in verifyOutgoingPersisted()
92 "Expected " + uri + " but found " + perm.getUri()); in verifyOutgoingPersisted()
/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

12345