Merge "Fising launcher stuck on blur" into udc-dev am: ef6fbb5be8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23621509 Change-Id: If64c755fcc56c9c66649b709f518e70d3e03d356 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2042,10 +2042,5 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
|||||||
setCrossWindowBlursEnabled(
|
setCrossWindowBlursEnabled(
|
||||||
CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled());
|
CrossWindowBlurListeners.getInstance().isCrossWindowBlurEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSurface(SurfaceControl surface) {
|
|
||||||
super.setSurface(surface);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ public class DepthController extends BaseDepthController implements StateHandler
|
|||||||
super.applyDepthAndBlur();
|
super.applyDepthAndBlur();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onInvalidSurface() {
|
||||||
|
// Lets wait for surface to become valid again
|
||||||
|
mLauncher.getDragLayer().getViewTreeObserver().addOnDrawListener(mOnDrawListener);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
|
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
|
||||||
mIgnoreStateChangesDuringMultiWindowAnimation = true;
|
mIgnoreStateChangesDuringMultiWindowAnimation = true;
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ public class BaseDepthController {
|
|||||||
*/
|
*/
|
||||||
protected boolean mInEarlyWakeUp;
|
protected boolean mInEarlyWakeUp;
|
||||||
|
|
||||||
|
private boolean mWaitingOnSurfaceValidity;
|
||||||
|
|
||||||
public BaseDepthController(Launcher activity) {
|
public BaseDepthController(Launcher activity) {
|
||||||
mLauncher = activity;
|
mLauncher = activity;
|
||||||
mMaxBlurRadius = activity.getResources().getInteger(R.integer.max_depth_blur_radius);
|
mMaxBlurRadius = activity.getResources().getInteger(R.integer.max_depth_blur_radius);
|
||||||
@@ -115,6 +117,8 @@ public class BaseDepthController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void onInvalidSurface() { }
|
||||||
|
|
||||||
protected void applyDepthAndBlur() {
|
protected void applyDepthAndBlur() {
|
||||||
float depth = mDepth;
|
float depth = mDepth;
|
||||||
IBinder windowToken = mLauncher.getRootView().getWindowToken();
|
IBinder windowToken = mLauncher.getRootView().getWindowToken();
|
||||||
@@ -128,9 +132,15 @@ public class BaseDepthController {
|
|||||||
if (!BlurUtils.supportsBlursOnWindows()) {
|
if (!BlurUtils.supportsBlursOnWindows()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mSurface == null || !mSurface.isValid()) {
|
if (mSurface == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!mSurface.isValid()) {
|
||||||
|
mWaitingOnSurfaceValidity = true;
|
||||||
|
onInvalidSurface();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mWaitingOnSurfaceValidity = false;
|
||||||
boolean hasOpaqueBg = mLauncher.getScrimView().isFullyOpaque();
|
boolean hasOpaqueBg = mLauncher.getScrimView().isFullyOpaque();
|
||||||
boolean isSurfaceOpaque = !mHasContentBehindLauncher && hasOpaqueBg && !mPauseBlurs;
|
boolean isSurfaceOpaque = !mHasContentBehindLauncher && hasOpaqueBg && !mPauseBlurs;
|
||||||
|
|
||||||
@@ -174,7 +184,7 @@ public class BaseDepthController {
|
|||||||
* Sets the specified app target surface to apply the blur to.
|
* Sets the specified app target surface to apply the blur to.
|
||||||
*/
|
*/
|
||||||
protected void setSurface(SurfaceControl surface) {
|
protected void setSurface(SurfaceControl surface) {
|
||||||
if (mSurface != surface) {
|
if (mSurface != surface || mWaitingOnSurfaceValidity) {
|
||||||
mSurface = surface;
|
mSurface = surface;
|
||||||
applyDepthAndBlur();
|
applyDepthAndBlur();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user