Merge "Set mIsAnimationPending when the leash is not ready" into sc-dev
This commit is contained in:
@@ -1131,7 +1131,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final InsetsSourceControl control = consumer.getControl();
|
final InsetsSourceControl control = consumer.getControl();
|
||||||
if (control != null) {
|
if (control != null && control.getLeash() != null) {
|
||||||
controls.put(consumer.getType(), new InsetsSourceControl(control));
|
controls.put(consumer.getType(), new InsetsSourceControl(control));
|
||||||
typesReady |= toPublicType(consumer.getType());
|
typesReady |= toPublicType(consumer.getType());
|
||||||
} else if (animationType == ANIMATION_TYPE_SHOW) {
|
} else if (animationType == ANIMATION_TYPE_SHOW) {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import static com.android.internal.annotations.VisibleForTesting.Visibility.PACK
|
|||||||
|
|
||||||
import android.annotation.IntDef;
|
import android.annotation.IntDef;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.graphics.Insets;
|
||||||
import android.graphics.Rect;
|
import android.graphics.Rect;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.imetracing.ImeTracing;
|
import android.util.imetracing.ImeTracing;
|
||||||
@@ -240,10 +241,6 @@ public class InsetsSourceConsumer {
|
|||||||
mHasWindowFocus = false;
|
mHasWindowFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasWindowFocus() {
|
|
||||||
return mHasWindowFocus;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean hasViewFocusWhenWindowFocusGain() {
|
boolean hasViewFocusWhenWindowFocusGain() {
|
||||||
return mHasViewFocusWhenWindowFocusGain;
|
return mHasViewFocusWhenWindowFocusGain;
|
||||||
}
|
}
|
||||||
@@ -366,7 +363,16 @@ public class InsetsSourceConsumer {
|
|||||||
protected void setRequestedVisible(boolean requestedVisible) {
|
protected void setRequestedVisible(boolean requestedVisible) {
|
||||||
if (mRequestedVisible != requestedVisible) {
|
if (mRequestedVisible != requestedVisible) {
|
||||||
mRequestedVisible = requestedVisible;
|
mRequestedVisible = requestedVisible;
|
||||||
mIsAnimationPending = false;
|
|
||||||
|
// We need an animation later if the leash of a real control (which has an insets hint)
|
||||||
|
// is not ready. The !mIsAnimationPending check is in case that the requested visibility
|
||||||
|
// is changed twice before playing the animation -- we don't need an animation in this
|
||||||
|
// case.
|
||||||
|
mIsAnimationPending = !mIsAnimationPending
|
||||||
|
&& mSourceControl != null
|
||||||
|
&& mSourceControl.getLeash() == null
|
||||||
|
&& !Insets.NONE.equals(mSourceControl.getInsetsHint());
|
||||||
|
|
||||||
mController.onRequestedVisibilityChanged(this);
|
mController.onRequestedVisibilityChanged(this);
|
||||||
if (DEBUG) Log.d(TAG, "setRequestedVisible: " + requestedVisible);
|
if (DEBUG) Log.d(TAG, "setRequestedVisible: " + requestedVisible);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user