summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2017-05-04 16:47:11 -0700
committerSunny Goyal <sunnygoyal@google.com>2017-05-22 13:31:04 -0700
commita474a9bcf5d533ac942c58409e45e5ec6d8b4893 (patch)
tree86bc1eea564da58343b1d64e414ccd2e8bec2f03 /src/com/android/launcher3/Launcher.java
parent998dbecf5397162f13acb8a84cfe71c2ed4d8741 (diff)
downloadandroid_packages_apps_Trebuchet-a474a9bcf5d533ac942c58409e45e5ec6d8b4893.tar.gz
android_packages_apps_Trebuchet-a474a9bcf5d533ac942c58409e45e5ec6d8b4893.tar.bz2
android_packages_apps_Trebuchet-a474a9bcf5d533ac942c58409e45e5ec6d8b4893.zip
Simplifying logic for managed for icon addition
> Checking for duplicate icons before adding new icons For O and above, icon addition is controlled using SessionCommitReceiver. As long as the Launcher is the default app, it will keep adding icons on the homescreen. Apps installed while launcher was not the default homescreen, no icons will be added. For below O, icons are added based on package event. As long as the Launcher process is running, it will keep adding icons on the homescreen. Apps installed while the launcher app was dead, no icons will be added. Bug: 37528649 Bug: 37082950 Bug: 34112546 Change-Id: Ic99501fa476c00474a479f2a36c24614bfa3f4bf
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b63bbd548..b9b561020 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1036,13 +1036,12 @@ public class Launcher extends BaseActivity
updateInteraction(Workspace.State.NORMAL, mWorkspace.getState());
mWorkspace.onResume();
- if (!isWorkspaceLoading()) {
- // Process any items that were added while Launcher was away.
- InstallShortcutReceiver.disableAndFlushInstallQueue(this);
+ // Process any items that were added while Launcher was away.
+ InstallShortcutReceiver.disableAndFlushInstallQueue(
+ InstallShortcutReceiver.FLAG_ACTIVITY_PAUSED, this);
- // Refresh shortcuts if the permission changed.
- mModel.refreshShortcutsIfRequired();
- }
+ // Refresh shortcuts if the permission changed.
+ mModel.refreshShortcutsIfRequired();
if (shouldShowDiscoveryBounce()) {
mAllAppsController.showDiscoveryBounce();
@@ -1057,7 +1056,7 @@ public class Launcher extends BaseActivity
@Override
protected void onPause() {
// Ensure that items added to Launcher are queued until Launcher returns
- InstallShortcutReceiver.enableInstallQueue();
+ InstallShortcutReceiver.enableInstallQueue(InstallShortcutReceiver.FLAG_ACTIVITY_PAUSED);
super.onPause();
mPaused = true;
@@ -3655,7 +3654,8 @@ public class Launcher extends BaseActivity
mPendingActivityResult = null;
}
- InstallShortcutReceiver.disableAndFlushInstallQueue(this);
+ InstallShortcutReceiver.disableAndFlushInstallQueue(
+ InstallShortcutReceiver.FLAG_LOADER_RUNNING, this);
NotificationListener.setNotificationsChangedListener(mPopupDataProvider);