Home
last modified time | relevance | path

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

123456789

/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/contacts/
DContactsContract_AllUriTest.java271 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 …]
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 …]
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.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/framework/base/activitymanager/util/src/android/server/am/settings/
DSettingsSession.java67 public SettingsSession(final Uri uri, final SettingsGetter<T> getter, in SettingsSession() argument
69 mUri = uri; in SettingsSession()
75 initialValue = get(uri, getter); in SettingsSession()
84 Log.i(TAG, "start: uri=" + uri in SettingsSession()
86 sSessionCounters.open(uri); in SettingsSession()
123 private static <T> void put(final Uri uri, final SettingsSetter<T> setter, T value) in put() argument
125 setter.set(getContentResolver(), uri.getLastPathSegment(), value); in put()
128 private static <T> T get(final Uri uri, final SettingsGetter<T> getter) in get() argument
130 return getter.get(getContentResolver(), uri.getLastPathSegment()); in get()
133 private static void delete(final Uri uri) throws IllegalArgumentException { in delete() argument
[all …]
/cts/hostsidetests/devicepolicy/app/IntentSender/src/com/android/cts/intent/sender/
DContentTest.java83 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/
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.java141 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
146 switch (URL_MATCHER.match(uri)) { in delete()
155 segment = uri.getPathSegments().get(1); in delete()
164 segment = uri.getPathSegments().get(1); in delete()
176 throw new IllegalArgumentException("Unknown URL " + uri); in delete()
179 getContext().getContentResolver().notifyChange(uri, null); in delete()
184 public String getType(Uri uri) { in getType() argument
185 switch (URL_MATCHER.match(uri)) { in getType()
198 throw new IllegalArgumentException("Unknown URL " + uri); in getType()
203 public String[] getStreamTypes(@NonNull Uri uri, @NonNull String mimeTypeFilter) { in getStreamTypes() 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/JobSchedulerSharedUid/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/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/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/
DAccessPermissionWithDiffSigTest.java92 private void assertReadingContentUriNotAllowed(Uri uri, String msg) { in assertReadingContentUriNotAllowed() argument
94 getContext().getContentResolver().query(uri, null, null, null, null); in assertReadingContentUriNotAllowed()
95 fail("expected SecurityException reading " + uri + ": " + msg); in assertReadingContentUriNotAllowed()
101 private void assertReadingContentUriAllowed(Uri uri) { in assertReadingContentUriAllowed() argument
103 getContext().getContentResolver().query(uri, null, null, null, null); in assertReadingContentUriAllowed()
105 fail("unexpected SecurityException reading " + uri + ": " + e.getMessage()); in assertReadingContentUriAllowed()
116 Uri uri = item.getUri(); in assertReadingClipNotAllowed() local
117 if (uri != null) { in assertReadingClipNotAllowed()
118 assertReadingContentUriNotAllowed(uri, msg); in assertReadingClipNotAllowed()
121 uri = intent.getData(); in assertReadingClipNotAllowed()
[all …]
/cts/tests/tests/provider/src/android/provider/cts/
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/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/
DIntentReceiverActivity.java82 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/tests/tests/slice/src/android/slice/cts/
DSliceBindingTest.java80 Uri uri = BASE_URI.buildUpon().appendPath("subslice").build(); in testSubSlice() local
81 Slice s = mSliceManager.bindSlice(uri, Collections.emptySet()); in testSubSlice()
82 assertEquals(uri, s.getUri()); in testSubSlice()
89 assertTrue(item.getSlice().getUri().toString().startsWith(uri.toString())); in testSubSlice()
90 assertNotEquals(uri, item.getSlice().getUri()); in testSubSlice()
95 Uri uri = BASE_URI.buildUpon().appendPath("text").build(); in testText() local
96 Slice s = mSliceManager.bindSlice(uri, in testText()
98 assertEquals(uri, s.getUri()); in testText()
109 Uri uri = BASE_URI.buildUpon().appendPath("icon").build(); in testIcon() local
110 Slice s = mSliceManager.bindSlice(uri, in testIcon()
[all …]
DSlicePermissionsTest.java71 Uri uri = BASE_URI.buildUpon() in testGrantParent() local
76 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParent()
81 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParent()
86 Uri uri = BASE_URI.buildUpon() in testGrantParentExpands() local
91 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands()
93 mSliceManager.grantSlicePermission(mTestPkg, uri); in testGrantParentExpands()
97 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands()
105 mSliceManager.checkSlicePermission(uri, mTestPid, mTestUid)); in testGrantParentExpands()
112 Uri uri = BASE_URI.buildUpon() in testGrantChild() local
119 mSliceManager.grantSlicePermission(mTestPkg, uri); in testGrantChild()
[all …]
/cts/tests/JobSchedulerSharedUid/jobperm/src/android/jobscheduler/cts/shareduid/jobperm/
DJobPermProvider.java43 Uri uri = extras.getParcelable("uri"); in call() local
44 getContext().grantUriPermission(arg, uri, in call()
50 Uri uri = extras.getParcelable("uri"); in call() local
51 getContext().revokeUriPermission(arg, uri, in call()
62 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
68 public String getType(Uri uri) { in getType() argument
73 public Uri insert(Uri uri, ContentValues values) { in insert() argument
83 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
89 public int update(Uri uri, ContentValues values, String selection, in update() argument
95 public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { in openFile() argument
/cts/hostsidetests/inputmethodservice/deviceside/provider/src/android/inputmethodservice/cts/provider/
DEventProvider.java69 public Cursor query(@NonNull final Uri uri, @Nullable final String[] projection, 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 final Uri uri, @Nullable final 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 final Uri uri, @Nullable final String selection, in delete() argument
110 final UriHelper uriHelper = mUriFactory.newInstance(uri); in delete()
[all …]
/cts/tests/framework/base/windowmanager/dndsourceapp/src/android/server/wm/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/hostsidetests/appsecurity/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
DUtilsProvider.java59 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in call() local
60 context.grantUriPermission(intent.getStringExtra(EXTRA_PACKAGE_NAME), uri, in call() local
64 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in call() local
65 context.revokeUriPermission(uri, intent.getIntExtra(EXTRA_MODE, 0)); in call()
98 final Uri uri = intent.getParcelableExtra(EXTRA_URI); in verifyOutgoingPersisted() local
101 if (uri != null) { in verifyOutgoingPersisted()
107 if (!perm.getUri().equals(uri)) { in verifyOutgoingPersisted()
109 "Expected " + uri + " but found " + perm.getUri()); in verifyOutgoingPersisted()
125 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
131 public String getType(Uri uri) { in getType() argument
[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/location/src/android/location/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()

123456789