diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d8cb06ce22..2945b22943 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -474,13 +474,6 @@ public class Launcher extends BaseActivity private LauncherCallbacks mLauncherCallbacks; - public void onPostCreate(Bundle savedInstanceState) { - super.onPostCreate(savedInstanceState); - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onPostCreate(savedInstanceState); - } - } - public void onInsetsChanged(Rect insets) { mDeviceProfile.updateInsets(insets); mDeviceProfile.layout(this, true /* notifyListeners */); @@ -845,9 +838,6 @@ public class Launcher extends BaseActivity @Override protected void onResume() { TraceHelper.beginSection("ON_RESUME"); - if (mLauncherCallbacks != null) { - mLauncherCallbacks.preOnResume(); - } super.onResume(); TraceHelper.partitionSection("ON_RESUME", "superCall"); @@ -868,9 +858,6 @@ public class Launcher extends BaseActivity } setOnResumeCallback(null); - - updateInteraction(Workspace.State.NORMAL, mWorkspace.getState()); - // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue( InstallShortcutReceiver.FLAG_ACTIVITY_PAUSED, this); @@ -1500,11 +1487,7 @@ public class Launcher extends BaseActivity // as slow logic in the callbacks eat into the time the scroller expects for the snapToPage // animation. if (isActionMain) { - boolean callbackAllowsMoveToDefaultScreen = - mLauncherCallbacks == null || mLauncherCallbacks - .shouldMoveToDefaultScreenOnHomeIntent(); - if (shouldMoveToDefaultScreen && !mWorkspace.isTouchActive() - && callbackAllowsMoveToDefaultScreen) { + if (shouldMoveToDefaultScreen && !mWorkspace.isTouchActive()) { mWorkspace.post(new Runnable() { @Override @@ -1711,25 +1694,11 @@ public class Launcher extends BaseActivity } private void setWorkspaceLoading(boolean value) { - boolean isLocked = isWorkspaceLocked(); mWorkspaceLoading = value; - if (isLocked != isWorkspaceLocked()) { - onWorkspaceLockedChanged(); - } } public void setWaitingForResult(PendingRequestArgs args) { - boolean isLocked = isWorkspaceLocked(); mPendingRequestArgs = args; - if (isLocked != isWorkspaceLocked()) { - onWorkspaceLockedChanged(); - } - } - - protected void onWorkspaceLockedChanged() { - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onWorkspaceLockedChanged(); - } } void addAppWidgetFromDropImpl(int appWidgetId, ItemInfo info, AppWidgetHostView boundWidget, @@ -2245,44 +2214,6 @@ public class Launcher extends BaseActivity mDragLayer.onAccessibilityStateChanged(enabled); } - /** - * Called when the user stops interacting with the launcher. - * This implies that the user is now on the homescreen and is not doing housekeeping. - */ - protected void onInteractionEnd() { - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onInteractionEnd(); - } - } - - /** - * Called when the user starts interacting with the launcher. - * The possible interactions are: - * - open all apps - * - reorder an app shortcut, or a widget - * - open the overview mode. - * This is a good time to stop doing things that only make sense - * when the user is on the homescreen and not doing housekeeping. - */ - protected void onInteractionBegin() { - if (mLauncherCallbacks != null) { - mLauncherCallbacks.onInteractionBegin(); - } - } - - /** Updates the interaction state. */ - public void updateInteraction(Workspace.State fromState, Workspace.State toState) { - // Only update the interacting state if we are transitioning to/from a view with an - // overlay - boolean fromStateWithOverlay = fromState != Workspace.State.NORMAL; - boolean toStateWithOverlay = toState != Workspace.State.NORMAL; - if (toStateWithOverlay) { - onInteractionBegin(); - } else if (fromStateWithOverlay) { - onInteractionEnd(); - } - } - private void startShortcutIntentSafely(Intent intent, Bundle optsBundle, ItemInfo info) { try { StrictMode.VmPolicy oldPolicy = StrictMode.getVmPolicy(); @@ -2683,18 +2614,6 @@ public class Launcher extends BaseActivity return true; } - /** - * Updates the workspace and interaction state on state change, and return the animation to this - * new state. - */ - public Animator startWorkspaceStateChangeAnimation(Workspace.State toState, - boolean animated, AnimationLayerSet layerViews) { - Workspace.State fromState = mWorkspace.getState(); - Animator anim = mWorkspace.setStateWithAnimation(toState, animated, layerViews); - updateInteraction(fromState, toState); - return anim; - } - public void enterSpringLoadedDragMode() { if (LOGD) Log.d(TAG, String.format("enterSpringLoadedDragMode [mState=%s", mState.name())); if (isStateSpringLoaded()) { @@ -3273,10 +3192,6 @@ public class Launcher extends BaseActivity InstallShortcutReceiver.FLAG_LOADER_RUNNING, this); NotificationListener.setNotificationsChangedListener(mPopupDataProvider); - - if (mLauncherCallbacks != null) { - mLauncherCallbacks.finishBindingItems(false); - } TraceHelper.endSection("finishBindingItems"); } diff --git a/src/com/android/launcher3/LauncherCallbacks.java b/src/com/android/launcher3/LauncherCallbacks.java index 2c9a23fa98..78d753ac86 100644 --- a/src/com/android/launcher3/LauncherCallbacks.java +++ b/src/com/android/launcher3/LauncherCallbacks.java @@ -39,14 +39,12 @@ public interface LauncherCallbacks { */ void preOnCreate(); void onCreate(Bundle savedInstanceState); - void preOnResume(); void onResume(); void onStart(); void onStop(); void onPause(); void onDestroy(); void onSaveInstanceState(Bundle outState); - void onPostCreate(Bundle savedInstanceState); void onNewIntent(Intent intent); void onActivityResult(int requestCode, int resultCode, Intent data); void onRequestPermissionsResult(int requestCode, String[] permissions, @@ -64,13 +62,7 @@ public interface LauncherCallbacks { * Extension points for providing custom behavior on certain user interactions. */ void onLauncherProviderChange(); - void finishBindingItems(final boolean upgradePath); void bindAllApplications(ArrayList apps); - void onInteractionBegin(); - void onInteractionEnd(); - - @Deprecated - void onWorkspaceLockedChanged(); /** * Starts a search with {@param initialQuery}. Return false if search was not started. @@ -81,6 +73,5 @@ public interface LauncherCallbacks { /* * Extensions points for adding / replacing some other aspects of the Launcher experience. */ - boolean shouldMoveToDefaultScreenOnHomeIntent(); boolean hasSettings(); } diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index e2474900da..be0ed0cef4 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -361,8 +361,8 @@ public class LauncherStateTransitionAnimation { AnimationLayerSet layerViews) { // Create the workspace animation. // NOTE: this call apparently also sets the state for the workspace if !animated - Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, - animated, layerViews); + Animator workspaceAnim = mLauncher.getWorkspace(). + setStateWithAnimation(toWorkspaceState, animated, layerViews); if (animated && initialized) { // Play the workspace animation diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 0ae47224ee..1f26965044 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -402,7 +402,6 @@ public class Workspace extends PagedView updateChildrenLayersEnabled(); mLauncher.lockScreenOrientation(); - mLauncher.onInteractionBegin(); // Prevent any Un/InstallShortcutReceivers from updating the db while we are dragging InstallShortcutReceiver.enableInstallQueue(InstallShortcutReceiver.FLAG_DRAG_AND_DROP); @@ -462,7 +461,6 @@ public class Workspace extends PagedView mOutlineProvider = null; mDragSourceInternal = null; - mLauncher.onInteractionEnd(); } /** diff --git a/src/com/android/launcher3/testing/LauncherExtension.java b/src/com/android/launcher3/testing/LauncherExtension.java index a1a4d75557..c40e1fbe4f 100644 --- a/src/com/android/launcher3/testing/LauncherExtension.java +++ b/src/com/android/launcher3/testing/LauncherExtension.java @@ -35,10 +35,6 @@ public class LauncherExtension extends Launcher { public void onCreate(Bundle savedInstanceState) { } - @Override - public void preOnResume() { - } - @Override public void onResume() { } @@ -63,10 +59,6 @@ public class LauncherExtension extends Launcher { public void onSaveInstanceState(Bundle outState) { } - @Override - public void onPostCreate(Bundle savedInstanceState) { - } - @Override public void onNewIntent(Intent intent) { } @@ -110,37 +102,16 @@ public class LauncherExtension extends Launcher { public void onLauncherProviderChange() { } - @Override - public void finishBindingItems(boolean upgradePath) { - } - @Override public void bindAllApplications(ArrayList apps) { } - @Override - public void onWorkspaceLockedChanged() { - } - - @Override - public void onInteractionBegin() { - } - - @Override - public void onInteractionEnd() { - } - @Override public boolean startSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData) { return false; } - @Override - public boolean shouldMoveToDefaultScreenOnHomeIntent() { - return true; - } - @Override public boolean hasSettings() { return false;