Fixing crash when swiping up using 3P Launcher
Change-Id: Ia181edc1a00136374b3f0d848beccf0c9acd7b5c
This commit is contained in:
@@ -70,7 +70,7 @@ public final class RecentsActivity extends BaseRecentsActivity {
|
||||
setContentView(R.layout.fallback_recents_activity);
|
||||
mRecentsRootView = findViewById(R.id.drag_layer);
|
||||
mFallbackRecentsView = findViewById(R.id.overview_panel);
|
||||
mRecentsRootView.setup();
|
||||
mRecentsRootView.recreateControllers();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,7 +108,7 @@ public final class RecentsActivity extends BaseRecentsActivity {
|
||||
@Override
|
||||
protected void onHandleConfigChanged() {
|
||||
super.onHandleConfigChanged();
|
||||
mRecentsRootView.setup();
|
||||
mRecentsRootView.recreateControllers();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-18
@@ -50,8 +50,6 @@ import androidx.annotation.UiThread;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.PagedView;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.DiscoveryBounce;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
@@ -351,17 +349,6 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
OverscrollPlugin.class, false /* allowMultiple */);
|
||||
}
|
||||
|
||||
private void onDeferredActivityLaunch() {
|
||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||
mOverviewComponentObserver.getActivityInterface().switchRunningTaskViewToScreenshot(
|
||||
null, () -> {
|
||||
mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */);
|
||||
});
|
||||
} else {
|
||||
mTaskAnimationManager.finishRunningRecentsAnimation(true /* toHome */);
|
||||
}
|
||||
}
|
||||
|
||||
private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() {
|
||||
if (!mDeviceState.isUserUnlocked() || mDeviceState.isButtonNavMode()) {
|
||||
// Skip if not yet unlocked (can't read user shared prefs) or if the current navigation
|
||||
@@ -554,15 +541,15 @@ public class TouchInteractionService extends Service implements PluginListener<O
|
||||
return;
|
||||
}
|
||||
mDeviceState.enableMultipleRegions(baseInputConsumer instanceof OtherActivityInputConsumer);
|
||||
Launcher l = (Launcher) mOverviewComponentObserver
|
||||
.getActivityInterface().getCreatedActivity();
|
||||
if (l == null || !(l.getOverviewPanel() instanceof RecentsView)) {
|
||||
BaseDraggingActivity activity =
|
||||
mOverviewComponentObserver.getActivityInterface().getCreatedActivity();
|
||||
if (activity == null || !(activity.getOverviewPanel() instanceof RecentsView)) {
|
||||
return;
|
||||
}
|
||||
((RecentsView)l.getOverviewPanel())
|
||||
((RecentsView) activity.getOverviewPanel())
|
||||
.setLayoutRotation(mDeviceState.getCurrentActiveRotation(),
|
||||
mDeviceState.getDisplayRotation());
|
||||
l.getDragLayer().recreateControllers();
|
||||
activity.getDragLayer().recreateControllers();
|
||||
}
|
||||
|
||||
private InputConsumer newBaseConsumer(GestureState previousGestureState,
|
||||
|
||||
+2
-4
@@ -21,7 +21,6 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.util.TouchController;
|
||||
@@ -31,13 +30,11 @@ import com.android.quickstep.RecentsActivity;
|
||||
public class RecentsRootView extends BaseDragLayer<RecentsActivity> {
|
||||
|
||||
private static final int MIN_SIZE = 10;
|
||||
private final RecentsActivity mActivity;
|
||||
|
||||
private final Point mLastKnownSize = new Point(MIN_SIZE, MIN_SIZE);
|
||||
|
||||
public RecentsRootView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 1 /* alphaChannelCount */);
|
||||
mActivity = BaseActivity.fromContext(context);
|
||||
setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
| SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
@@ -47,7 +44,8 @@ public class RecentsRootView extends BaseDragLayer<RecentsActivity> {
|
||||
return mLastKnownSize;
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
@Override
|
||||
public void recreateControllers() {
|
||||
mControllers = new TouchController[] {
|
||||
new RecentsTaskController(mActivity),
|
||||
new FallbackNavBarTouchController(mActivity),
|
||||
|
||||
@@ -119,6 +119,7 @@ public class DragLayer extends BaseDragLayer<Launcher> {
|
||||
recreateControllers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateControllers() {
|
||||
mControllers = mActivity.createTouchControllers();
|
||||
}
|
||||
|
||||
@@ -54,6 +54,11 @@ public class SecondaryDragLayer extends BaseDragLayer<SecondaryDisplayLauncher>
|
||||
|
||||
public SecondaryDragLayer(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 1 /* alphaChannelCount */);
|
||||
recreateControllers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateControllers() {
|
||||
mControllers = new TouchController[] {new CloseAllAppsTouchController()};
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ import android.widget.FrameLayout;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.InsettableFrameLayout;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
|
||||
@@ -115,6 +114,11 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
|
||||
mMultiValueAlpha = new MultiValueAlpha(this, alphaChannelCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to reinitialize touch controllers.
|
||||
*/
|
||||
public abstract void recreateControllers();
|
||||
|
||||
/**
|
||||
* Same as {@link #isEventOverView(View, MotionEvent, View)} where evView == this drag layer.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user