Patch fix for Android 13 and below (#4978)

* Patch fix for Android 13 and below
tested in Android 9, 10 and 13 and works fine.

* fix crash dragging the icons from drawer to home screen

* use LawnchairWindowManagerProxy

---------

Co-authored-by: MrSluffy <werdna.jac@gmail.com>
This commit is contained in:
Rafael de Moura DevandMrSluffy authored and GitHub committed 2024-11-17 09:05:31 +08:00
1 parent 71fbccb5a3
commit 795fdb2948
37 files changed
+605 -198

No files matched your search

@@ -38,6 +38,7 @@ import com.android.app.animation.Interpolators;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.config.FeatureFlags;
@@ -196,7 +197,9 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
if (enablePredictiveBackGesture()) {
mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
OnBackInvokedDispatcher dispatcher;
if (!Utilities.ATLEAST_U) return;
dispatcher = findOnBackInvokedDispatcher();
if (dispatcher != null) {
dispatcher.registerOnBackInvokedCallback(
OnBackInvokedDispatcher.PRIORITY_DEFAULT, null);
@@ -211,8 +214,10 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
if (enablePredictiveBackGesture()) {
mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(null);
mAppsView.getAppsRecyclerViewContainer().setClipToOutline(false);
OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
if (dispatcher != null) {
OnBackInvokedDispatcher dispatcher;
if (!Utilities.ATLEAST_U) return;
dispatcher = findOnBackInvokedDispatcher();
if (dispatcher != null && Utilities.ATLEAST_T) {
dispatcher.unregisterOnBackInvokedCallback(null);
}
}