summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2015-11-04 02:27:21 (GMT)
committerClark Scheff <clark@cyngn.com>2015-11-09 16:55:34 (GMT)
commit5ba00de4901b2e97c5176f33d029d3a152963b7f (patch)
tree58adcafbce9124785d0455f6843ec51be80f9107 /src
parent9afcfdd74e187cf55c48a203f0171bf1ec7f2da0 (diff)
downloadandroid_packages_providers_ThemesProvider-5ba00de4901b2e97c5176f33d029d3a152963b7f.zip
android_packages_providers_ThemesProvider-5ba00de4901b2e97c5176f33d029d3a152963b7f.tar.gz
android_packages_providers_ThemesProvider-5ba00de4901b2e97c5176f33d029d3a152963b7f.tar.bz2
themeprovider: notify uri on preview deletion
Ensure that registered content observers received a notification when a preview is deleted. Change-Id: I76046cbbff8c0f56c3384274ffcbbc7ea35ccdcb Signed-off-by: Jorge Ruesga <jorge@ruesga.com> (cherry picked from commit 0fe2d61cdae57c2ed36f752d24eb5479610d7289)
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemesProvider.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemesProvider.java b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
index 25cecf0..2321b5b 100644
--- a/src/org/cyanogenmod/themes/provider/ThemesProvider.java
+++ b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
@@ -136,7 +136,9 @@ public class ThemesProvider extends ContentProvider {
c.close();
rowsDeleted = sqlDB.delete(ThemesTable.TABLE_NAME, selection, selectionArgs);
- getContext().getContentResolver().notifyChange(uri, null);
+ if (rowsDeleted > 0) {
+ getContext().getContentResolver().notifyChange(uri, null);
+ }
return rowsDeleted;
case PREVIEWS:
sqlDB = mDatabase.getWritableDatabase();
@@ -153,6 +155,9 @@ public class ThemesProvider extends ContentProvider {
PreviewColumns.THEME_ID + "=" + c.getInt(idx), null);
}
c.close();
+ if (rowsDeleted > 0) {
+ getContext().getContentResolver().notifyChange(uri, null);
+ }
return rowsDeleted;
case MIXNMATCH:
throw new UnsupportedOperationException("Cannot delete rows in MixNMatch table");