Merging ub-launcher3-qt-qpr1-dev, build 5872416

Test: Manual

Bug:121280703 P2 Finish implementation of PortraitLandscape annotation for tests
Bug:135633159 P3 [QPR] Promise icons on home screen
Bug:135638690 P1 [QPR] On-device app search
Bug:137106918 P2 UX: Accidental NGA triggering when hitting Undo actions in apps
Bug:137200188 P3 Home screen app title disappears during animation
Bug:138195597 P2 Wrong icon animated on return to home screen
Bug:138396187 P1 Swipe and hold from an app no longer uses spring to animate adjacent task
Bug:138729157 P1 [Flaky test] java.lang.AssertionError: http://go/tapl : want to fling backwards in widgets, flung back, but the current state is not WIDGETS; Unexpected launcher object visible: workspace
Bug:138729456 P1 [Flaky test] java.lang.AssertionError: http://go/tapl : Can't find an object with selector: BySelector [CLASS='\Qandroid.widget.TextView\E', PKG='\Qcom.google.android.apps.nexuslauncher\E', TEXT='\QShortcut 3\E'] (visible state: Workspace)
Bug:138964490 P1 Support DeviceConfig to drive ToggleableFlags
Bug:139021165 P2 [TEST TRACKER] [QPR] Promise icons on home screen
Bug:139137636 P2 Create memory tests for Launcher
Bug:139551306 P4 [Polish] Reduce shelf paddings in Overview
Bug:139885365 P3 App open animation different between launcher suggested apps and launcher home screen/drawer
Bug:139918680 P2 [a11y] Talkback shouldn't keep focusing on the background item and speak the description of the background item again after entering Widget list.
Bug:140076379 P1 Launcher ub-launcher3-qt-qpr1-dev Branch Build Keeps Crashing due to Exception
Bug:140252951 P2 Add widget launch test.
Bug:140308849 P2 Jank during swipe up to home, especially noticeable after pausing first
Bug:140311911 P2 Flake in Launcher tests: java.lang.AssertionError: Stable state != state: OverviewState, LauncherState
Bug:140405990 P2 [a11y] Unable to add shortcut to Home screen by Voice access or Switch access.
Bug:140819614 P1 If an install session is abandoned for an already installed app, the corresponding icon is removed
Bug:140823188 P1 AppPredictionsUITests failing
Bug:140837771 P1 Failing test: AddConfigWidgetTests and AddWidgetTests are failing
Change-Id: I1efae6216c53b1fee3e105c9356ed43c4bf46c6e
diff --git a/CleanSpec.mk b/CleanSpec.mk
index b2c5266..f58158f 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -52,6 +52,7 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Launcher2.apk)
 $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/Launcher2_intermediates)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Launcher2.apk)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/priv-app/Launcher3QuickStep)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
index fc7d6b3..e1b71a0 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java
@@ -168,22 +168,19 @@
             mCanvas.setBitmap(null);
         }
 
-        final Bitmap result;
-        if (user != null && !Process.myUserHandle().equals(user)) {
+        if (isInstantApp) {
+            badgeWithDrawable(bitmap, mContext.getDrawable(R.drawable.ic_instant_app_badge));
+        }
+        if (user != null) {
             BitmapDrawable drawable = new FixedSizeBitmapDrawable(bitmap);
             Drawable badged = mPm.getUserBadgedIcon(drawable, user);
             if (badged instanceof BitmapDrawable) {
-                result = ((BitmapDrawable) badged).getBitmap();
+                bitmap = ((BitmapDrawable) badged).getBitmap();
             } else {
-                result = createIconBitmap(badged, 1f);
+                bitmap = createIconBitmap(badged, 1f);
             }
-        } else if (isInstantApp) {
-            badgeWithDrawable(bitmap, mContext.getDrawable(R.drawable.ic_instant_app_badge));
-            result = bitmap;
-        } else {
-            result = bitmap;
         }
-        return BitmapInfo.fromBitmap(result, mDisableColorExtractor ? null : mColorExtractor);
+        return BitmapInfo.fromBitmap(bitmap, mDisableColorExtractor ? null : mColorExtractor);
     }
 
     public Bitmap createScaledBitmapWithoutShadow(Drawable icon, boolean shrinkNonAdaptiveIcons) {
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
index e553891..581ab6d 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OverviewInputConsumer.java
@@ -115,4 +115,5 @@
             mActivity.dispatchKeyEvent(ev);
         }
     }
-}
\ No newline at end of file
+}
+
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
index cae273a..90989fe 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -431,3 +431,4 @@
         }
     }
 }
+