Home
last modified time | relevance | path

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

123

/cts/tests/tests/net/src/android/net/cts/
DUriTest.java187 Uri uri = Uri.parse("http://localhost:42"); in testStringUri() local
188 assertEquals("localhost", uri.getHost()); in testStringUri()
189 assertEquals(42, uri.getPort()); in testStringUri()
191 uri = Uri.parse("http://bob@localhost:42"); in testStringUri()
192 assertEquals("bob", uri.getUserInfo()); in testStringUri()
193 assertEquals("localhost", uri.getHost()); in testStringUri()
194 assertEquals(42, uri.getPort()); in testStringUri()
196 uri = Uri.parse("http://bob%20lee@localhost:42"); in testStringUri()
197 assertEquals("bob lee", uri.getUserInfo()); in testStringUri()
198 assertEquals("bob%20lee", uri.getEncodedUserInfo()); in testStringUri()
[all …]
DUri_BuilderTest.java134 Uri uri = Uri.parse("http://google.com/p1?query#fragment"); in testBuilderOperations() local
135 Builder builder = uri.buildUpon(); in testBuilderOperations()
136 uri = builder.appendPath("p2").build(); in testBuilderOperations()
137 assertEquals("http", uri.getScheme()); in testBuilderOperations()
138 assertEquals("google.com", uri.getAuthority()); in testBuilderOperations()
139 assertEquals("/p1/p2", uri.getPath()); in testBuilderOperations()
140 assertEquals("query", uri.getQuery()); in testBuilderOperations()
141 assertEquals("fragment", uri.getFragment()); in testBuilderOperations()
142 assertEquals(uri.toString(), builder.toString()); in testBuilderOperations()
144 uri = Uri.parse("mailto:nobody"); in testBuilderOperations()
[all …]
/cts/tests/appsecurity-tests/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/
DAccessPermissionWithDiffSigTest.java47 public void assertReadingContentUriNotAllowed(Uri uri, String msg) { in assertReadingContentUriNotAllowed() argument
49 getContext().getContentResolver().query(uri, null, null, null, null); in assertReadingContentUriNotAllowed()
50 fail("expected SecurityException reading " + uri + ": " + msg); in assertReadingContentUriNotAllowed()
56 public void assertWritingContentUriNotAllowed(Uri uri, String msg) { in assertWritingContentUriNotAllowed() argument
58 getContext().getContentResolver().insert(uri, new ContentValues()); in assertWritingContentUriNotAllowed()
59 fail("expected SecurityException writing " + uri + ": " + msg); in assertWritingContentUriNotAllowed()
101 public void doTryGrantUriActivityPermissionToSelf(Uri uri, int mode) { in doTryGrantUriActivityPermissionToSelf() argument
103 grantIntent.setData(uri); in doTryGrantUriActivityPermissionToSelf()
110 fail("expected SecurityException granting " + uri + " to activity"); in doTryGrantUriActivityPermissionToSelf()
152 public void doTryGrantUriServicePermissionToSelf(Uri uri, int mode) { in doTryGrantUriServicePermissionToSelf() argument
[all …]
/cts/tests/tests/content/src/android/content/cts/
DIntentFilter_AuthorityEntryTest.java82 Uri uri = Uri.parse("testUri"); in testMatch() local
83 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch()
84 uri = Uri.parse("content://contacts/deleted_people"); in testMatch()
85 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch()
86 uri = Uri.parse("test"); in testMatch()
88 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch()
89 uri = Uri.parse("http://" + mHost); in testMatch()
91 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch()
93 uri = Uri.parse("http://" + mHost + ":90"); in testMatch()
95 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch()
[all …]
DAvailableIntentsTest.java53 Uri uri = Uri.parse(NORMAL_URL); in testViewNormalUrl() local
54 Intent intent = new Intent(Intent.ACTION_VIEW, uri); in testViewNormalUrl()
63 Uri uri = Uri.parse(SECURE_URL); in testViewSecureUrl() local
64 Intent intent = new Intent(Intent.ACTION_VIEW, uri); in testViewSecureUrl()
73 Uri uri = Uri.parse(NORMAL_URL); in testWebSearchNormalUrl() local
75 intent.putExtra(SearchManager.QUERY, uri); in testWebSearchNormalUrl()
84 Uri uri = Uri.parse(SECURE_URL); in testWebSearchSecureUrl() local
86 intent.putExtra(SearchManager.QUERY, uri); in testWebSearchSecureUrl()
105 Uri uri = Uri.parse("tel:2125551212"); in testCallPhoneNumber() local
106 Intent intent = new Intent(Intent.ACTION_CALL, uri); in testCallPhoneNumber()
[all …]
DContentProviderTest.java73 Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + in testOpenAssetFile() local
77 mockContentProvider.openAssetFile(uri, "r"); in testOpenAssetFile()
143 Uri uri = Uri.parse("content://browser/bookmarks"); in testBulkInsert() local
144 assertEquals(count, mockContentProvider.bulkInsert(uri, values)); in testBulkInsert()
245 Uri uri = Uri.parse("content://test"); in testOpenFile() local
246 mockContentProvider.openFile(uri, "r"); in testOpenFile()
272 Uri uri = Uri.parse("content://test"); in testOpenFileHelper() local
273 assertNotNull(cp.openFile(uri, "r")); in testOpenFileHelper()
276 uri = Uri.parse("content://test"); in testOpenFileHelper()
277 cp.openFile(uri, "wrong"); in testOpenFileHelper()
[all …]
DClipboardManagerTest.java75 Uri uri = Uri.parse("http://www.google.com"); in testSetPrimaryClip_rawUri() local
76 ClipData uriData = ClipData.newRawUri("UriLabel", uri); in testSetPrimaryClip_rawUri()
79 new ExpectedClipItem(null, null, uri)); in testSetPrimaryClip_rawUri()
93 Uri uri = Uri.parse("http://www.google.com"); in testSetPrimaryClip_complexItem() local
98 new Item("Text", intent, uri)); in testSetPrimaryClip_complexItem()
103 new ExpectedClipItem("Text", intent, uri)); in testSetPrimaryClip_complexItem()
108 Uri uri = Uri.parse("http://www.google.com"); in testSetPrimaryClip_multipleItems() local
112 textData.addItem(new Item(uri)); in testSetPrimaryClip_multipleItems()
118 new ExpectedClipItem(null, null, uri)); in testSetPrimaryClip_multipleItems()
126 ExpectedClipItem(CharSequence text, Intent intent, Uri uri) { in ExpectedClipItem() argument
[all …]
/cts/tests/src/android/content/cts/
DMockContentProvider.java83 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
88 switch (URL_MATCHER.match(uri)) { in delete()
97 segment = uri.getPathSegments().get(1); in delete()
106 segment = uri.getPathSegments().get(1); in delete()
112 throw new IllegalArgumentException("Unknown URL " + uri); in delete()
115 getContext().getContentResolver().notifyChange(uri, null); in delete()
120 public String getType(Uri uri) { in getType() argument
121 switch (URL_MATCHER.match(uri)) { in getType()
132 throw new IllegalArgumentException("Unknown URL " + uri); in getType()
137 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/
DSettings_NameValueTableTest.java40 Uri uri = Settings.System.CONTENT_URI; in testPutString() local
45 Cursor c = cr.query(uri, null, null, null, null); in testPutString()
51 MyNameValueTable.putString(cr, uri, name, value); in testPutString()
52 c = cr.query(uri, null, null, null, null); in testPutString()
59 c = cr.query(uri, null, selection, null, null); in testPutString()
68 cr.delete(uri, selection, null); in testPutString()
69 c = cr.query(uri, null, null, null, null); in testPutString()
84 Uri uri = Uri.parse("content://authority/path"); in testGetUriFor() local
87 Uri res = NameValueTable.getUriFor(uri, name); in testGetUriFor()
89 assertEquals(Uri.withAppendedPath(uri, name), res); in testGetUriFor()
[all …]
DSettingsTest.java116 Uri uri = Uri.parse("content://settings/bluetooth_devices"); in testBluetoothDevicesTable() local
118 IContentProvider provider = cr.acquireProvider(uri); in testBluetoothDevicesTable()
129 provider.insert(uri, value); in testBluetoothDevicesTable()
130 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, in testBluetoothDevicesTable()
148 provider.update(uri, value, "name=\"" + insertName + "\"", null); in testBluetoothDevicesTable()
149 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, in testBluetoothDevicesTable()
160 provider.delete(uri, "name=\"" + updateName + "\"", null); in testBluetoothDevicesTable()
161 cursor = provider.query(uri, BLUETOOTH_DEVICES_PROJECTION, "_id = " + Id, null, null); in testBluetoothDevicesTable()
200 Uri uri = Uri.parse("content://settings/" + table); in tryBadTableAccess() local
206 cr.insert(uri, cv); in tryBadTableAccess()
[all …]
DMediaStore_Audio_GenresTest.java74 Uri uri = mContentResolver.insert(Genres.EXTERNAL_CONTENT_URI, values); in testStoreAudioGenresExternal() local
75 assertNotNull(uri); in testStoreAudioGenresExternal()
79 Cursor c = mContentResolver.query(uri, null, null, null, null); in testStoreAudioGenresExternal()
89 assertEquals(1, mContentResolver.update(uri, values, null, null)); in testStoreAudioGenresExternal()
90 c = mContentResolver.query(uri, null, null, null, null); in testStoreAudioGenresExternal()
95 assertEquals(1, mContentResolver.delete(uri, null, null)); in testStoreAudioGenresExternal()
103 Uri uri = mContentResolver.insert(Genres.INTERNAL_CONTENT_URI, values); in testStoreAudioGenresInternal() local
104 assertNull(uri); in testStoreAudioGenresInternal()
DMediaStore_Audio_PlaylistsTest.java83 Uri uri = mContentResolver.insert(Playlists.EXTERNAL_CONTENT_URI, values); in testStoreAudioPlaylistsExternal() local
84 assertNotNull(uri); in testStoreAudioPlaylistsExternal()
88 Cursor c = mContentResolver.query(uri, null, null, null, null); in testStoreAudioPlaylistsExternal()
106 assertEquals(1, mContentResolver.update(uri, values, null, null)); in testStoreAudioPlaylistsExternal()
107 c = mContentResolver.query(uri, null, null, null, null); in testStoreAudioPlaylistsExternal()
117 assertEquals(1, mContentResolver.delete(uri, null, null)); in testStoreAudioPlaylistsExternal()
129 Uri uri = mContentResolver.insert(Playlists.INTERNAL_CONTENT_URI, values); in testStoreAudioPlaylistsInternal() local
130 assertNotNull(uri); in testStoreAudioPlaylistsInternal()
132 uri.toString())); in testStoreAudioPlaylistsInternal()
/cts/tests/appsecurity-tests/test-apps/PermissionDeclareApp/src/com/android/cts/permissiondeclareapp/
DPermissionContentProviderGranting.java30 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
36 public String getType(Uri uri) { in getType() argument
41 public Uri insert(Uri uri, ContentValues values) { in insert() argument
51 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
57 public int update(Uri uri, ContentValues values, String selection, in update() argument
DPermissionContentProvider.java30 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
36 public String getType(Uri uri) { in getType() argument
41 public Uri insert(Uri uri, ContentValues values) { in insert() argument
51 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
57 public int update(Uri uri, ContentValues values, String selection, in update() argument
DPermissionContentProviderPath.java14 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
20 public String getType(Uri uri) { in getType() argument
25 public Uri insert(Uri uri, ContentValues values) { in insert() argument
35 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
41 public int update(Uri uri, ContentValues values, String selection, in update() argument
DPrivateContentProviderGranting.java30 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
36 public String getType(Uri uri) { in getType() argument
41 public Uri insert(Uri uri, ContentValues values) { in insert() argument
51 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
57 public int update(Uri uri, ContentValues values, String selection, in update() argument
DPrivateContentProvider.java30 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument
36 public String getType(Uri uri) { in getType() argument
41 public Uri insert(Uri uri, ContentValues values) { in insert() argument
51 public Cursor query(Uri uri, String[] projection, String selection, in query() argument
57 public int update(Uri uri, ContentValues values, String selection, in update() 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/tools/tradefed-host/src/com/android/cts/tradefed/testtype/
DTestPlan.java60 public void startElement(String uri, String localName, String name, Attributes attributes) in startElement() argument
122 public TestFilter getExcludedTestFilter(String uri) { in getExcludedTestFilter() argument
123 return mUriExcludedTestsMap.get(uri); in getExcludedTestFilter()
130 public void addPackage(String uri) { in addPackage() argument
131 mUriExcludedTestsMap.put(uri, new TestFilter()); in addPackage()
146 public void addExcludedTest(String uri, TestIdentifier testToExclude) { in addExcludedTest() argument
147 TestFilter filter = mUriExcludedTestsMap.get(uri); in addExcludedTest()
151 throw new IllegalArgumentException(String.format("Could not find package %s", uri)); in addExcludedTest()
159 public void addExcludedTests(String uri, Collection<TestIdentifier> excludedTests) { in addExcludedTests() argument
160 TestFilter filter = mUriExcludedTestsMap.get(uri); in addExcludedTests()
[all …]
DITestPlan.java47 public TestFilter getExcludedTestFilter(String uri); in getExcludedTestFilter() argument
53 public void addPackage(String uri); in addPackage() argument
61 public void addExcludedTest(String uri, TestIdentifier testToExclude); in addExcludedTest() argument
69 public void addExcludedTests(String uri, Collection<TestIdentifier> excludedTests); in addExcludedTests() argument
/cts/apps/CtsVerifier/src/com/android/cts/verifier/streamquality/
DStreamingVideoActivity.java55 public final String uri; field in StreamingVideoActivity.Stream
57 public Stream(String name, String code, String uri) { in Stream() argument
60 this.uri = uri; in Stream()
73 && uri.equals(stream.uri); in equals()
79 return name.hashCode() ^ uri.hashCode() ^ code.hashCode(); in hashCode()
/cts/tests/src/android/provider/cts/
DMediaStoreAudioTestHelper.java53 Uri uri = contentResolver.insert(Media.INTERNAL_CONTENT_URI, getContentValues(true)); in insertToInternal() local
54 Assert.assertNotNull(uri); in insertToInternal()
55 return uri; in insertToInternal()
59 Uri uri = contentResolver.insert(Media.EXTERNAL_CONTENT_URI, getContentValues(false)); in insertToExternal() local
60 Assert.assertNotNull(uri); in insertToExternal()
61 return uri; in insertToExternal()
64 public int delete(ContentResolver contentResolver, Uri uri) { in delete() argument
65 return contentResolver.delete(uri, null, null); in delete()
/cts/tools/cts-api-coverage/src/com/android/cts/apicoverage/
DDexDepsXmlHandler.java49 public void startElement(String uri, String localName, String name, Attributes attributes) in startElement() argument
51 super.startElement(uri, localName, name, attributes); in startElement()
69 public void endElement(String uri, String localName, String name) throws SAXException { in endElement() argument
70 super.endElement(uri, localName, name); in endElement()
DCurrentXmlHandler.java48 public void startElement(String uri, String localName, String name, Attributes attributes) in startElement() argument
50 super.startElement(uri, localName, name, attributes); in startElement()
77 public void endElement(String uri, String localName, String name) throws SAXException { in endElement() argument
78 super.endElement(uri, localName, name); in endElement()

123