You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
api-impl: misc additions for Oeffi
This commit is contained in:
@@ -31,13 +31,15 @@ public abstract class ContentProvider {
|
||||
public boolean onCreate() {return false;}
|
||||
|
||||
public Context getContext() {
|
||||
return new Context();
|
||||
return Context.this_application;
|
||||
}
|
||||
|
||||
public abstract Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder);
|
||||
|
||||
public abstract Uri insert(Uri uri, ContentValues values);
|
||||
|
||||
public abstract int update(Uri uri, ContentValues values, String selection, String[] selectionArgs);
|
||||
|
||||
public abstract int delete(Uri uri, String selection, String[] selectionArgs);
|
||||
|
||||
public abstract String getType(Uri uri);
|
||||
|
||||
@@ -69,4 +69,12 @@ public class ContentResolver {
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,11 @@ public class SearchRecentSuggestionsProvider extends ContentProvider {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'insert'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'update'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'delete'");
|
||||
|
||||
Reference in New Issue
Block a user