diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 9d31492daf..030d625124 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -867,17 +867,10 @@ public class Launcher extends BaseActivity if (mOnResumeState == State.WORKSPACE) { showWorkspace(false); } else if (mOnResumeState == State.APPS) { - boolean launchedFromApp = (mWaitingForResume != null); - // Don't update the predicted apps if the user is returning to launcher in the apps - // view after launching an app, as they may be depending on the UI to be static to - // switch to another app, otherwise, if it was - showAppsView(false /* animated */, !launchedFromApp /* updatePredictedApps */); + showAppsView(false /* animated */); } else if (mOnResumeState == State.WIDGETS) { showWidgetsView(false, false); } - if (mOnResumeState != State.APPS) { - tryAndUpdatePredictedApps(); - } mOnResumeState = State.NONE; mPaused = false; @@ -2108,7 +2101,7 @@ public class Launcher extends BaseActivity if (!isAppsViewVisible()) { getUserEventDispatcher().logActionOnControl(Action.Touch.TAP, ControlType.ALL_APPS_BUTTON); - showAppsView(true /* animated */, true /* updatePredictedApps */); + showAppsView(true /* animated */); } else { showWorkspace(true); } @@ -2673,11 +2666,8 @@ public class Launcher extends BaseActivity /** * Shows the apps view. */ - public void showAppsView(boolean animated, boolean updatePredictedApps) { + public void showAppsView(boolean animated) { markAppsViewShown(); - if (updatePredictedApps) { - tryAndUpdatePredictedApps(); - } showAppsOrWidgets(State.APPS, animated); } @@ -2797,7 +2787,7 @@ public class Launcher extends BaseActivity public void exitSpringLoadedDragMode() { if (mState == State.APPS_SPRING_LOADED) { - showAppsView(true /* animated */, false /* updatePredictedApps */); + showAppsView(true /* animated */); } else if (mState == State.WIDGETS_SPRING_LOADED) { showWidgetsView(true, false); } else if (mState == State.WORKSPACE_SPRING_LOADED) { @@ -2805,19 +2795,6 @@ public class Launcher extends BaseActivity } } - /** - * Updates the set of predicted apps if it hasn't been updated since the last time Launcher was - * resumed. - */ - public void tryAndUpdatePredictedApps() { - if (mLauncherCallbacks != null) { - List> apps = mLauncherCallbacks.getPredictedApps(); - if (apps != null) { - mAppsView.setPredictedApps(apps); - } - } - } - @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { final boolean result = super.dispatchPopulateAccessibilityEvent(event); @@ -3532,7 +3509,6 @@ public class Launcher extends BaseActivity // Update AllApps if (mAppsView != null) { mAppsView.removeApps(appInfos); - tryAndUpdatePredictedApps(); } } @@ -3696,7 +3672,7 @@ public class Launcher extends BaseActivity switch (keyCode) { case KeyEvent.KEYCODE_A: if (mState == State.WORKSPACE) { - showAppsView(true, true); + showAppsView(true); return true; } break; diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java index d1e2b621a3..2c9a23fa98 100644 --- a/src/com/android/launcher3/LauncherCallbacks.java +++ b/src/com/android/launcher3/LauncherCallbacks.java @@ -19,14 +19,10 @@ package com.android.launcher3; import android.content.Intent; import android.os.Bundle; import android.view.Menu; -import android.view.View; - -import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; -import java.util.List; /** * LauncherCallbacks is an interface used to extend the Launcher activity. It includes many hooks @@ -87,5 +83,4 @@ public interface LauncherCallbacks { */ boolean shouldMoveToDefaultScreenOnHomeIntent(); boolean hasSettings(); - List> getPredictedApps(); } diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 4eba5c6df6..246a77a172 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -114,13 +114,6 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc } } - /** - * Sets the current set of predicted apps. - */ - public void setPredictedApps(List> apps) { - mApps.setPredictedApps(apps); - } - /** * Sets the current set of apps. */ diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index f249c90c9b..2cc0781199 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -216,7 +216,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } - mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */); + mLauncher.showAppsView(true /* animated */); if (hasSpringAnimationHandler()) { mSpringAnimationHandler.add(mSearchSpring, true /* setDefaultValues */); // The icons are moving upwards, so we go to 0 from 1. (y-axis 1 is below 0.) @@ -239,7 +239,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect Action.Direction.UP, containerType); } - mLauncher.showAppsView(true, /* animated */ false /* updatePredictedApps */); + mLauncher.showAppsView(true /* animated */); } } } @@ -256,10 +256,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect // Initialize values that should not change until #onDragEnd mStatusBarHeight = mLauncher.getDragLayer().getInsets().top; mHotseat.setVisibility(View.VISIBLE); - if (!mLauncher.isAllAppsVisible()) { - mLauncher.tryAndUpdatePredictedApps(); - mAppsView.setVisibility(View.VISIBLE); - } + mAppsView.setVisibility(View.VISIBLE); } } diff --git a/src/com/android/launcher3/testing/LauncherExtension.java b/src/com/android/launcher3/testing/LauncherExtension.java index 355963bfeb..a1a4d75557 100644 --- a/src/com/android/launcher3/testing/LauncherExtension.java +++ b/src/com/android/launcher3/testing/LauncherExtension.java @@ -7,13 +7,10 @@ import android.view.Menu; import com.android.launcher3.AppInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherCallbacks; -import com.android.launcher3.util.ComponentKey; -import com.android.launcher3.util.ComponentKeyMapper; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; -import java.util.List; /** * This class represents a very trivial LauncherExtension. It primarily serves as a simple @@ -149,12 +146,6 @@ public class LauncherExtension extends Launcher { return false; } - @Override - public List> getPredictedApps() { - // To debug app predictions, enable AlphabeticalAppsList#DEBUG_PREDICTIONS - return new ArrayList<>(); - } - @Override public void onAttachedToWindow() { }