summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2015-07-06 21:44:34 (GMT)
committerStephen Bird <sbird@cyngn.com>2015-07-08 20:39:47 (GMT)
commit99fb0c49cce8205dedaaba456a5ae144ae8eaebe (patch)
treeb315ea96859357fb277d44e794b29c10501b5d95
parent5b4a0806c8fe0414ef671ea8962e198fb08f3c82 (diff)
downloadandroid_packages_apps_Trebuchet-99fb0c49cce8205dedaaba456a5ae144ae8eaebe.zip
android_packages_apps_Trebuchet-99fb0c49cce8205dedaaba456a5ae144ae8eaebe.tar.gz
android_packages_apps_Trebuchet-99fb0c49cce8205dedaaba456a5ae144ae8eaebe.tar.bz2
Badge: Check count on bind
Fixes bug where badges would not show up after changing languages and other similar situations. Also, stop registering so many receivers when one will do. Change-Id: Id85dbadbc0f99c77493b5817097567ceb365912e (cherry picked from commit db86a7f9f1ac816af085f544d7cb3ca968ccdb84)
-rw-r--r--src/com/android/launcher3/Launcher.java1
-rw-r--r--src/com/android/launcher3/LauncherAppState.java8
-rw-r--r--src/com/android/launcher3/LauncherModel.java6
3 files changed, 6 insertions, 9 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 01f3017..40199fd 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -5167,6 +5167,7 @@ public class Launcher extends Activity
if (mWorkspace.isInOverviewMode()) {
mWorkspace.resetOverviewMode();
}
+ mModel.updateCount();
}
private void sendLoadingCompleteBroadcastIfNecessary() {
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index a207f1e..67a5bc3 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -107,18 +107,10 @@ public class LauncherAppState implements DeviceProfile.DeviceProfileCallbacks {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_LOCALE_CHANGED);
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
- sContext.registerReceiver(mModel, filter);
- filter = new IntentFilter();
filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
- sContext.registerReceiver(mModel, filter);
-
- filter = new IntentFilter();
if (LauncherApplication.LAUNCHER_SHOW_UNREAD_NUMBER) {
filter.addAction(LauncherModel.ACTION_UNREAD_CHANGED);
- sContext.registerReceiver(mModel, filter);
}
-
- filter = new IntentFilter();
filter.addAction(SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED);
sContext.registerReceiver(mModel, filter);
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 3fa5863..d751e50 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -234,7 +234,6 @@ public class LauncherModel extends BroadcastReceiver
ArrayList<UnreadInfo> unreadInfos = new ArrayList<LauncherModel.UnreadInfo>();
synchronized (unreadChangedMap) {
unreadInfos.addAll(unreadChangedMap.values());
- unreadChangedMap.clear();
}
Context context = mApp.getContext();
@@ -1401,6 +1400,11 @@ public class LauncherModel extends BroadcastReceiver
}
}
+ public void updateCount() {
+ sWorker.removeCallbacks(mUnreadUpdateTask);
+ sWorker.post(mUnreadUpdateTask);
+ }
+
void forceReload() {
resetLoadedState(true, true);