mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Only register Launcher back-callback when ROLE_HOME is held.
When using a 3P Launcher, i.e. when the ROLE_HOME is not held by QuickstepLauncher, there should be no back callback registered with SystemUI. Bug: 374882166 Flag: EXEMPT bugfix Test: Manual, i.e. verified back-callback registration updates in SystemUI and also verified that back-to-home navigations in Nova Launcher are responsive. Change-Id: I03187f80a4c3c893a6529f0a22613f6fdfe7b7b3
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.launcher3;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.role.RoleManager.ROLE_HOME;
|
||||
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
|
||||
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
|
||||
import static android.view.RemoteAnimationTarget.MODE_OPENING;
|
||||
@@ -74,6 +75,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.WindowConfiguration;
|
||||
import android.app.role.RoleManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
@@ -1194,7 +1196,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
.registerRemoteTransition(mLauncherOpenTransition, homeCheck);
|
||||
if (mBackAnimationController != null) {
|
||||
mBackAnimationController.registerComponentCallbacks();
|
||||
mBackAnimationController.registerBackCallbacks(mHandler);
|
||||
if (isHomeRoleHeld()) {
|
||||
mBackAnimationController.registerBackCallbacks(mHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1207,6 +1211,22 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
.unregisterContentObserver(mAnimationRemovalObserver));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the overview-target changes. Updates the back callback registration state.
|
||||
*/
|
||||
public void onOverviewTargetChange() {
|
||||
if (isHomeRoleHeld()) {
|
||||
mBackAnimationController.registerBackCallbacks(mHandler);
|
||||
} else {
|
||||
mBackAnimationController.unregisterBackCallbacks();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isHomeRoleHeld() {
|
||||
RoleManager roleManager = mLauncher.getSystemService(RoleManager.class);
|
||||
return roleManager == null || roleManager.isRoleHeld(ROLE_HOME);
|
||||
}
|
||||
|
||||
private void unregisterRemoteAnimations() {
|
||||
if (SEPARATE_RECENTS_ACTIVITY.get()) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user