Lines Matching refs:uri

404      * @param uri The URI, using the content:// scheme, for the content to
420 public final Cursor query(Uri uri, String[] projection,
422 return query(uri, projection, selection, selectionArgs, sortOrder, null);
440 * @param uri The URI, using the content:// scheme, for the content to
459 public final Cursor query(final Uri uri, String[] projection,
462 IContentProvider unstableProvider = acquireUnstableProvider(uri);
478 qCursor = unstableProvider.query(mPackageName, uri, projection,
485 stableProvider = acquireProvider(uri);
489 qCursor = stableProvider.query(mPackageName, uri, projection,
499 maybeLogQueryToEventLog(durationMillis, uri, projection, selection, sortOrder);
503 stableProvider != null ? stableProvider : acquireProvider(uri));
623 * @param uri The desired URI.
628 public final InputStream openInputStream(Uri uri)
630 String scheme = uri.getScheme();
634 OpenResourceIdResult r = getResourceId(uri);
639 throw new FileNotFoundException("Resource does not exist: " + uri);
644 return new FileInputStream(uri.getPath());
646 AssetFileDescriptor fd = openAssetFileDescriptor(uri, "r", null);
657 * openOutputStream(uri, "w")}.
660 public final OutputStream openOutputStream(Uri uri)
662 return openOutputStream(uri, "w");
678 * @param uri The desired URI.
684 public final OutputStream openOutputStream(Uri uri, String mode)
686 AssetFileDescriptor fd = openAssetFileDescriptor(uri, mode, null);
722 * @param uri The desired URI to open.
731 public final ParcelFileDescriptor openFileDescriptor(Uri uri, String mode)
733 return openFileDescriptor(uri, mode, null);
764 * @param uri The desired URI to open.
776 public final ParcelFileDescriptor openFileDescriptor(Uri uri,
778 AssetFileDescriptor afd = openAssetFileDescriptor(uri, mode, cancellationSignal);
819 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/" + R.raw.my_resource");</pre>
829 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/raw/my_resource");</pre>
838 * @param uri The desired URI to open.
846 public final AssetFileDescriptor openAssetFileDescriptor(Uri uri, String mode)
848 return openAssetFileDescriptor(uri, mode, null);
872 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/" + R.raw.my_resource");</pre>
882 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/raw/my_resource");</pre>
891 * @param uri The desired URI to open.
902 public final AssetFileDescriptor openAssetFileDescriptor(Uri uri,
904 String scheme = uri.getScheme();
907 throw new FileNotFoundException("Can't write resources: " + uri);
909 OpenResourceIdResult r = getResourceId(uri);
913 throw new FileNotFoundException("Resource does not exist: " + uri);
917 new File(uri.getPath()), ParcelFileDescriptor.parseMode(mode));
921 return openTypedAssetFileDescriptor(uri, "*/*", null, cancellationSignal);
923 IContentProvider unstableProvider = acquireUnstableProvider(uri);
925 throw new FileNotFoundException("No content provider: " + uri);
940 mPackageName, uri, mode, remoteCancellationSignal);
950 stableProvider = acquireProvider(uri);
952 throw new FileNotFoundException("No content provider: " + uri);
955 mPackageName, uri, mode, remoteCancellationSignal);
963 stableProvider = acquireProvider(uri);
979 "Failed opening content provider: " + uri);
1011 * @param uri The desired URI to open.
1026 Uri uri, String mimeType, Bundle opts) throws FileNotFoundException {
1027 return openTypedAssetFileDescriptor(uri, mimeType, opts, null);
1044 * @param uri The desired URI to open.
1061 public final AssetFileDescriptor openTypedAssetFileDescriptor(Uri uri,
1064 IContentProvider unstableProvider = acquireUnstableProvider(uri);
1066 throw new FileNotFoundException("No content provider: " + uri);
1081 mPackageName, uri, mimeType, opts, remoteCancellationSignal);
1091 stableProvider = acquireProvider(uri);
1093 throw new FileNotFoundException("No content provider: " + uri);
1096 mPackageName, uri, mimeType, opts, remoteCancellationSignal);
1104 stableProvider = acquireProvider(uri);
1120 "Failed opening content provider: " + uri);
1151 public OpenResourceIdResult getResourceId(Uri uri) throws FileNotFoundException {
1152 String authority = uri.getAuthority();
1155 throw new FileNotFoundException("No authority: " + uri);
1160 throw new FileNotFoundException("No package found for authority: " + uri);
1163 List<String> path = uri.getPathSegments();
1165 throw new FileNotFoundException("No path: " + uri);
1173 throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
1178 throw new FileNotFoundException("More than two path segments: " + uri);
1181 throw new FileNotFoundException("No resource found for: " + uri);
1317 * @param uri The URI to modify.
1323 * @throws NullPointerException if uri or values are null
1325 public final int update(Uri uri, ContentValues values, String where,
1327 IContentProvider provider = acquireProvider(uri);
1329 throw new IllegalArgumentException("Unknown URI " + uri);
1333 int rowsUpdated = provider.update(mPackageName, uri, values, where, selectionArgs);
1335 maybeLogUpdateToEventLog(durationMillis, uri, "update", where);
1357 * @throws NullPointerException if uri or method is null
1358 * @throws IllegalArgumentException if uri is not known
1360 public final Bundle call(Uri uri, String method, String arg, Bundle extras) {
1361 if (uri == null) {
1362 throw new NullPointerException("uri == null");
1367 IContentProvider provider = acquireProvider(uri);
1369 throw new IllegalArgumentException("Unknown URI " + uri);
1385 * @param uri The URI to a content provider
1389 public final IContentProvider acquireProvider(Uri uri) {
1390 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1393 final String auth = uri.getAuthority();
1404 * @param uri The URI to a content provider
1408 public final IContentProvider acquireExistingProvider(Uri uri) {
1409 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1412 final String auth = uri.getAuthority();
1432 * @param uri The URI to a content provider
1436 public final IContentProvider acquireUnstableProvider(Uri uri) {
1437 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1440 String auth = uri.getAuthority();
1442 return acquireUnstableProvider(mContext, uri.getAuthority());
1459 * that services the content at uri, starting the provider if necessary. Returns
1460 * null if there is no provider associated wih the uri. The caller must indicate that they are
1464 * @param uri specifies which provider should be acquired
1466 * that services the content at uri or null if there isn't one.
1468 public final ContentProviderClient acquireContentProviderClient(Uri uri) {
1469 IContentProvider provider = acquireProvider(uri);
1480 * null if there is no provider associated wih the uri. The caller must indicate that they are
1513 public final ContentProviderClient acquireUnstableContentProviderClient(Uri uri) {
1514 IContentProvider provider = acquireUnstableProvider(uri);
1551 * @param uri The URI to watch for changes. This can be a specific row URI, or a base URI
1553 * @param notifyForDescendents If <code>true</code> changes to URIs beginning with <code>uri</code>
1555 * specified by <em>uri</em> will cause notifications to be sent. If <code>true</code>, any URI values
1560 public final void registerContentObserver(Uri uri, boolean notifyForDescendents,
1563 registerContentObserver(uri, notifyForDescendents, observer, UserHandle.myUserId());
1567 public final void registerContentObserver(Uri uri, boolean notifyForDescendents,
1571 getContentService().registerContentObserver(uri, notifyForDescendents,
1600 * @param uri The uri of the content that was changed.
1606 public void notifyChange(Uri uri, ContentObserver observer) {
1607 notifyChange(uri, observer, true /* sync to network */);
1615 * adapter that's registered for the authority of the provided uri. No account will be
1618 * @param uri The uri of the content that was changed.
1626 public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
1627 notifyChange(uri, observer, syncToNetwork, UserHandle.myUserId());
1635 public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork,
1639 uri, observer == null ? null : observer.getContentObserver(),
1656 public void takePersistableUriPermission(Uri uri, @Intent.AccessUriMode int modeFlags) {
1659 ContentProvider.getUriWithoutUserId(uri), modeFlags, resolveUserId(uri));
1672 public void releasePersistableUriPermission(Uri uri, @Intent.AccessUriMode int modeFlags) {
1675 ContentProvider.getUriWithoutUserId(uri), modeFlags, resolveUserId(uri));
1728 * @param uri the uri of the provider to sync or null to sync all providers.
1734 public void startSync(Uri uri, Bundle extras) {
1743 requestSync(account, uri != null ? uri.getAuthority() : null, extras);
1840 * Cancel any active or pending syncs that match the Uri. If the uri is null then
1843 * @param uri the uri of the provider to sync or null to sync all providers.
1847 public void cancelSync(Uri uri) {
1848 cancelSync(null /* all accounts */, uri != null ? uri.getAuthority() : null);
2375 Uri uri, String[] projection,
2406 uri.toString(),
2416 long durationMillis, Uri uri, String operation, String selection) {
2429 uri.toString(),
2524 public int resolveUserId(Uri uri) {
2525 return ContentProvider.getUserIdFromUri(uri, mContext.getUserId());