catch CrossWindowBlurListeners.getInstance() no method not found

This commit is contained in:
MrSluffy
2024-12-02 08:33:39 +08:00
parent 0b22694aa9
commit a0ff30bf2a
3 changed files with 20 additions and 12 deletions

View File

@@ -2203,8 +2203,12 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
private static class LaunchDepthController extends DepthController {
LaunchDepthController(QuickstepLauncher launcher) {
super(launcher);
setCrossWindowBlursEnabled(
CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled());
try {
setCrossWindowBlursEnabled(
CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled());
} catch (Throwable t) {
// ignore
}
// Make sure that the starting value matches the current depth set by the main
// controller.
stateDepth.setValue(launcher.getDepthController().stateDepth.getValue());

View File

@@ -90,9 +90,11 @@ public class DepthController extends BaseDepthController implements StateHandler
mOnAttachListener = new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View view) {
if (LawnchairQuickstepCompat.ATLEAST_S) {
try {
CrossWindowBlurListeners.getInstance().addListener(mLauncher.getMainExecutor(),
mCrossWindowBlurListener);
} catch (Throwable t) {
// Ignore
}
mLauncher.getScrimView().addOpaquenessListener(mOpaquenessListener);
@@ -127,8 +129,12 @@ public class DepthController extends BaseDepthController implements StateHandler
}
private void removeSecondaryListeners() {
if (mCrossWindowBlurListener != null && LawnchairQuickstepCompat.ATLEAST_S) {
CrossWindowBlurListeners.getInstance().removeListener(mCrossWindowBlurListener);
if (mCrossWindowBlurListener != null) {
try {
CrossWindowBlurListeners.getInstance().removeListener(mCrossWindowBlurListener);
} catch (Throwable t) {
// Ignore
}
}
if (mOpaquenessListener != null) {
mLauncher.getScrimView().removeOpaquenessListener(mOpaquenessListener);