Merge "Fixes the issue Launcher state propagation is slower than onDeferredResume." into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
4c40be975c
@@ -157,6 +157,12 @@ public abstract class BaseQuickstepLauncher extends Launcher
|
||||
@Override
|
||||
protected void onDeferredResumed() {
|
||||
super.onDeferredResumed();
|
||||
handlePendingActivityRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handlePendingActivityRequest() {
|
||||
super.handlePendingActivityRequest();
|
||||
if (mPendingActivityRequestCode != -1 && isInState(NORMAL)) {
|
||||
// Remove any active ProxyActivityStarter task and send RESULT_CANCELED to Launcher.
|
||||
onActivityResult(mPendingActivityRequestCode, RESULT_CANCELED, null);
|
||||
|
||||
@@ -923,6 +923,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
DiscoveryBounce.showForHomeIfNeeded(this);
|
||||
}
|
||||
|
||||
protected void handlePendingActivityRequest() { }
|
||||
|
||||
private void logStopAndResume(int command) {
|
||||
int pageIndex = mWorkspace.isOverlayShown() ? -1 : mWorkspace.getCurrentPage();
|
||||
@@ -1423,7 +1424,8 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
if (!isInState(NORMAL)) {
|
||||
// Only change state, if not already the same. This prevents cancelling any
|
||||
// animations running as part of resume
|
||||
mStateManager.goToState(NORMAL);
|
||||
mStateManager.goToState(NORMAL, mStateManager.shouldAnimateStateChange(),
|
||||
this::handlePendingActivityRequest);
|
||||
}
|
||||
|
||||
// Reset the apps view
|
||||
|
||||
Reference in New Issue
Block a user