2022-10-02 23:06:56 +02:00
|
|
|
package android.content;
|
|
|
|
|
|
2024-03-16 18:14:46 +01:00
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileNotFoundException;
|
|
|
|
|
|
2024-11-30 18:49:11 +01:00
|
|
|
import android.accounts.Account;
|
2022-11-24 23:10:27 +01:00
|
|
|
import android.database.ContentObserver;
|
2024-03-20 23:05:17 +01:00
|
|
|
import android.database.Cursor;
|
2023-06-22 11:45:46 +02:00
|
|
|
import android.net.Uri;
|
2024-11-30 18:49:11 +01:00
|
|
|
import android.os.Bundle;
|
2024-03-29 23:56:28 +01:00
|
|
|
import android.os.CancellationSignal;
|
2024-03-16 18:14:46 +01:00
|
|
|
import android.os.ParcelFileDescriptor;
|
2022-10-02 23:06:56 +02:00
|
|
|
|
2022-11-24 23:10:27 +01:00
|
|
|
public class ContentResolver {
|
2024-11-30 18:49:11 +01:00
|
|
|
public static final String SYNC_EXTRAS_IGNORE_SETTINGS = "ignore_settings";
|
|
|
|
|
|
2022-11-24 23:10:27 +01:00
|
|
|
public final void registerContentObserver(Uri uri, boolean notifyForDescendants, ContentObserver observer) {
|
|
|
|
|
}
|
2023-08-24 12:43:13 +02:00
|
|
|
public final void unregisterContentObserver(ContentObserver observer) {
|
|
|
|
|
}
|
|
|
|
|
public void notifyChange(Uri uri, ContentObserver observer) {
|
|
|
|
|
}
|
|
|
|
|
public int getUserId() {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
public final void registerContentObserver(Uri uri, boolean notifyForDescendants, ContentObserver observer, int userHandle) {
|
|
|
|
|
}
|
2024-03-16 18:14:46 +01:00
|
|
|
|
|
|
|
|
public ParcelFileDescriptor openFileDescriptor(Uri uri, String mode) throws FileNotFoundException {
|
2024-08-29 13:51:08 +02:00
|
|
|
if ("file".equals(uri.getScheme())) {
|
|
|
|
|
return ParcelFileDescriptor.open(new File(uri.toString()), ParcelFileDescriptor.parseMode(mode));
|
|
|
|
|
} else {
|
|
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.openFile(uri, mode);
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2024-03-16 18:14:46 +01:00
|
|
|
}
|
2024-03-20 23:05:17 +01:00
|
|
|
|
|
|
|
|
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
2024-08-05 17:13:10 +02:00
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.query(uri, projection, selection, selectionArgs, sortOrder);
|
|
|
|
|
else
|
|
|
|
|
return null;
|
2024-03-20 23:05:17 +01:00
|
|
|
}
|
2024-03-29 23:56:28 +01:00
|
|
|
|
|
|
|
|
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal) {
|
|
|
|
|
return query(uri, projection, selection, selectionArgs, sortOrder);
|
|
|
|
|
}
|
2024-06-24 18:44:31 +02:00
|
|
|
|
|
|
|
|
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
2024-08-05 17:13:10 +02:00
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.delete(uri, selection, selectionArgs);
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Uri insert(Uri uri, ContentValues values) {
|
|
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.insert(uri, values);
|
|
|
|
|
else
|
|
|
|
|
return null;
|
2024-06-24 18:44:31 +02:00
|
|
|
}
|
2024-08-29 13:51:08 +02:00
|
|
|
|
|
|
|
|
public String getType(Uri uri) {
|
|
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.getType(uri);
|
|
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2024-11-22 18:02:54 +01:00
|
|
|
|
|
|
|
|
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
|
|
|
|
ContentProvider provider = ContentProvider.providers.get(uri.getAuthority());
|
|
|
|
|
if (provider != null)
|
|
|
|
|
return provider.update(uri, values, selection, selectionArgs);
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2024-11-30 18:49:11 +01:00
|
|
|
|
|
|
|
|
public static void requestSync(Account account, String authority, Bundle extras) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void cancelSync(Account account, String authority) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void setMasterSyncAutomatically(boolean sync) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static boolean isSyncActive(Account account, String authority) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2022-10-02 23:06:56 +02:00
|
|
|
}
|