Merge "Import translations. DO NOT MERGE" into ub-launcher3-master
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index 5d975b0..e6d06da 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -18,6 +18,7 @@
 
 import static com.android.launcher3.Utilities.getPrefs;
 import static com.android.quickstep.OverviewInteractionState.KEY_SWIPE_UP_ENABLED;
+import static com.android.launcher3.LauncherState.ALL_APPS;
 
 import android.content.Context;
 import android.content.SharedPreferences;
@@ -29,6 +30,7 @@
 import com.android.quickstep.OverviewInteractionState;
 import com.android.quickstep.RecentsModel;
 import com.android.quickstep.views.RecentsView;
+import com.android.systemui.shared.system.WindowManagerWrapper;
 
 public class UiFactory {
 
@@ -85,6 +87,14 @@
         }
     }
 
+    public static void onLauncherStateOrResumeChanged(Launcher launcher) {
+        WindowManagerWrapper.getInstance().setShelfHeight(
+                launcher.getStateManager().getState() != ALL_APPS &&
+                        launcher.isUserActive() &&
+                        !launcher.getDeviceProfile().isVerticalBarLayout(),
+                launcher.getDeviceProfile().hotseatBarSizePx);
+    }
+
     public static void onTrimMemory(Context context, int level) {
         RecentsModel model = RecentsModel.getInstance(context);
         if (model != null) {
diff --git a/quickstep/src/com/android/quickstep/MotionEventQueue.java b/quickstep/src/com/android/quickstep/MotionEventQueue.java
index 8e6e4c7..538e23c 100644
--- a/quickstep/src/com/android/quickstep/MotionEventQueue.java
+++ b/quickstep/src/com/android/quickstep/MotionEventQueue.java
@@ -53,6 +53,8 @@
             ACTION_VIRTUAL | (5 << ACTION_POINTER_INDEX_SHIFT);
     private static final int ACTION_SHOW_OVERVIEW_FROM_ALT_TAB =
             ACTION_VIRTUAL | (6 << ACTION_POINTER_INDEX_SHIFT);
+    private static final int ACTION_QUICK_STEP =
+            ACTION_VIRTUAL | (7 << ACTION_POINTER_INDEX_SHIFT);
 
     private final EventArray mEmptyArray = new EventArray();
     private final Object mExecutionLock = new Object();
@@ -160,6 +162,9 @@
                             mConsumer.onShowOverviewFromAltTab();
                             mConsumer.updateTouchTracking(INTERACTION_QUICK_SCRUB);
                             break;
+                        case ACTION_QUICK_STEP:
+                            mConsumer.onQuickStep(event.getX(), event.getY(), event.getEventTime());
+                            break;
                         default:
                             Log.e(TAG, "Invalid virtual event: " + event.getAction());
                     }
@@ -204,6 +209,11 @@
         queueVirtualAction(ACTION_QUICK_SCRUB_END, 0);
     }
 
+    public void onQuickStep(MotionEvent event) {
+        event.setAction(ACTION_QUICK_STEP);
+        queueNoPreProcess(event);
+    }
+
     public void reset() {
         queueVirtualAction(ACTION_RESET, 0);
     }
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index 4877abb..bcc986d 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -79,7 +79,7 @@
     private final PointF mDownPos = new PointF();
     private final PointF mLastPos = new PointF();
     private int mActivePointerId = INVALID_POINTER_ID;
-    private boolean mTouchThresholdCrossed;
+    private boolean mGestureStarted;
     private int mTouchSlop;
     private float mStartDisplacement;
     private WindowTransformSwipeHandler mInteractionHandler;
@@ -122,7 +122,7 @@
                 mDownPos.set(ev.getX(), ev.getY());
                 mLastPos.set(mDownPos);
                 mTouchSlop = ViewConfiguration.get(this).getScaledPagingTouchSlop();
-                mTouchThresholdCrossed = false;
+                mGestureStarted = false;
 
                 // Start the window animation on down to give more time for launcher to draw if the
                 // user didn't start the gesture over the back button
@@ -155,26 +155,10 @@
                 }
                 mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
 
-                float displacement = ev.getY(pointerIndex) - mDownPos.y;
-                if (isNavBarOnRight()) {
-                    displacement = ev.getX(pointerIndex) - mDownPos.x;
-                } else if (isNavBarOnLeft()) {
-                    displacement = mDownPos.x - ev.getX(pointerIndex);
-                }
-                if (!mTouchThresholdCrossed) {
-                    mTouchThresholdCrossed = Math.abs(displacement) >= mTouchSlop;
-                    if (mTouchThresholdCrossed) {
-                        mStartDisplacement = Math.signum(displacement) * mTouchSlop;
-
-                        if (mIsDeferredDownTarget) {
-                            // If we deferred starting the window animation on touch down, then
-                            // start tracking now
-                            startTouchTrackingForWindowAnimation(ev.getEventTime());
-                        }
-                        notifyGestureStarted();
-                    }
-                } else if (mInteractionHandler != null) {
+                if (mGestureStarted && mInteractionHandler != null) {
                     // Move
+                    float displacement = getDisplacement(ev.getX(pointerIndex),
+                            ev.getY(pointerIndex));
                     mInteractionHandler.updateDisplacement(displacement - mStartDisplacement);
                 }
                 break;
@@ -195,6 +179,7 @@
             return;
         }
         // Notify the handler that the gesture has actually started
+        mGestureStarted = true;
         mInteractionHandler.onGestureStarted();
     }
 
@@ -276,7 +261,7 @@
      * the animation can still be running.
      */
     private void finishTouchTracking() {
-        if (mTouchThresholdCrossed && mInteractionHandler != null) {
+        if (mGestureStarted && mInteractionHandler != null) {
             mVelocityTracker.computeCurrentVelocity(1000,
                     ViewConfiguration.get(this).getScaledMaximumFlingVelocity());
 
@@ -336,6 +321,28 @@
         }
     }
 
+    @Override
+    public void onQuickStep(float eventX, float eventY, long eventTime) {
+        float displacement = getDisplacement(eventX, eventY);
+        mStartDisplacement = Math.signum(displacement) * mTouchSlop;
+        if (mIsDeferredDownTarget) {
+            // If we deferred starting the window animation on touch down, then
+            // start tracking now
+            startTouchTrackingForWindowAnimation(eventTime);
+        }
+        notifyGestureStarted();
+    }
+
+    private float getDisplacement(float eventX, float eventY) {
+        float displacement = eventY - mDownPos.y;
+        if (isNavBarOnRight()) {
+            displacement = eventX - mDownPos.x;
+        } else if (isNavBarOnLeft()) {
+            displacement = mDownPos.x - eventX;
+        }
+        return displacement;
+    }
+
     public void switchToMainChoreographer() {
         mEventQueue.setInterimChoreographer(null);
     }
diff --git a/quickstep/src/com/android/quickstep/TouchConsumer.java b/quickstep/src/com/android/quickstep/TouchConsumer.java
index 4e35159..1290ec3 100644
--- a/quickstep/src/com/android/quickstep/TouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/TouchConsumer.java
@@ -46,6 +46,8 @@
 
     default void onQuickScrubProgress(float progress) { }
 
+    default void onQuickStep(float eventX, float eventY, long eventTime) { }
+
     /**
      * Called on the binder thread to allow the consumer to process the motion event before it is
      * posted on a handler thread.
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index cc49dc7..2d58a6b 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -153,6 +153,8 @@
 
         @Override
         public void onQuickStep(MotionEvent motionEvent) {
+            mEventQueue.onQuickStep(motionEvent);
+            TraceHelper.endSection("SysUiBinder", "onQuickStep");
 
         }
     };
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 97f40bc..7a5fd2f 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -26,7 +26,10 @@
 import android.animation.TimeInterpolator;
 import android.animation.ValueAnimator;
 import android.annotation.TargetApi;
+import android.app.ActivityManager;
+import android.content.ComponentName;
 import android.content.Context;
+import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
 import android.graphics.Canvas;
@@ -124,6 +127,7 @@
 
     // Only valid until the launcher state changes to NORMAL
     private int mRunningTaskId = -1;
+    private Task mTmpRunningTask;
 
     private boolean mFirstTaskIconScaledDown = false;
 
@@ -472,6 +476,10 @@
             Task task = taskView.getTask();
             boolean visible = lower <= i && i <= upper;
             if (visible) {
+                if (task == mTmpRunningTask) {
+                    // Skip loading if this is the task that we are animating into
+                    continue;
+                }
                 if (!mHasVisibleTaskData.get(task.key.id)) {
                     loader.loadTaskData(task);
                     loader.getHighResThumbnailLoader().onTaskVisible(task);
@@ -530,24 +538,27 @@
      * Also scrolls the view to this task
      */
     public void showTask(int runningTaskId) {
-        boolean needsReload = false;
         if (getChildCount() == 0) {
-            needsReload = true;
-            // Add an empty view for now
+            // Add an empty view for now until the task plan is loaded and applied
             final TaskView taskView = (TaskView) LayoutInflater.from(getContext())
                     .inflate(R.layout.task, this, false);
-            addView(taskView, 0);
+            addView(taskView);
+
+            // The temporary running task is only used for the duration between the start of the
+            // gesture and the task list is loaded and applied
+            mTmpRunningTask = new Task(new Task.TaskKey(runningTaskId, 0, new Intent(), 0, 0), null,
+                    null, "", "", 0, 0, false, true, false, false,
+                    new ActivityManager.TaskDescription(), 0, new ComponentName("", ""), false);
+            taskView.bind(mTmpRunningTask);
         }
+
         mRunningTaskId = runningTaskId;
         setCurrentPage(0);
-        if (!needsReload) {
-            needsReload = !mModel.isLoadPlanValid(mLoadPlanId);
-        }
-        if (needsReload) {
-            mLoadPlanId = mModel.loadTasks(runningTaskId, this::applyLoadPlan);
-        } else {
-            loadVisibleTaskData();
-        }
+
+        // Load the tasks (if the loading is already
+        mLoadPlanId = mModel.loadTasks(runningTaskId, this::applyLoadPlan);
+
+        // Hide the task that we are animating into
         getPageAt(mCurrentPage).setAlpha(0);
     }
 
diff --git a/src/com/android/launcher3/BaseActivity.java b/src/com/android/launcher3/BaseActivity.java
index 02d70c4..cf2d79f 100644
--- a/src/com/android/launcher3/BaseActivity.java
+++ b/src/com/android/launcher3/BaseActivity.java
@@ -39,6 +39,7 @@
     protected SystemUiController mSystemUiController;
 
     private boolean mStarted;
+    private boolean mUserActive;
 
     public DeviceProfile getDeviceProfile() {
         return mDeviceProfile;
@@ -85,6 +86,18 @@
     }
 
     @Override
+    protected void onResume() {
+        mUserActive = true;
+        super.onResume();
+    }
+
+    @Override
+    protected void onUserLeaveHint() {
+        mUserActive = false;
+        super.onUserLeaveHint();
+    }
+
+    @Override
     protected void onStop() {
         mStarted = false;
         super.onStop();
@@ -94,6 +107,10 @@
         return mStarted;
     }
 
+    public boolean isUserActive() {
+        return mUserActive;
+    }
+
     public void addOnDeviceProfileChangeListener(OnDeviceProfileChangeListener listener) {
         mDPChangeListeners.add(listener);
     }
diff --git a/src/com/android/launcher3/BaseDraggingActivity.java b/src/com/android/launcher3/BaseDraggingActivity.java
index 458f7b2..34819af 100644
--- a/src/com/android/launcher3/BaseDraggingActivity.java
+++ b/src/com/android/launcher3/BaseDraggingActivity.java
@@ -45,7 +45,7 @@
     private static final String TAG = "BaseDraggingActivity";
 
     // The Intent extra that defines whether to ignore the launch animation
-    private static final String INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION =
+    protected static final String INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION =
             "com.android.launcher3.intent.extra.shortcut.INGORE_LAUNCH_ANIMATION";
 
     // When starting an action mode, setting this tag will cause the action mode to be cancelled
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 43a781d..11e8c57 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -22,7 +22,6 @@
 import static com.android.launcher3.LauncherAnimUtils.SPRING_LOADED_EXIT_DELAY;
 import static com.android.launcher3.LauncherState.ALL_APPS;
 import static com.android.launcher3.LauncherState.NORMAL;
-import static com.android.launcher3.LauncherState.OVERVIEW;
 import static com.android.launcher3.logging.LoggerUtils.newContainerTarget;
 
 import android.animation.Animator;
@@ -147,7 +146,6 @@
     private static final int REQUEST_CREATE_APPWIDGET = 5;
 
     private static final int REQUEST_PICK_APPWIDGET = 9;
-    private static final int REQUEST_PICK_WALLPAPER = 10;
 
     private static final int REQUEST_BIND_APPWIDGET = 11;
     public static final int REQUEST_BIND_PENDING_APPWIDGET = 12;
@@ -381,6 +379,7 @@
         }
 
         mOldConfig.setTo(newConfig);
+        UiFactory.onLauncherStateOrResumeChanged(this);
         super.onConfigurationChanged(newConfig);
     }
 
@@ -573,14 +572,6 @@
                         ON_ACTIVITY_RESULT_ANIMATION_DELAY);
             }
             return;
-        } else if (requestCode == REQUEST_PICK_WALLPAPER) {
-            if (resultCode == RESULT_OK && isInState(OVERVIEW)) {
-                // User could have free-scrolled between pages before picking a wallpaper; make sure
-                // we move to the closest one now.
-                mWorkspace.setCurrentPage(mWorkspace.getPageNearestToCenterOfScreen());
-                mStateManager.goToState(NORMAL, false);
-            }
-            return;
         }
 
         boolean isWidgetDrop = (requestCode == REQUEST_PICK_APPWIDGET ||
@@ -822,6 +813,7 @@
         if (mLauncherCallbacks != null) {
             mLauncherCallbacks.onResume();
         }
+        UiFactory.onLauncherStateOrResumeChanged(this);
 
         TraceHelper.endSection("ON_RESUME");
     }
@@ -841,6 +833,12 @@
     }
 
     @Override
+    protected void onUserLeaveHint() {
+        super.onUserLeaveHint();
+        UiFactory.onLauncherStateOrResumeChanged(this);
+    }
+
+    @Override
     public void onWindowFocusChanged(boolean hasFocus) {
         super.onWindowFocusChanged(hasFocus);
         mStateManager.onWindowFocusChanged();
@@ -1663,35 +1661,19 @@
             Toast.makeText(this, R.string.msg_disabled_by_admin, Toast.LENGTH_SHORT).show();
             return;
         }
-
         int pageScroll = mWorkspace.getScrollForPage(mWorkspace.getPageNearestToCenterOfScreen());
         float offset = mWorkspace.mWallpaperOffset.wallpaperOffsetForScroll(pageScroll);
-        setWaitingForResult(new PendingRequestArgs(new ItemInfo()));
         Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER)
                 .putExtra(Utilities.EXTRA_WALLPAPER_OFFSET, offset);
 
         String pickerPackage = getString(R.string.wallpaper_picker_package);
-        boolean hasTargetPackage = !TextUtils.isEmpty(pickerPackage);
-        if (hasTargetPackage) {
+        if (!TextUtils.isEmpty(pickerPackage)) {
             intent.setPackage(pickerPackage);
-        }
-
-        final Bundle launchOptions;
-        if (v != null) {
-            intent.setSourceBounds(getViewBounds(v));
-            // If there is no target package, use the default intent chooser animation
-            launchOptions = hasTargetPackage
-                    ? getActivityLaunchOptionsAsBundle(v, isInMultiWindowModeCompat())
-                    : null;
         } else {
-            launchOptions = null;
+            // If there is no target package, use the default intent chooser animation
+            intent.putExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION, true);
         }
-        try {
-            startActivityForResult(intent, REQUEST_PICK_WALLPAPER, launchOptions);
-        } catch (ActivityNotFoundException e) {
-            setWaitingForResult(null);
-            Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
-        }
+        startActivitySafely(v, intent, null);
     }
 
     @TargetApi(Build.VERSION_CODES.M)
diff --git a/src/com/android/launcher3/LauncherStateManager.java b/src/com/android/launcher3/LauncherStateManager.java
index 7d50a52..ef285df 100644
--- a/src/com/android/launcher3/LauncherStateManager.java
+++ b/src/com/android/launcher3/LauncherStateManager.java
@@ -294,6 +294,7 @@
             // Only disable clipping if needed, otherwise leave it as previous value.
             mLauncher.getWorkspace().setClipChildren(false);
         }
+        UiFactory.onLauncherStateOrResumeChanged(mLauncher);
     }
 
     private void onStateTransitionEnd(LauncherState state) {
@@ -312,6 +313,7 @@
         }
 
         UiFactory.onLauncherStateOrFocusChanged(mLauncher);
+        UiFactory.onLauncherStateOrResumeChanged(mLauncher);
     }
 
     public void onWindowFocusChanged() {
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index aafae10..8788db4 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -23,7 +23,6 @@
 import com.android.launcher3.LauncherStateManager.AnimationConfig;
 import com.android.launcher3.LauncherStateManager.StateHandler;
 import com.android.launcher3.R;
-import com.android.launcher3.allapps.SearchUiManager.OnScrollRangeChangeListener;
 import com.android.launcher3.anim.AnimationSuccessListener;
 import com.android.launcher3.anim.AnimatorSetBuilder;
 import com.android.launcher3.anim.PropertySetter;
@@ -39,8 +38,7 @@
  * If release velocity < THRES1, snap according to either top or bottom depending on whether it's
  * closer to top or closer to the page indicator.
  */
-public class AllAppsTransitionController
-        implements OnScrollRangeChangeListener, StateHandler, OnDeviceProfileChangeListener {
+public class AllAppsTransitionController implements StateHandler, OnDeviceProfileChangeListener {
 
     public static final Property<AllAppsTransitionController, Float> ALL_APPS_PROGRESS =
             new Property<AllAppsTransitionController, Float>(Float.class, "allAppsProgress") {
@@ -71,11 +69,11 @@
     private float mShiftRange;      // changes depending on the orientation
     private float mProgress;        // [0, 1], mShiftRange * mProgress = shiftCurrent
 
-    private static final float DEFAULT_SHIFT_RANGE = 10;
+    private float mScrollRangeDelta = 0;
 
     public AllAppsTransitionController(Launcher l) {
         mLauncher = l;
-        mShiftRange = DEFAULT_SHIFT_RANGE;
+        mShiftRange = mLauncher.getDeviceProfile().heightPx;
         mProgress = 1f;
 
         mIsDarkTheme = Themes.getAttrBoolean(mLauncher, R.attr.isMainColorDark);
@@ -95,6 +93,7 @@
     @Override
     public void onDeviceProfileChanged(DeviceProfile dp) {
         mIsVerticalLayout = dp.isVerticalBarLayout();
+        setScrollRangeDelta(mScrollRangeDelta);
 
         if (mIsVerticalLayout) {
             mAppsView.setAlpha(1);
@@ -205,13 +204,14 @@
 
     public void setupViews(AllAppsContainerView appsView) {
         mAppsView = appsView;
-        mAppsView.getSearchUiManager().addOnScrollRangeChangeListener(this);
     }
 
-    @Override
-    public void onScrollRangeChanged(int scrollRange) {
-        mShiftRange = scrollRange;
-        setProgress(mProgress);
+    /**
+     * Updates the total scroll range but does not update the UI.
+     */
+    public void setScrollRangeDelta(float delta) {
+        mScrollRangeDelta = delta;
+        mShiftRange = mLauncher.getDeviceProfile().heightPx - mScrollRangeDelta;
     }
 
     /**
diff --git a/src/com/android/launcher3/allapps/SearchUiManager.java b/src/com/android/launcher3/allapps/SearchUiManager.java
index d8568f8..68193f5 100644
--- a/src/com/android/launcher3/allapps/SearchUiManager.java
+++ b/src/com/android/launcher3/allapps/SearchUiManager.java
@@ -15,8 +15,6 @@
  */
 package com.android.launcher3.allapps;
 
-import android.support.animation.SpringAnimation;
-import android.support.annotation.NonNull;
 import android.view.KeyEvent;
 
 /**
@@ -30,11 +28,6 @@
     void initialize(AllAppsContainerView containerView);
 
     /**
-     * A {@link SpringAnimation} that will be used when the user flings.
-     */
-    @NonNull SpringAnimation getSpringForFling();
-
-    /**
      * Notifies the search manager to close any active search session.
      */
     void resetSearch();
@@ -44,14 +37,4 @@
      * some UI beforehand.
      */
     void preDispatchKeyEvent(KeyEvent keyEvent);
-
-    void addOnScrollRangeChangeListener(OnScrollRangeChangeListener listener);
-
-    /**
-     * Callback for listening to changes in the vertical scroll range when opening all-apps.
-     */
-    interface OnScrollRangeChangeListener {
-
-        void onScrollRangeChanged(int scrollRange);
-    }
 }
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
index dd80dac..ad61c55 100644
--- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
+++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java
@@ -23,10 +23,6 @@
 
 import android.content.Context;
 import android.graphics.Rect;
-import android.support.animation.FloatValueHolder;
-import android.support.animation.SpringAnimation;
-import android.support.animation.SpringForce;
-import android.support.annotation.NonNull;
 import android.text.Selection;
 import android.text.Spannable;
 import android.text.SpannableString;
@@ -39,6 +35,7 @@
 
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.ExtendedEditText;
+import com.android.launcher3.Insettable;
 import com.android.launcher3.Launcher;
 import com.android.launcher3.R;
 import com.android.launcher3.allapps.AllAppsContainerView;
@@ -55,7 +52,7 @@
  */
 public class AppsSearchContainerLayout extends ExtendedEditText
         implements SearchUiManager, AllAppsSearchBarController.Callbacks,
-        AllAppsStore.OnUpdateListener {
+        AllAppsStore.OnUpdateListener, Insettable {
 
 
     private final Launcher mLauncher;
@@ -64,7 +61,6 @@
 
     private AlphabeticalAppsList mApps;
     private AllAppsContainerView mAppsView;
-    private SpringAnimation mSpring;
 
     public AppsSearchContainerLayout(Context context) {
         this(context, null);
@@ -91,9 +87,6 @@
         spanned.setSpan(new TintedDrawableSpan(getContext(), R.drawable.ic_allapps_search),
                 0, 1, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);
         setHint(spanned);
-
-        // Note: This spring does nothing.
-        mSpring = new SpringAnimation(new FloatValueHolder()).setSpring(new SpringForce(0));
     }
 
     @Override
@@ -146,11 +139,6 @@
     }
 
     @Override
-    public @NonNull SpringAnimation getSpringForFling() {
-        return mSpring;
-    }
-
-    @Override
     public void onAppsUpdated() {
         mSearchBarController.refreshSearchResult();
     }
@@ -206,22 +194,15 @@
     }
 
     @Override
-    public void addOnScrollRangeChangeListener(final OnScrollRangeChangeListener listener) {
-        mLauncher.getHotseat().addOnLayoutChangeListener(new OnLayoutChangeListener() {
-            @Override
-            public void onLayoutChange(View v, int left, int top, int right, int bottom,
-                    int oldLeft, int oldTop, int oldRight, int oldBottom) {
-                DeviceProfile dp = mLauncher.getDeviceProfile();
-                if (!dp.isVerticalBarLayout()) {
-                    Rect insets = dp.getInsets();
-                    int hotseatBottom = bottom - dp.hotseatBarBottomPaddingPx - insets.bottom;
-                    MarginLayoutParams mlp = ((MarginLayoutParams) getLayoutParams());
-                    int myBot = mlp.topMargin + (int) getTranslationY() + mlp.height;
-                    listener.onScrollRangeChanged(hotseatBottom - myBot);
-                } else {
-                    listener.onScrollRangeChanged(bottom);
-                }
-            }
-        });
+    public void setInsets(Rect insets) {
+        DeviceProfile dp = mLauncher.getDeviceProfile();
+        if (dp.isVerticalBarLayout()) {
+            mLauncher.getAllAppsController().setScrollRangeDelta(0);
+        } else {
+            MarginLayoutParams mlp = ((MarginLayoutParams) getLayoutParams());
+            int myBot = mlp.topMargin + (int) getTranslationY() + mlp.height;
+            mLauncher.getAllAppsController().setScrollRangeDelta(
+                    dp.hotseatBarBottomPaddingPx + myBot);
+        }
     }
 }
diff --git a/src/com/android/launcher3/model/FirstScreenBroadcast.java b/src/com/android/launcher3/model/FirstScreenBroadcast.java
index 2736509..1149b55 100644
--- a/src/com/android/launcher3/model/FirstScreenBroadcast.java
+++ b/src/com/android/launcher3/model/FirstScreenBroadcast.java
@@ -135,10 +135,10 @@
 
         context.sendBroadcast(new Intent(ACTION_FIRST_SCREEN_ACTIVE_INSTALLS)
                 .setPackage(installerPackageName)
-                .putExtra(FOLDER_ITEM_EXTRA, folderItems.toArray())
-                .putExtra(WORKSPACE_ITEM_EXTRA, workspaceItems.toArray())
-                .putExtra(HOTSEAT_ITEM_EXTRA, hotseatItems.toArray())
-                .putExtra(WIDGET_ITEM_EXTRA, widgetItems.toArray())
+                .putStringArrayListExtra(FOLDER_ITEM_EXTRA, new ArrayList<>(folderItems))
+                .putStringArrayListExtra(WORKSPACE_ITEM_EXTRA, new ArrayList<>(workspaceItems))
+                .putStringArrayListExtra(HOTSEAT_ITEM_EXTRA, new ArrayList<>(hotseatItems))
+                .putStringArrayListExtra(WIDGET_ITEM_EXTRA, new ArrayList<>(widgetItems))
                 .putExtra(VERIFICATION_TOKEN_EXTRA, PendingIntent.getActivity(context, 0,
                         new Intent(), PendingIntent.FLAG_ONE_SHOT)));
     }
diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java
index dc86aec..709a7e5 100644
--- a/src/com/android/launcher3/views/OptionsPopupView.java
+++ b/src/com/android/launcher3/views/OptionsPopupView.java
@@ -107,7 +107,7 @@
 
     private boolean handleViewClick(View view, int action) {
         if (view.getId() == R.id.wallpaper_button) {
-            mLauncher.onClickWallpaperPicker(null);
+            mLauncher.onClickWallpaperPicker(view);
             logTap(action, ControlType.WALLPAPER_BUTTON);
             close(true);
             return true;
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/UiFactory.java b/src_ui_overrides/com/android/launcher3/uioverrides/UiFactory.java
index e0b76fd..be9d5b7 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/UiFactory.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/UiFactory.java
@@ -38,5 +38,7 @@
 
     public static void onStart(Launcher launcher) { }
 
+    public static void onLauncherStateOrResumeChanged(Launcher launcher) { }
+
     public static void onTrimMemory(Launcher launcher, int level) { }
 }