Support individual lock task features

- If screen pinning is enabled, disable gestures and wrap with input
  consumer to break out of screen pinning (existing logic)
- If Home & Overview are both disabled, disable gestures completely
- If only Home is disabled, then always launch the user into fallback
  recents (to simplify logic around breaking out of overview into Home)
- If only Overview is disabled, then prevent swiping from going into
  overview or from triggering overview from home
- Switch to using screen pinning flag check instead of binder call

Bug: 133113732
Bug: 131698989

Change-Id: Ie6f447520d4cc3fa1eaaf8427ee014851688bf37
This commit is contained in:
Winson Chung
2019-05-23 13:56:10 -07:00
parent 9e26fccacc
commit dd71ca0437
7 changed files with 96 additions and 38 deletions

View File

@@ -26,6 +26,7 @@ import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
@@ -46,9 +47,11 @@ import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.uioverrides.states.OverviewState;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TouchInteractionService;
import com.android.quickstep.util.LayoutUtils;
import com.android.systemui.shared.system.QuickStepContract;
/**
* Touch controller for handling various state transitions in portrait UI.
@@ -135,7 +138,10 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
} else if (fromState == OVERVIEW) {
return isDragTowardPositive ? ALL_APPS : NORMAL;
} else if (fromState == NORMAL && isDragTowardPositive) {
int stateFlags = OverviewInteractionState.INSTANCE.get(mLauncher)
.getSystemUiStateFlags();
return mAllowDragToOverview && TouchInteractionService.isConnected()
&& (stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0
? OVERVIEW : ALL_APPS;
}
return fromState;