Home
last modified time | relevance | path

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

12345678910>>...41

/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/
DUriTest.java103 Uri uri = Uri.parse("http://localhost:42"); in testStringUri() local
104 assertEquals("localhost", uri.getHost()); in testStringUri()
105 assertEquals(42, uri.getPort()); in testStringUri()
107 uri = Uri.parse("http://bob@localhost:42"); in testStringUri()
108 assertEquals("bob", uri.getUserInfo()); in testStringUri()
109 assertEquals("localhost", uri.getHost()); in testStringUri()
110 assertEquals(42, uri.getPort()); in testStringUri()
112 uri = Uri.parse("http://bob%20lee@localhost:42"); in testStringUri()
113 assertEquals("bob lee", uri.getUserInfo()); in testStringUri()
114 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 …]
/packages/apps/Car/libs/car-apps-common/src/com/android/car/apps/common/
DUriUtils.java59 public static boolean isEmpty(@Nullable Uri uri) { in isEmpty() argument
60 return (uri == null || TextUtils.isEmpty(uri.toString())); in isEmpty()
111 Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + SCHEME_DELIMITER in getAndroidResourceUri() local
113 return uri; in getAndroidResourceUri()
119 public static boolean isAndroidResourceUri(Uri uri) { in isAndroidResourceUri() argument
120 return ContentResolver.SCHEME_ANDROID_RESOURCE.equals(uri.getScheme()); in isAndroidResourceUri()
128 Uri uri = Uri.parse(SCHEME_ACCOUNT_IMAGE + SCHEME_DELIMITER + accountName); in getAccountImageUri() local
129 return uri; in getAccountImageUri()
139 Uri uri = Uri.parse(SCHEME_ACCOUNT_IMAGE + SCHEME_DELIMITER + accountName); in getAccountImageUri() local
141 uri = uri.buildUpon().appendQueryParameter(ACCOUNT_IMAGE_CHANGE_NOTIFY_URI, in getAccountImageUri()
[all …]
/packages/providers/ContactsProvider/tests2/src/com/android/providers/contacts/tests2/
DAllUriTest.java294 private String[] getColumns(Uri uri) { in getColumns() argument
295 try (Cursor c = mResolver.query(uri, in getColumns()
305 private void checkQueryExecutable(Uri uri, in checkQueryExecutable() argument
309 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable()
314 addFailure("Query failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable()
318 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable()
323 addFailure("Query with cancel failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable()
328 uri.buildUpon().appendQueryParameter( in checkQueryExecutable()
334 addFailure("Query with limit failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable()
340 uri.buildUpon() in checkQueryExecutable()
[all …]
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/
DVoicemailProviderTest.java111 Uri uri = mResolver.insert(voicemailUri(), getTestVoicemailValues()); in testInsert() local
114 assertStoredValues(uri, getTestVoicemailValues()); in testInsert()
115 assertSelection(uri, getTestVoicemailValues(), Voicemails._ID, ContentUris.parseId(uri)); in testInsert()
118 assertLastModified(uri, 1000); in testInsert()
124 Uri uri = mResolver.insert(voicemailUri(), values); in testInsertReadMessageIsNotNew() local
132 Cursor c = mResolver.query(uri, projection, Voicemails.NEW + "=0", null, in testInsertReadMessageIsNotNew()
157 Uri uri = insertVoicemail(); in testFileContent() local
158 OutputStream out = mResolver.openOutputStream(uri); in testFileContent()
163 InputStream in = mResolver.openInputStream(uri); in testFileContent()
175 Uri uri = insertVoicemail(); in testUpdate() local
[all …]
/packages/apps/Contacts/tests/src/com/android/contacts/test/mocks/
DMockContentProvider.java71 public Query(Uri uri) { in Query() argument
72 mUri = uri; in Query()
136 public boolean equals(Uri uri, String[] projection, String selection, in equals() argument
139 if (mMatcher != null && mMatcher.match(uri) == UriMatcher.NO_MATCH) { in equals()
142 } else if (!uri.equals(mUri)) { in equals()
211 public TypeQuery(Uri uri, String type) { in TypeQuery() argument
212 mUri = uri; in TypeQuery()
229 public boolean equals(Uri uri) { in equals() argument
230 return getUri().equals(uri); in equals()
249 public Insert(Uri uri, ContentValues contentValues, Uri resultUri) { in Insert() argument
[all …]
/packages/apps/Messaging/src/com/android/messaging/util/
DAvatarUriUtil.java135 final Uri uri = avatarUris.get(i); in joinAvatarUriToGroup() local
136 Assert.notNull(uri); in joinAvatarUriToGroup()
137 Assert.isTrue(UriUtil.isLocalResourceUri(uri) || AvatarUriUtil.isAvatarUri(uri)); in joinAvatarUriToGroup()
138 builder.appendQueryParameter(PARAM_PARTICIPANT, uri.toString()); in joinAvatarUriToGroup()
267 public static boolean isAvatarUri(@NonNull final Uri uri) { in isAvatarUri() argument
268 Assert.notNull(uri); in isAvatarUri()
269 return uri != null && TextUtils.equals(SCHEME, uri.getScheme()) && in isAvatarUri()
270 TextUtils.equals(AUTHORITY, uri.getAuthority()); in isAvatarUri()
273 public static String getAvatarType(@NonNull final Uri uri) { in getAvatarType() argument
274 Assert.notNull(uri); in getAvatarType()
[all …]
DUriUtil.java72 public static String getFilePathFromUri(final Uri uri) { in getFilePathFromUri() argument
73 if (!isFileUri(uri)) { in getFilePathFromUri()
76 return uri.getPath(); in getFilePathFromUri()
82 public static boolean isLocalResourceUri(final Uri uri) { in isLocalResourceUri() argument
83 final String scheme = uri.getScheme(); in isLocalResourceUri()
92 public static boolean isBugleAppResource(final Uri uri) { in isBugleAppResource() argument
93 final String scheme = uri.getScheme(); in isBugleAppResource()
97 public static boolean isFileUri(final Uri uri) { in isFileUri() argument
98 return uri != null && TextUtils.equals(uri.getScheme(), ContentResolver.SCHEME_FILE); in isFileUri()
115 public static boolean isLocalUri(@NonNull final Uri uri) { in isLocalUri() argument
[all …]
/packages/apps/Messaging/src/com/android/messaging/datamodel/
DMessagingContentProvider.java106 final Uri uri = Uri.parse(CONTENT_AUTHORITY); in notifyEverythingChanged() local
109 cr.notifyChange(uri, null); in notifyEverythingChanged()
128 final Uri uri = buildConversationParticipantsUri(conversationId); in notifyParticipantsChanged() local
130 cr.notifyChange(uri, null); in notifyParticipantsChanged()
182 final Uri uri = buildConversationMessagesUri(conversationId); in notifyMessagesChanged() local
185 cr.notifyChange(uri, null); in notifyMessagesChanged()
202 final Uri uri = buildConversationMetadataUri(conversationId); in notifyConversationMetadataChanged() local
204 cr.notifyChange(uri, null); in notifyConversationMetadataChanged()
261 public Cursor query(final Uri uri, final String[] projection, String selection, in query() argument
275 final int match = sURIMatcher.match(uri); in query()
[all …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/
DVoicemailContentProvider.java123 protected int enforceReadPermissionInner(Uri uri, in enforceReadPermissionInner() argument
129 return super.enforceReadPermissionInner(uri, attributionSource); in enforceReadPermissionInner()
133 protected int enforceWritePermissionInner(Uri uri, in enforceWritePermissionInner() argument
139 return super.enforceWritePermissionInner(uri, attributionSource); in enforceWritePermissionInner()
168 public String getType(Uri uri) { in getType() argument
171 uriData = UriData.createUriData(uri); in getType()
180 public Uri insert(Uri uri, ContentValues values) { in insert() argument
182 Log.v(TAG, "insert: uri=" + uri + " values=[" + values + "]" + in insert()
186 UriData uriData = checkPermissionsAndCreateUriDataForWrite(uri, values); in insert()
191 public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] values) { in bulkInsert() argument
[all …]
DCallLogProvider.java360 public int bulkInsert(Uri uri, ContentValues[] values) { in bulkInsert() argument
367 return super.bulkInsert(uri, values); in bulkInsert()
375 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument
382 return queryInternal(uri, projection, selection, selectionArgs, sortOrder); in query()
388 private Cursor queryInternal(Uri uri, String[] projection, String selection, in queryInternal() argument
391 Log.v(TAG, "query: uri=" + uri + " projection=" + Arrays.toString(projection) + in queryInternal()
398 queryForTesting(uri); in queryInternal()
414 checkVoicemailPermissionAndAddRestriction(uri, selectionBuilder, true /*isQuery*/); in queryInternal()
417 final int match = sURIMatcher.match(uri); in queryInternal()
424 parseCallIdFromUri(uri))); in queryInternal()
[all …]
/packages/apps/Gallery2/src/com/android/photos/data/
DSQLiteContentProvider.java76 public abstract Uri insertInTransaction(Uri uri, ContentValues values, in insertInTransaction() argument
83 public abstract int updateInTransaction(Uri uri, ContentValues values, String selection, in updateInTransaction() argument
90 public abstract int deleteInTransaction(Uri uri, String selection, String[] selectionArgs, in deleteInTransaction() argument
97 protected void postNotifyUri(Uri uri) { in postNotifyUri() argument
99 mChangedUris.add(uri); in postNotifyUri()
103 public boolean isCallerSyncAdapter(Uri uri) { in isCallerSyncAdapter() argument
116 public Uri insert(Uri uri, ContentValues values) { in insert() argument
118 boolean callerIsSyncAdapter = isCallerSyncAdapter(uri); in insert()
124 result = insertInTransaction(uri, values, callerIsSyncAdapter); in insert()
132 result = insertInTransaction(uri, values, callerIsSyncAdapter); in insert()
[all …]
DPhotoProvider.java63 void notifyChange(Uri uri, boolean syncToNetwork); in notifyChange() argument
272 public int deleteInTransaction(Uri uri, String selection, String[] selectionArgs, in deleteInTransaction() argument
274 int match = matchUri(uri); in deleteInTransaction()
276 selectionArgs = addIdToSelectionArgs(match, uri, selectionArgs); in deleteInTransaction()
277 return deleteCascade(uri, match, selection, selectionArgs); in deleteInTransaction()
281 public String getType(Uri uri) { in getType() argument
282 Cursor cursor = query(uri, PROJECTION_MIME_TYPE, null, null, null); in getType()
292 public Uri insertInTransaction(Uri uri, ContentValues values, boolean callerIsSyncAdapter) { in insertInTransaction() argument
293 int match = matchUri(uri); in insertInTransaction()
295 String table = getTableFromMatch(match, uri); in insertInTransaction()
[all …]
/packages/providers/MediaProvider/tests/client/src/com/android/providers/media/client/
DDelegatorTest.java70 final Uri uri = createAudio(); in testPushAllowed() local
72 assertEquals(InstrumentationRegistry.getTargetContext().getPackageName(), getOwner(uri)); in testPushAllowed()
76 mResolver.update(uri, values, null); in testPushAllowed()
78 assertEquals(PERMISSIONLESS_APP, getOwner(uri)); in testPushAllowed()
86 final Uri uri = createAudio(); in testOrphanedAllowed() local
87 clearOwner(uri); in testOrphanedAllowed()
89 assertEquals(null, getOwner(uri)); in testOrphanedAllowed()
93 mResolver.update(uri, values, null); in testOrphanedAllowed()
95 assertEquals(PERMISSIONLESS_APP, getOwner(uri)); in testOrphanedAllowed()
103 final Uri uri = createAudio(); in testPullBlocked() local
[all …]
/packages/services/Telephony/src/com/android/phone/
DSimPhonebookProvider.java176 uri -> resolver.notifyChange(uri, null)); in onCreate()
238 public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable Bundle queryArgs, in query() argument
246 switch (URI_MATCHER.match(uri)) { in query()
250 return queryElementaryFilesItem(PhonebookArgs.forElementaryFilesItem(uri), in query()
253 return querySimRecords(PhonebookArgs.forSimRecords(uri, queryArgs), projection); in query()
255 return querySimRecordsItem(PhonebookArgs.forSimRecordsItem(uri, queryArgs), in query()
258 throw new IllegalArgumentException("Unsupported Uri " + uri); in query()
264 public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, in query() argument
272 public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, in query() argument
402 Rlog.w(TAG, "Column " + column + " is unsupported for " + args.uri); in querySimRecords()
[all …]
/packages/apps/Bluetooth/lib/mapapi/com/android/bluetooth/mapapi/
DBluetoothMapEmailProvider.java127 void readDataFromPipe(ParcelFileDescriptor input, Uri uri, String mimeType, Bundle opts, in readDataFromPipe() argument
137 public void readDataFromPipe(ParcelFileDescriptor input, Uri uri, String mimeType, in readDataFromPipe() argument
139 Log.v(TAG, "readDataFromPipe(): uri=" + uri.toString()); in readDataFromPipe()
143 long messageId = Long.valueOf(uri.getLastPathSegment()); in readDataFromPipe()
144 long accountId = Long.valueOf(getAccountId(uri)); in readDataFromPipe()
183 public void writeDataToPipe(ParcelFileDescriptor output, Uri uri, String mimeType, in writeDataToPipe() argument
186 Log.d(TAG, "writeDataToPipe(): uri=" + uri.toString() + " - getLastPathSegment() = " in writeDataToPipe()
187 + uri.getLastPathSegment()); in writeDataToPipe()
197 List<String> segments = uri.getPathSegments(); in writeDataToPipe()
199 long accountId = Long.parseLong(getAccountId(uri)); in writeDataToPipe()
[all …]
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/
DDictionaryProvider.java166 private static int matchUri(final Uri uri) { in matchUri() argument
168 final String protocolVersionArg = uri.getQueryParameter(QUERY_PARAMETER_PROTOCOL_VERSION); in matchUri()
171 case 1: return sUriMatcherV1.match(uri); in matchUri()
172 case 2: return sUriMatcherV2.match(uri); in matchUri()
177 private static String getClientId(final Uri uri) { in getClientId() argument
179 final String protocolVersionArg = uri.getQueryParameter(QUERY_PARAMETER_PROTOCOL_VERSION); in getClientId()
183 case 2: return uri.getPathSegments().get(0); in getClientId()
197 public String getType(final Uri uri) { in getType() argument
198 PrivateLog.log("Asked for type of : " + uri); in getType()
199 final int match = matchUri(uri); in getType()
[all …]
/packages/apps/Camera2/src/com/android/camera/
DStorage.java165 Uri uri = null; in addImageToMediaStore() local
167 uri = resolver.insert(Media.EXTERNAL_CONTENT_URI, values); in addImageToMediaStore()
168 writeBitmap(uri, exif, bitmap, resolver); in addImageToMediaStore()
176 if (uri != null) { in addImageToMediaStore()
177 resolver.delete(uri, null, null); in addImageToMediaStore()
180 return uri; in addImageToMediaStore()
183 private void writeBitmap(Uri uri, ExifInterface exif, Bitmap bitmap, ContentResolver resolver) in writeBitmap() argument
185 OutputStream os = resolver.openOutputStream(uri); in writeBitmap()
195 resolver.update(uri, publishValues, null, null); in writeBitmap()
196 Log.i(TAG, "Image with uri: " + uri + " was published to the MediaStore"); in writeBitmap()
[all …]
/packages/apps/Camera2/src/com/android/camera/session/
DCaptureSessionManagerImpl.java69 public void notifyTaskQueued(final Uri uri) { in notifyTaskQueued() argument
75 listener.onSessionQueued(uri); in notifyTaskQueued()
87 public void notifyTaskDone(final Uri uri) { in notifyTaskDone() argument
93 listener.onSessionDone(uri); in notifyTaskDone()
96 finalizeSession(uri); in notifyTaskDone()
106 public void notifyTaskFailed(final Uri uri, final int failureMessageId, in notifyTaskFailed() argument
113 listener.onSessionFailed(uri, failureMessageId, removeFromFilmstrip); in notifyTaskFailed()
116 finalizeSession(uri); in notifyTaskFailed()
122 public void notifyTaskCanceled(final Uri uri) { in notifyTaskCanceled() argument
128 listener.onSessionCanceled(uri); in notifyTaskCanceled()
[all …]
/packages/apps/Messaging/tests/src/com/android/messaging/
DFakeContentProvider.java39 private final String uri; field in FakeContentProvider.ContentOverride
45 ContentOverride(final String uri, final String where, final String args, in ContentOverride() argument
47 this.uri = uri; in ContentOverride()
54 boolean match(final String uri, final String where, final String[] args) { in match() argument
55 if (!this.uri.equals(uri) || !TextUtils.equals(this.where, where)) { in match()
73 public FakeContentProvider(final Context context, final Uri uri, final boolean canDelegate) { in FakeContentProvider() argument
75 mUri = uri; in FakeContentProvider()
83 providerInfo.authority = uri.getAuthority(); in FakeContentProvider()
88 public void addOverrideData(final Uri uri, final String where, final String args, in addOverrideData() argument
90 mOverrides.add(new ContentOverride(uri.toString(), where, args, columns, data)); in addOverrideData()
[all …]
/packages/services/Car/tests/BugReportApp/src/com/android/car/bugreport/
DBugStorageProvider.java244 @NonNull Uri uri, in query()
249 return query(uri, projection, selection, selectionArgs, sortOrder, null); in query()
255 @NonNull Uri uri, in query()
263 switch (mUriMatcher.match(uri)) { in query()
276 selectionArgs = new String[]{ uri.getLastPathSegment() }; in query()
279 throw new IllegalArgumentException("Unknown URL " + uri); in query()
284 cursor.setNotificationUri(getContext().getContentResolver(), uri); in query() local
290 public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { in insert() argument
296 switch (mUriMatcher.match(uri)) { in insert()
301 throw new IllegalArgumentException("unknown uri" + uri); in insert()
[all …]
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/
DBluetoothOppUtility.java76 public static boolean isBluetoothShareUri(Uri uri) { in isBluetoothShareUri() argument
77 return uri.toString().startsWith(BluetoothShare.CONTENT_URI.toString()); in isBluetoothShareUri()
80 public static BluetoothOppTransferInfo queryRecord(Context context, Uri uri) { in queryRecord() argument
82 Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); in queryRecord()
91 Log.v(TAG, "BluetoothOppManager Error: not got data from db for uri:" + uri); in queryRecord()
182 Long timeStamp, Uri uri) { in openReceivedFile() argument
188 if (!isBluetoothShareUri(uri)) { in openReceivedFile()
194 Cursor metadataCursor = context.getContentResolver().query(uri, new String[]{ in openReceivedFile()
221 Log.d(TAG, "This uri will be deleted: " + uri); in openReceivedFile()
223 context.getContentResolver().delete(uri, null, null); in openReceivedFile()
[all …]
/packages/apps/Dialer/java/com/android/dialer/phonelookup/database/
DPhoneLookupHistoryContentProvider.java92 @NonNull Uri uri, in query()
100 @UriType int uriType = uriType(uri); in query()
107 Uri.decode(uri.getQueryParameter(PhoneLookupHistory.NUMBER_QUERY_PARAM)))); in query()
120 throw new IllegalArgumentException("Unknown uri: " + uri); in query()
126 public String getType(@NonNull Uri uri) { in getType() argument
132 public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { in insert() argument
137 @UriType int uriType = uriType(uri); in insert()
146 Uri.decode(uri.getQueryParameter(PhoneLookupHistory.NUMBER_QUERY_PARAM)); in insert()
160 throw new IllegalArgumentException("Unknown uri: " + uri); in insert()
182 @NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) { in delete()
[all …]
/packages/providers/MediaProvider/src/com/android/providers/media/
DMediaProvider.java580 Uri uri = intent.getData();
581 String pkg = uri != null ? uri.getSchemeSpecificPart() : null;
604 private final void updateQuotaTypeForUri(@NonNull Uri uri, int mediaType) { in updateQuotaTypeForUri() argument
608 file = queryForDataFile(uri, null); in updateQuotaTypeForUri()
624 Log.w(TAG, "Failed to update quota for uri: " + uri, e); in updateQuotaTypeForUri()
723 acceptWithExpansion((uri) -> {
724 getContext().revokeUriPermission(uri, ~0);
1678 public Uri canonicalize(Uri uri) { in canonicalize() argument
1680 final int match = matchUri(uri, allowHidden); in canonicalize()
1683 if ("1".equals(uri.getQueryParameter(CANONICAL))) { in canonicalize()
[all …]
/packages/apps/TV/src/com/android/tv/util/
DTvProviderUtils.java68 public static synchronized boolean checkSeriesIdColumn(Context context, Uri uri) { in checkSeriesIdColumn() argument
76 return (Utils.isRecordedProgramsUri(uri) in checkSeriesIdColumn()
77 && checkRecordedProgramTableSeriesIdColumn(context, uri)) in checkSeriesIdColumn()
78 || (Utils.isProgramsUri(uri) && checkProgramTableSeriesIdColumn(context, uri)); in checkSeriesIdColumn()
82 private static synchronized boolean checkProgramTableSeriesIdColumn(Context context, Uri uri) { in checkProgramTableSeriesIdColumn() argument
84 if (getExistingColumns(context, uri).contains(EXTRA_PROGRAM_COLUMN_SERIES_ID)) { in checkProgramTableSeriesIdColumn()
86 } else if (addColumnToTable(context, uri, EXTRA_PROGRAM_COLUMN_SERIES_ID)) { in checkProgramTableSeriesIdColumn()
95 Context context, Uri uri) { in checkRecordedProgramTableSeriesIdColumn() argument
97 if (getExistingColumns(context, uri).contains(EXTRA_PROGRAM_COLUMN_SERIES_ID)) { in checkRecordedProgramTableSeriesIdColumn()
99 } else if (addColumnToTable(context, uri, EXTRA_PROGRAM_COLUMN_SERIES_ID)) { in checkRecordedProgramTableSeriesIdColumn()
[all …]

12345678910>>...41