Removing some obsolete callbacks
Change-Id: I3cf19a13ff145923f2973e23c24033f196324aa3
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index d8cb06c..2945b22 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -474,13 +474,6 @@
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 @@
@Override
protected void onResume() {
TraceHelper.beginSection("ON_RESUME");
- if (mLauncherCallbacks != null) {
- mLauncherCallbacks.preOnResume();
- }
super.onResume();
TraceHelper.partitionSection("ON_RESUME", "superCall");
@@ -868,9 +858,6 @@
}
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 @@
// 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 @@
}
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 @@
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 @@
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 @@
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 2c9a23f..78d753a 100644
--- a/src/com/android/launcher3/LauncherCallbacks.java
+++ b/src/com/android/launcher3/LauncherCallbacks.java
@@ -39,14 +39,12 @@
*/
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 @@
* Extension points for providing custom behavior on certain user interactions.
*/
void onLauncherProviderChange();
- void finishBindingItems(final boolean upgradePath);
void bindAllApplications(ArrayList<AppInfo> 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 @@
/*
* 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 e247490..be0ed0c 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -361,8 +361,8 @@
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 0ae4722..1f26965 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -402,7 +402,6 @@
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 @@
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 a1a4d75..c40e1fb 100644
--- a/src/com/android/launcher3/testing/LauncherExtension.java
+++ b/src/com/android/launcher3/testing/LauncherExtension.java
@@ -36,10 +36,6 @@
}
@Override
- public void preOnResume() {
- }
-
- @Override
public void onResume() {
}
@@ -64,10 +60,6 @@
}
@Override
- public void onPostCreate(Bundle savedInstanceState) {
- }
-
- @Override
public void onNewIntent(Intent intent) {
}
@@ -111,37 +103,16 @@
}
@Override
- public void finishBindingItems(boolean upgradePath) {
- }
-
- @Override
public void bindAllApplications(ArrayList<AppInfo> 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;
}