implement more APIs

This commit is contained in:
Julian Winkler
2024-03-20 23:05:17 +01:00
parent e8dc6e2f0d
commit 494605932c
18 changed files with 119 additions and 36 deletions

View File

@@ -3,7 +3,9 @@ package android.content;
import java.io.File;
import java.io.FileNotFoundException;
import android.database.AbstractCursor;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
@@ -23,4 +25,18 @@ public class ContentResolver {
public ParcelFileDescriptor openFileDescriptor(Uri uri, String mode) throws FileNotFoundException {
return ParcelFileDescriptor.open(new File(uri.uri), ParcelFileDescriptor.parseMode(mode));
}
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
return new AbstractCursor() {
public int getCount() { return 0; }
public String[] getColumnNames() { return new String[0]; }
public String getString(int column) { throw new IndexOutOfBoundsException(); }
public short getShort(int column) { throw new IndexOutOfBoundsException(); }
public int getInt(int column) { throw new IndexOutOfBoundsException(); }
public long getLong(int column) { throw new IndexOutOfBoundsException(); }
public float getFloat(int column) { throw new IndexOutOfBoundsException(); }
public double getDouble(int column) { throw new IndexOutOfBoundsException(); }
public boolean isNull(int column) { throw new IndexOutOfBoundsException(); }
};
}
}