mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
@@ -25,6 +25,7 @@ import android.view.View;
|
|||||||
import android.view.View.OnAttachStateChangeListener;
|
import android.view.View.OnAttachStateChangeListener;
|
||||||
import android.view.ViewRootImpl;
|
import android.view.ViewRootImpl;
|
||||||
|
|
||||||
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.quickstep.RemoteAnimationTargets.ReleaseCheck;
|
import com.android.quickstep.RemoteAnimationTargets.ReleaseCheck;
|
||||||
|
|
||||||
import app.lawnchair.compat.LawnchairQuickstepCompat;
|
import app.lawnchair.compat.LawnchairQuickstepCompat;
|
||||||
@@ -76,7 +77,11 @@ public class SurfaceTransactionApplier extends ReleaseCheck {
|
|||||||
|
|
||||||
private void initialize(View view) {
|
private void initialize(View view) {
|
||||||
mTargetViewRootImpl = view.getViewRootImpl();
|
mTargetViewRootImpl = view.getViewRootImpl();
|
||||||
mBarrierSurfaceControl = mTargetViewRootImpl.getSurfaceControl();
|
try {
|
||||||
|
mBarrierSurfaceControl = mTargetViewRootImpl.getSurfaceControl();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
mInitialized = true;
|
mInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +114,7 @@ public class SurfaceTransactionApplier extends ReleaseCheck {
|
|||||||
final int toApplySeqNo = mLastSequenceNumber;
|
final int toApplySeqNo = mLastSequenceNumber;
|
||||||
setCanRelease(false);
|
setCanRelease(false);
|
||||||
mTargetViewRootImpl.registerRtFrameCallback(frame -> {
|
mTargetViewRootImpl.registerRtFrameCallback(frame -> {
|
||||||
|
if (mBarrierSurfaceControl == null && !Utilities.ATLEAST_Q) return;
|
||||||
if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
|
if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
|
||||||
Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0)
|
Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0)
|
||||||
.sendToTarget();
|
.sendToTarget();
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class TaskStackChangeListeners {
|
|||||||
if (!LawnchairQuickstepCompat.ATLEAST_V) return;
|
if (!LawnchairQuickstepCompat.ATLEAST_V) return;
|
||||||
ActivityTaskManager.getService().registerTaskStackListener(this);
|
ActivityTaskManager.getService().registerTaskStackListener(this);
|
||||||
mRegistered = true;
|
mRegistered = true;
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
Log.w(TAG, "Failed to call registerTaskStackListener", e);
|
Log.w(TAG, "Failed to call registerTaskStackListener", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ public class TaskStackChangeListeners {
|
|||||||
if (!LawnchairQuickstepCompat.ATLEAST_V) return;
|
if (!LawnchairQuickstepCompat.ATLEAST_V) return;
|
||||||
ActivityTaskManager.getService().unregisterTaskStackListener(this);
|
ActivityTaskManager.getService().unregisterTaskStackListener(this);
|
||||||
mRegistered = false;
|
mRegistered = false;
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
Log.w(TAG, "Failed to call unregisterTaskStackListener", e);
|
Log.w(TAG, "Failed to call unregisterTaskStackListener", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user