Fixes a bug where the user ends in freescroll state even for regular workspace mode.

The bug happened while reordering pages in overview mode and clicking the back button.
The fix is to check the precodition in enableFreeScroll if we are in a valid state for enabling freescroll (currently only overview mode).

Bug: 33347786
Change-Id: Icc3005fd431569e2b9e3f52d2249de8ba8d13eab
This commit is contained in:
Mario Bertschler
2016-12-21 11:48:48 -08:00
parent c9c57631a9
commit dcc26fc693
2 changed files with 20 additions and 12 deletions

View File

@@ -4115,6 +4115,16 @@ public class Workspace extends PagedView
}
}
@Override
public boolean enableFreeScroll() {
if (getState() == State.OVERVIEW) {
return super.enableFreeScroll();
} else {
Log.w(TAG, "enableFreeScroll called but not in overview: state=" + getState());
return false;
}
}
/**
* Used as a workaround to ensure that the AppWidgetService receives the
* PACKAGE_ADDED broadcast before updating widgets.