/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/ |
D | UriTest.java | 106 Uri uri = Uri.parse("http://localhost:42"); in testStringUri() local 107 assertEquals("localhost", uri.getHost()); in testStringUri() 108 assertEquals(42, uri.getPort()); in testStringUri() 110 uri = Uri.parse("http://bob@localhost:42"); in testStringUri() 111 assertEquals("bob", uri.getUserInfo()); in testStringUri() 112 assertEquals("localhost", uri.getHost()); in testStringUri() 113 assertEquals(42, uri.getPort()); in testStringUri() 115 uri = Uri.parse("http://bob%20lee@localhost:42"); in testStringUri() 116 assertEquals("bob lee", uri.getUserInfo()); in testStringUri() 117 assertEquals("bob%20lee", uri.getEncodedUserInfo()); in testStringUri() [all …]
|
D | Uri_BuilderTest.java | 25 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/modules/Wifi/framework/tests/src/android/net/wifi/ |
D | WifiUriParserTest.java | 46 UriParserResults uri, in verifyZxParsing() argument 51 assertNotNull(uri); in verifyZxParsing() 52 WifiConfiguration config = uri.getWifiConfiguration(); in verifyZxParsing() 62 assertNull(uri.getPublicKey()); in verifyZxParsing() 63 assertNull(uri.getInformation()); in verifyZxParsing() 64 assertEquals(UriParserResults.URI_SCHEME_ZXING_WIFI_NETWORK_CONFIG, uri.getUriScheme()); in verifyZxParsing() 76 UriParserResults uri = WifiUriParser.parseUri("WIFI:S:testAbC;T:nopass"); in testZxParsing() local 78 uri, in testZxParsing() 84 uri = WifiUriParser.parseUri("WIFI:S:testAbC; T:nopass"); in testZxParsing() 86 uri, in testZxParsing() [all …]
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/batteryusage/ |
D | BatteryUsageContentProvider.java | 130 @NonNull Uri uri, in query() 135 switch (sUriMatcher.match(uri)) { in query() 137 return getBatteryStates(uri); in query() 139 return getAppUsageEvents(uri); in query() 141 return getAppUsageLatestTimestamp(uri); in query() 143 return getBatteryEvents(uri); in query() 145 return getLastFullChargeTimestamp(uri); in query() 147 return getBatteryStateLatestTimestamp(uri); in query() 149 return getBatteryUsageSlots(uri); in query() 151 throw new IllegalArgumentException("unknown URI: " + uri); in query() [all …]
|
/packages/providers/MediaProvider/src/com/android/providers/media/ |
D | PickerUriResolver.java | 130 public ParcelFileDescriptor openFile(Uri uri, String mode, CancellationSignal signal, in openFile() argument 135 + " Uri: " + uri); in openFile() 138 checkPermissionForRequireOriginalQueryParam(uri, localCallingIdentity); in openFile() 139 checkUriPermission(uri, localCallingIdentity.pid, localCallingIdentity.uid); in openFile() 143 resolver = getContentResolverForUserId(uri); in openFile() 146 Log.e(TAG, "No item at " + uri, e); in openFile() 147 throw new FileNotFoundException("No item at " + uri); in openFile() 149 if (canHandleUriInUser(uri)) { in openFile() 150 return openPickerFile(uri); in openFile() 152 return resolver.openFile(uri, mode, signal); in openFile() [all …]
|
/packages/apps/Car/Settings/src/com/android/car/settings/qc/ |
D | SettingsQCProvider.java | 53 public QCItem onBind(Uri uri) { in onBind() argument 54 if (SettingsQCRegistry.isValidUri(uri)) { in onBind() 56 return getQCItemFromUri(context, uri).getQCItem(); in onBind() 58 throw new IllegalArgumentException("Unrecognized uri: " + uri); in onBind() 62 public void onSubscribed(Uri uri) { in onSubscribed() argument 63 if (SettingsQCRegistry.isValidUri(uri)) { in onSubscribed() 65 SettingsQCItem qcItem = getQCItemFromUri(context, uri); in onSubscribed() 66 ThreadUtils.postOnMainThread(() -> startBackgroundWorker(qcItem, uri)); in onSubscribed() 71 public void onUnsubscribed(Uri uri) { in onUnsubscribed() argument 72 ThreadUtils.postOnMainThread(() -> stopBackgroundWorker(uri)); in onUnsubscribed() [all …]
|
/packages/modules/IntentResolver/tests/unit/src/com/android/intentresolver/contentpreview/ |
D | PreviewDataProviderTest.kt | 79 val uri = Uri.parse("content://org.pkg.app/notes.txt") in test_sendSingleTextFileWithoutPreview_resolvesToFilePreviewUi() constant 82 putExtra(Intent.EXTRA_STREAM, uri) in test_sendSingleTextFileWithoutPreview_resolvesToFilePreviewUi() 85 whenever(contentResolver.getType(uri)).thenReturn("text/plain") in test_sendSingleTextFileWithoutPreview_resolvesToFilePreviewUi() 90 assertThat(testSubject.firstFileInfo?.uri).isEqualTo(uri) in test_sendSingleTextFileWithoutPreview_resolvesToFilePreviewUi() 105 val uri = Uri.parse("content://org.pkg.app/image.png") in test_sendSingleImage_resolvesToImagePreviewUi() constant 106 val targetIntent = Intent(Intent.ACTION_SEND).apply { putExtra(Intent.EXTRA_STREAM, uri) } in test_sendSingleImage_resolvesToImagePreviewUi() 107 whenever(contentResolver.getType(uri)).thenReturn("image/png") in test_sendSingleImage_resolvesToImagePreviewUi() 112 assertThat(testSubject.firstFileInfo?.uri).isEqualTo(uri) in test_sendSingleImage_resolvesToImagePreviewUi() 113 assertThat(testSubject.firstFileInfo?.previewUri).isEqualTo(uri) in test_sendSingleImage_resolvesToImagePreviewUi() 119 val uri = Uri.parse("content://org.pkg.app/paper.pdf") in test_sendSingleNonImage_resolvesToFilePreviewUi() constant [all …]
|
D | UriMetadataReaderTest.kt | 33 private val uri = Uri.parse("content://org.pkg.app/item") in <lambda>() constant 39 whenever(contentResolver.getType(uri)).thenReturn(mimeType) in <lambda>() 42 testSubject.getMetadata(uri).let { fileInfo -> in <lambda>() 43 assertWithMessage("Wrong uri").that(fileInfo.uri).isEqualTo(uri) in <lambda>() 45 assertWithMessage("Wrong preview URI").that(fileInfo.previewUri).isEqualTo(uri) in <lambda>() 53 whenever(contentResolver.getType(uri)).thenReturn(mimeType) in <lambda>() 54 whenever(contentResolver.getStreamTypes(eq(uri), any())).thenReturn(arrayOf(imageType)) in <lambda>() 57 testSubject.getMetadata(uri).let { fileInfo -> in <lambda>() 58 assertWithMessage("Wrong uri").that(fileInfo.uri).isEqualTo(uri) in <lambda>() 60 assertWithMessage("Wrong preview URI").that(fileInfo.previewUri).isEqualTo(uri) in <lambda>() [all …]
|
/packages/apps/Car/systemlibs/car-qc-lib/src/com/android/car/qc/provider/ |
D | BaseQCProvider.java | 66 Uri uri = getUriWithoutUserId(validateIncomingUriOrNull( in call() local 70 QCItem item = handleBind(uri); in call() 75 handleSubscribe(uri); in call() 78 handleUnsubscribe(uri); in call() 81 handleDestroy(uri); in call() 88 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 94 public String getType(Uri uri) { in getType() argument 99 public Uri insert(Uri uri, ContentValues values) { in insert() argument 104 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument 109 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/ |
D | VoicemailProviderTest.java | 112 Uri uri = mResolver.insert(voicemailUri(), getTestVoicemailValues()); in testInsert() local 115 assertStoredValues(uri, getTestVoicemailValues()); in testInsert() 116 assertSelection(uri, getTestVoicemailValues(), Voicemails._ID, ContentUris.parseId(uri)); in testInsert() 119 assertLastModified(uri, 1000); in testInsert() 125 Uri uri = mResolver.insert(voicemailUri(), values); in testInsertReadMessageIsNotNew() local 133 Cursor c = mResolver.query(uri, projection, Voicemails.NEW + "=0", null, in testInsertReadMessageIsNotNew() 158 Uri uri = insertVoicemail(); in testFileContent() local 159 OutputStream out = mResolver.openOutputStream(uri); in testFileContent() 164 InputStream in = mResolver.openInputStream(uri); in testFileContent() 176 Uri uri = insertVoicemail(); in testUpdate() local [all …]
|
/packages/providers/MediaProvider/tests/client/src/com/android/providers/media/client/ |
D | DelegatorTest.java | 70 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/apps/Messaging/src/com/android/messaging/util/ |
D | AvatarUriUtil.java | 135 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 …]
|
D | UriUtil.java | 74 public static String getFilePathFromUri(final Uri uri) { in getFilePathFromUri() argument 75 if (!isFileUri(uri)) { in getFilePathFromUri() 78 return uri.getPath(); in getFilePathFromUri() 84 public static boolean isLocalResourceUri(final Uri uri) { in isLocalResourceUri() argument 85 final String scheme = uri.getScheme(); in isLocalResourceUri() 94 public static boolean isBugleAppResource(final Uri uri) { in isBugleAppResource() argument 95 final String scheme = uri.getScheme(); in isBugleAppResource() 100 public static boolean isFileUri(final Uri uri) { in isFileUri() argument 101 return uri != null && in isFileUri() 102 uri.getScheme() != null && in isFileUri() [all …]
|
/packages/modules/IntentResolver/java/src/com/android/intentresolver/contentpreview/ |
D | UriMetadataReader.kt | 33 fun getMetadata(uri: Uri): FileInfo in <lambda>() 34 fun readPreviewSize(uri: Uri): Size? = null in <lambda>() 43 override fun getMetadata(uri: Uri): FileInfo { in getMetadata() 44 val builder = FileInfo.Builder(uri) in getMetadata() 45 val mimeType = contentResolver.getTypeSafe(uri) in getMetadata() 49 contentResolver.supportsImageType(uri) || in getMetadata() 50 contentResolver.supportsThumbnail(uri) in getMetadata() 52 builder.withPreviewUri(uri) in getMetadata() 55 val previewUri = contentResolver.readPreviewUri(uri) in getMetadata() 62 override fun readPreviewSize(uri: Uri): Size? = contentResolver.readPreviewSize(uri) in readPreviewSize() [all …]
|
/packages/apps/Gallery2/src/com/android/photos/data/ |
D | SQLiteContentProvider.java | 76 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 …]
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/ |
D | MessagingContentProvider.java | 106 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/apps/Messaging/tests/src/com/android/messaging/ |
D | FakeContentProvider.java | 39 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/apps/Contacts/tests/src/com/android/contacts/test/mocks/ |
D | MockContentProvider.java | 71 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/Camera2/src/com/android/camera/session/ |
D | CaptureSessionManagerImpl.java | 69 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/providers/ContactsProvider/src/com/android/providers/contacts/ |
D | VoicemailContentProvider.java | 123 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 …]
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/media/ |
D | UriImageRequestDescriptor.java | 24 public final Uri uri; field in UriImageRequestDescriptor 27 public UriImageRequestDescriptor(final Uri uri) { in UriImageRequestDescriptor() argument 28 this(uri, UriImageRequest.UNSPECIFIED_SIZE, UriImageRequest.UNSPECIFIED_SIZE, false, false, in UriImageRequestDescriptor() 32 public UriImageRequestDescriptor(final Uri uri, final int desiredWidth, final int desiredHeight) in UriImageRequestDescriptor() argument 34 this(uri, desiredWidth, desiredHeight, false, false, false, 0, 0); in UriImageRequestDescriptor() 37 public UriImageRequestDescriptor(final Uri uri, final int desiredWidth, final int desiredHeight, in UriImageRequestDescriptor() argument 40 this(uri, desiredWidth, desiredHeight, false, in UriImageRequestDescriptor() 44 public UriImageRequestDescriptor(final Uri uri, final int desiredWidth, in UriImageRequestDescriptor() argument 47 this(uri, desiredWidth, desiredHeight, UriImageRequest.UNSPECIFIED_SIZE, in UriImageRequestDescriptor() 58 public UriImageRequestDescriptor(final Uri uri, final int desiredWidth, in UriImageRequestDescriptor() argument [all …]
|
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/accessories/ |
D | ConnectedDevicesSliceUtils.java | 53 static String getDeviceAddr(Uri uri) { in getDeviceAddr() argument 54 if (uri.getPathSegments().size() >= 2) { in getDeviceAddr() 55 return uri.getPathSegments().get(1).split(" ")[0]; in getDeviceAddr() 60 static boolean isGeneralPath(Uri uri) { in isGeneralPath() argument 61 return GENERAL_PATH.equals(getFirstSegment(uri)); in isGeneralPath() 64 static boolean isBluetoothDevicePath(Uri uri) { in isBluetoothDevicePath() argument 65 return BLUETOOTH_DEVICE_PATH.equals(getFirstSegment(uri)); in isBluetoothDevicePath() 68 static boolean isFindMyRemotePath(Uri uri) { in isFindMyRemotePath() argument 69 return FIND_MY_REMOTE_PATH.equals(getFirstSegment(uri)); in isFindMyRemotePath() 73 static boolean isSliceProviderValid(Context context, String uri) { in isSliceProviderValid() argument [all …]
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/ |
D | WebAddresses.java | 40 public static Optional<Uri> topPrivateDomainAndScheme(Uri uri) { in topPrivateDomainAndScheme() argument 41 return domainAndScheme(uri, false); in topPrivateDomainAndScheme() 51 public static Optional<Uri> originAndScheme(Uri uri) { in originAndScheme() argument 52 return domainAndScheme(uri, true); in originAndScheme() 63 private static Optional<Uri> domainAndScheme(Uri uri, boolean useOrigin) { in domainAndScheme() argument 64 String scheme = uri.getScheme(); in domainAndScheme() 65 String host = uri.getHost(); in domainAndScheme() 66 int port = uri.getPort(); in domainAndScheme() 74 if (isLocalhost(uri)) { in domainAndScheme() 100 public static boolean isLocalhost(Uri uri) { in isLocalhost() argument [all …]
|
/packages/apps/Camera2/src/com/android/camera/ |
D | Storage.java | 165 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/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/ |
D | DictionaryProvider.java | 166 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 …]
|