Merge changes Ibd9f22af,Id42f5276 into sc-qpr1-dev am: e1841dc539

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15897408

Change-Id: I373e1af0ccbeb47445d9cf7bddb1f6d62e6f7e85
This commit is contained in:
Pablo Gamito
2021-09-28 05:13:42 +00:00
committed by Automerger Merge Worker
5 changed files with 11 additions and 36 deletions

View File

@@ -258,6 +258,8 @@ public abstract class Animation implements Cloneable {
setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL)); setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));
setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0));
setDetachWallpaper( setDetachWallpaper(
a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false)); a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
setShowWallpaper( setShowWallpaper(
@@ -630,15 +632,16 @@ public abstract class Animation implements Cloneable {
} }
/** /**
* Set background behind an animation. * Set background behind animation.
* *
* @param bg The background color. If 0, no background. * @param bg The background color. If 0, no background. Currently must
* be black, with any desired alpha level.
* *
* @deprecated None of window animations are running with background color. * @deprecated None of window animations are running with background color.
*/ */
@Deprecated @Deprecated
public void setBackgroundColor(@ColorInt int bg) { public void setBackgroundColor(@ColorInt int bg) {
mBackgroundColor = bg; // The background color is not needed any more, do nothing.
} }
/** /**
@@ -800,7 +803,7 @@ public abstract class Animation implements Cloneable {
@Deprecated @Deprecated
@ColorInt @ColorInt
public int getBackgroundColor() { public int getBackgroundColor() {
return mBackgroundColor; return 0;
} }
/** /**

View File

@@ -6822,8 +6822,9 @@
content for the duration of the animation. --> content for the duration of the animation. -->
<enum name="bottom" value="-1" /> <enum name="bottom" value="-1" />
</attr> </attr>
<!-- Special background behind animation. Only for use with task animations. <!-- Special background behind animation. Only for use with window
If 0, the default, there is no background. --> animations. Can only be a color, and only black. If 0, the
default, there is no background. -->
<attr name="background" /> <attr name="background" />
<!-- Special option for window animations: if this window is on top <!-- Special option for window animations: if this window is on top
of a wallpaper, don't animate the wallpaper with it. --> of a wallpaper, don't animate the wallpaper with it. -->
@@ -7736,7 +7737,7 @@
<!-- Name of a method on the Context used to inflate the menu that will be <!-- Name of a method on the Context used to inflate the menu that will be
called when the item is clicked. called when the item is clicked.
{@deprecated Menu actually traverses the Context hierarchy looking for the {@deprecated Menu actually traverses the Context hierarchy looking for the
relevant method, which is fragile (an intermediate ContextWrapper adding a relevant method, which is fragile (an intermediate ContextWrapper adding a
same-named method would change behavior) and restricts bytecode optimizers same-named method would change behavior) and restricts bytecode optimizers
such as R8. Instead, use MenuItem.setOnMenuItemClickListener.} --> such as R8. Instead, use MenuItem.setOnMenuItemClickListener.} -->

View File

@@ -16,7 +16,6 @@
package com.android.server.wm; package com.android.server.wm;
import android.annotation.ColorInt;
import android.util.proto.ProtoOutputStream; import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl; import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction; import android.view.SurfaceControl.Transaction;
@@ -107,14 +106,4 @@ interface AnimationAdapter {
default boolean shouldDeferAnimationFinish(Runnable endDeferFinishCallback) { default boolean shouldDeferAnimationFinish(Runnable endDeferFinishCallback) {
return false; return false;
} }
/**
* Gets the background color to show behind an animation.
*
* @return The background color to show behind an animation (0 for no background color).
*/
@ColorInt
default int getBackgroundColor() {
return 0;
}
} }

View File

@@ -19,7 +19,6 @@ package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.LOCAL; import static com.android.server.wm.AnimationAdapterProto.LOCAL;
import static com.android.server.wm.LocalAnimationAdapterProto.ANIMATION_SPEC; import static com.android.server.wm.LocalAnimationAdapterProto.ANIMATION_SPEC;
import android.annotation.ColorInt;
import android.os.SystemClock; import android.os.SystemClock;
import android.util.proto.ProtoOutputStream; import android.util.proto.ProtoOutputStream;
import android.view.SurfaceControl; import android.view.SurfaceControl;
@@ -72,12 +71,6 @@ class LocalAnimationAdapter implements AnimationAdapter {
return mSpec.calculateStatusBarTransitionStartTime(); return mSpec.calculateStatusBarTransitionStartTime();
} }
@Override
@ColorInt
public int getBackgroundColor() {
return mSpec.getBackgroundColor();
}
@Override @Override
public void dump(PrintWriter pw, String prefix) { public void dump(PrintWriter pw, String prefix) {
mSpec.dump(pw, prefix); mSpec.dump(pw, prefix);
@@ -156,9 +149,5 @@ class LocalAnimationAdapter implements AnimationAdapter {
} }
void dumpDebugInner(ProtoOutputStream proto); void dumpDebugInner(ProtoOutputStream proto);
default int getBackgroundColor() {
return 0;
}
} }
} }

View File

@@ -21,7 +21,6 @@ import static com.android.server.wm.AnimationSpecProto.WINDOW;
import static com.android.server.wm.WindowAnimationSpecProto.ANIMATION; import static com.android.server.wm.WindowAnimationSpecProto.ANIMATION;
import static com.android.server.wm.WindowStateAnimator.ROOT_TASK_CLIP_NONE; import static com.android.server.wm.WindowStateAnimator.ROOT_TASK_CLIP_NONE;
import android.annotation.ColorInt;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect; import android.graphics.Rect;
import android.os.SystemClock; import android.os.SystemClock;
@@ -85,12 +84,6 @@ public class WindowAnimationSpec implements AnimationSpec {
return mAnimation.computeDurationHint(); return mAnimation.computeDurationHint();
} }
@Override
@ColorInt
public int getBackgroundColor() {
return mAnimation.getBackgroundColor();
}
@Override @Override
public void apply(Transaction t, SurfaceControl leash, long currentPlayTime) { public void apply(Transaction t, SurfaceControl leash, long currentPlayTime) {
final TmpValues tmp = mThreadLocalTmps.get(); final TmpValues tmp = mThreadLocalTmps.get();