Lines Matching refs:uri

297      * @param uri The URI, using the content:// scheme, for the content to
313 public final Cursor query(Uri uri, String[] projection,
315 return query(uri, projection, selection, selectionArgs, sortOrder, null);
334 * @param uri The URI, using the content:// scheme, for the content to
353 public final Cursor query(final Uri uri, String[] projection,
356 IContentProvider unstableProvider = acquireUnstableProvider(uri);
372 qCursor = unstableProvider.query(uri, projection,
379 stableProvider = acquireProvider(uri);
383 qCursor = stableProvider.query(uri, projection,
392 maybeLogQueryToEventLog(durationMillis, uri, projection, selection, sortOrder);
395 stableProvider != null ? stableProvider : acquireProvider(uri));
426 * @param uri The desired URI.
431 public final InputStream openInputStream(Uri uri)
433 String scheme = uri.getScheme();
437 OpenResourceIdResult r = getResourceId(uri);
442 throw new FileNotFoundException("Resource does not exist: " + uri);
447 return new FileInputStream(uri.getPath());
449 AssetFileDescriptor fd = openAssetFileDescriptor(uri, "r");
460 * openOutputStream(uri, "w")}.
463 public final OutputStream openOutputStream(Uri uri)
465 return openOutputStream(uri, "w");
481 * @param uri The desired URI.
487 public final OutputStream openOutputStream(Uri uri, String mode)
489 AssetFileDescriptor fd = openAssetFileDescriptor(uri, mode);
516 * @param uri The desired URI to open.
525 public final ParcelFileDescriptor openFileDescriptor(Uri uri,
527 AssetFileDescriptor afd = openAssetFileDescriptor(uri, mode);
568 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/" + R.raw.my_resource");</pre>
578 * <pre>Uri uri = Uri.parse("android.resource://com.example.myapp/raw/my_resource");</pre>
587 * @param uri The desired URI to open.
595 public final AssetFileDescriptor openAssetFileDescriptor(Uri uri,
597 String scheme = uri.getScheme();
600 throw new FileNotFoundException("Can't write resources: " + uri);
602 OpenResourceIdResult r = getResourceId(uri);
606 throw new FileNotFoundException("Resource does not exist: " + uri);
610 new File(uri.getPath()), modeToMode(uri, mode));
614 return openTypedAssetFileDescriptor(uri, "*/*", null);
616 IContentProvider unstableProvider = acquireUnstableProvider(uri);
618 throw new FileNotFoundException("No content provider: " + uri);
625 fd = unstableProvider.openAssetFile(uri, mode);
635 stableProvider = acquireProvider(uri);
637 throw new FileNotFoundException("No content provider: " + uri);
639 fd = stableProvider.openAssetFile(uri, mode);
647 stableProvider = acquireProvider(uri);
663 "Failed opening content provider: " + uri);
692 * @param uri The desired URI to open.
706 public final AssetFileDescriptor openTypedAssetFileDescriptor(Uri uri,
708 IContentProvider unstableProvider = acquireUnstableProvider(uri);
710 throw new FileNotFoundException("No content provider: " + uri);
717 fd = unstableProvider.openTypedAssetFile(uri, mimeType, opts);
727 stableProvider = acquireProvider(uri);
729 throw new FileNotFoundException("No content provider: " + uri);
731 fd = stableProvider.openTypedAssetFile(uri, mimeType, opts);
739 stableProvider = acquireProvider(uri);
755 "Failed opening content provider: " + uri);
783 public OpenResourceIdResult getResourceId(Uri uri) throws FileNotFoundException {
784 String authority = uri.getAuthority();
787 throw new FileNotFoundException("No authority: " + uri);
792 throw new FileNotFoundException("No package found for authority: " + uri);
795 List<String> path = uri.getPathSegments();
797 throw new FileNotFoundException("No path: " + uri);
805 throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
810 throw new FileNotFoundException("More than two path segments: " + uri);
813 throw new FileNotFoundException("No resource found for: " + uri);
822 static public int modeToMode(Uri uri, String mode) throws FileNotFoundException {
842 throw new FileNotFoundException("Bad mode for " + uri + ": "
976 * @param uri The URI to modify.
982 * @throws NullPointerException if uri or values are null
984 public final int update(Uri uri, ContentValues values, String where,
986 IContentProvider provider = acquireProvider(uri);
988 throw new IllegalArgumentException("Unknown URI " + uri);
992 int rowsUpdated = provider.update(uri, values, where, selectionArgs);
994 maybeLogUpdateToEventLog(durationMillis, uri, "update", where);
1016 * @throws NullPointerException if uri or method is null
1017 * @throws IllegalArgumentException if uri is not known
1019 public final Bundle call(Uri uri, String method, String arg, Bundle extras) {
1020 if (uri == null) {
1021 throw new NullPointerException("uri == null");
1026 IContentProvider provider = acquireProvider(uri);
1028 throw new IllegalArgumentException("Unknown URI " + uri);
1044 * @param uri The URI to a content provider
1048 public final IContentProvider acquireProvider(Uri uri) {
1049 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1052 String auth = uri.getAuthority();
1054 return acquireProvider(mContext, uri.getAuthority());
1063 * @param uri The URI to a content provider
1067 public final IContentProvider acquireExistingProvider(Uri uri) {
1068 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1071 String auth = uri.getAuthority();
1073 return acquireExistingProvider(mContext, uri.getAuthority());
1091 * @param uri The URI to a content provider
1095 public final IContentProvider acquireUnstableProvider(Uri uri) {
1096 if (!SCHEME_CONTENT.equals(uri.getScheme())) {
1099 String auth = uri.getAuthority();
1101 return acquireUnstableProvider(mContext, uri.getAuthority());
1118 * that services the content at uri, starting the provider if necessary. Returns
1119 * null if there is no provider associated wih the uri. The caller must indicate that they are
1123 * @param uri specifies which provider should be acquired
1125 * that services the content at uri or null if there isn't one.
1127 public final ContentProviderClient acquireContentProviderClient(Uri uri) {
1128 IContentProvider provider = acquireProvider(uri);
1139 * null if there is no provider associated wih the uri. The caller must indicate that they are
1172 public final ContentProviderClient acquireUnstableContentProviderClient(Uri uri) {
1173 IContentProvider provider = acquireUnstableProvider(uri);
1210 * @param uri The URI to watch for changes. This can be a specific row URI, or a base URI
1212 * @param notifyForDescendents If <code>true</code> changes to URIs beginning with <code>uri</code>
1214 * specified by <em>uri</em> will cause notifications to be sent. If true, than any URI values
1219 public final void registerContentObserver(Uri uri, boolean notifyForDescendents,
1222 registerContentObserver(uri, notifyForDescendents, observer, UserHandle.myUserId());
1226 public final void registerContentObserver(Uri uri, boolean notifyForDescendents,
1230 getContentService().registerContentObserver(uri, notifyForDescendents,
1259 * @param uri The uri of the content that was changed.
1265 public void notifyChange(Uri uri, ContentObserver observer) {
1266 notifyChange(uri, observer, true /* sync to network */);
1274 * adapter that's registered for the authority of the provided uri. No account will be
1277 * @param uri The uri of the content that was changed.
1285 public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) {
1286 notifyChange(uri, observer, syncToNetwork, UserHandle.getCallingUserId());
1294 public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork,
1298 uri, observer == null ? null : observer.getContentObserver(),
1318 * @param uri the uri of the provider to sync or null to sync all providers.
1324 public void startSync(Uri uri, Bundle extras) {
1333 requestSync(account, uri != null ? uri.getAuthority() : null, extras);
1398 * Cancel any active or pending syncs that match the Uri. If the uri is null then
1401 * @param uri the uri of the provider to sync or null to sync all providers.
1405 public void cancelSync(Uri uri) {
1406 cancelSync(null /* all accounts */, uri != null ? uri.getAuthority() : null);
1785 Uri uri, String[] projection,
1815 uri.toString(),
1825 long durationMillis, Uri uri, String operation, String selection) {
1837 uri.toString(),