Notify content observers correctly
This commit is contained in:
parent
903048ffe4
commit
004c86bc42
@ -151,9 +151,7 @@ public class AppPrefsProvider extends FDroidProvider {
|
|||||||
@Override
|
@Override
|
||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
db().insertOrThrow(getTableName(), null, values);
|
db().insertOrThrow(getTableName(), null, values);
|
||||||
if (!isApplyingBatch()) {
|
getContext().getContentResolver().notifyChange(AppProvider.getCanUpdateUri(), null);
|
||||||
getContext().getContentResolver().notifyChange(uri, null);
|
|
||||||
}
|
|
||||||
return getAppUri(values.getAsLong(Cols.APP_ID));
|
return getAppUri(values.getAsLong(Cols.APP_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +161,9 @@ public class AppPrefsProvider extends FDroidProvider {
|
|||||||
case CODE_SINGLE:
|
case CODE_SINGLE:
|
||||||
QuerySelection query = new QuerySelection(where, whereArgs)
|
QuerySelection query = new QuerySelection(where, whereArgs)
|
||||||
.add(querySingle(Long.parseLong(uri.getLastPathSegment())));
|
.add(querySingle(Long.parseLong(uri.getLastPathSegment())));
|
||||||
return db().update(getTableName(), values, query.getSelection(), query.getArgs());
|
int count = db().update(getTableName(), values, query.getSelection(), query.getArgs());
|
||||||
|
getContext().getContentResolver().notifyChange(AppProvider.getCanUpdateUri(), null);
|
||||||
|
return count;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException("Update not supported for " + uri + ".");
|
throw new UnsupportedOperationException("Update not supported for " + uri + ".");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user