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:40:11 (GMT)
commit0c375453f9efd2f9aa4072b23be0c5fede7f3adf (patch)
tree1c82f39030077d76e79a93f86bf2a18cfa94fc2a
parent713f8e5b0007985dbc91ef278c03f5a6d52afaf3 (diff)
downloadandroid_packages_apps_Trebuchet-0c375453f9efd2f9aa4072b23be0c5fede7f3adf.zip
android_packages_apps_Trebuchet-0c375453f9efd2f9aa4072b23be0c5fede7f3adf.tar.gz
android_packages_apps_Trebuchet-0c375453f9efd2f9aa4072b23be0c5fede7f3adf.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) (cherry picked from commit 99fb0c49cce8205dedaaba456a5ae144ae8eaebe)
-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 05cfb40..1819f7a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -5021,6 +5021,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 99ad193..7d0b59a 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);