Fix for showing badges on Samsung.

Sorry, I did it in online github editor and forgot to copy paste all needed code :)
This commit is contained in:
evgeniysharafan 2015-03-12 12:58:26 +02:00
parent 168bf0d404
commit a1109fc303
1 changed files with 3 additions and 3 deletions

View File

@ -30,11 +30,11 @@ public class SamsungHomeBadger extends ShortcutBadger {
if (cursor != null) {
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
ContentValues contentValues = getContentValues(badgeCount);
ContentValues contentValues = getContentValues(badgeCount, false);
contentResolver.update(mUri, contentValues, "_id=?", new String[]{String.valueOf(id)});
}
} else {
ContentValues contentValues = getContentValues(badgeCount);
ContentValues contentValues = getContentValues(badgeCount, true);
contentResolver.insert(mUri, contentValues);
}
} finally {
@ -42,7 +42,7 @@ public class SamsungHomeBadger extends ShortcutBadger {
}
}
private ContentValues getContentValues(int badgeCount) {
private ContentValues getContentValues(int badgeCount, boolean isInsert) {
ContentValues contentValues = new ContentValues();
if (isInsert) {
contentValues.put("package", getContextPackageName());