summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorRiddle Hsu <riddlehsu@google.com>2022-03-25 21:11:32 +0800
committerRiddle Hsu <riddlehsu@google.com>2022-03-30 12:07:14 +0000
commit78c6b6b5fa5b5fd7c83da626e2eaa1ce29bec013 (patch)
tree215f77896d581b618e0fb102f32858d5cbb129f5 /core/java/android
parent244a90bfe1fae9e6418bce5af67a0c76c0c9527a (diff)
Pass background color from transition info to remote animation
With shell transition, there won't be task info if the transition is launching activity in the same task. ActivityLaunchAnimator assumed the task info is non-null, which causes NPE. Bug: 223397404 Test: adb shell setprop persist.wm.debug.shell_transit 1; reboot Long press quick settings tile from notification multiple time. Especially launch the same tile twice, systemui should not crash. Change-Id: I0ad1fef17653d72162d430339ac7e8a716aa9bfe
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/RemoteAnimationTarget.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/RemoteAnimationTarget.java b/core/java/android/view/RemoteAnimationTarget.java
index 2dac81c66d2a..e98d046e8c6c 100644
--- a/core/java/android/view/RemoteAnimationTarget.java
+++ b/core/java/android/view/RemoteAnimationTarget.java
@@ -33,6 +33,7 @@ import static android.view.RemoteAnimationTargetProto.TASK_ID;
import static android.view.RemoteAnimationTargetProto.WINDOW_CONFIGURATION;
import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;
+import android.annotation.ColorInt;
import android.annotation.IntDef;
import android.app.ActivityManager;
import android.app.TaskInfo;
@@ -221,6 +222,12 @@ public class RemoteAnimationTarget implements Parcelable {
*/
public boolean hasAnimatingParent;
+ /**
+ * The background color of animation in case the task info is not available if the transition
+ * is activity level.
+ */
+ public @ColorInt int backgroundColor;
+
public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
Rect localBounds, Rect screenSpaceBounds,
@@ -279,6 +286,7 @@ public class RemoteAnimationTarget implements Parcelable {
allowEnterPip = in.readBoolean();
windowType = in.readInt();
hasAnimatingParent = in.readBoolean();
+ backgroundColor = in.readInt();
}
@Override
@@ -307,6 +315,7 @@ public class RemoteAnimationTarget implements Parcelable {
dest.writeBoolean(allowEnterPip);
dest.writeInt(windowType);
dest.writeBoolean(hasAnimatingParent);
+ dest.writeInt(backgroundColor);
}
public void dump(PrintWriter pw, String prefix) {
@@ -327,6 +336,7 @@ public class RemoteAnimationTarget implements Parcelable {
pw.print(prefix); pw.print("allowEnterPip="); pw.println(allowEnterPip);
pw.print(prefix); pw.print("windowType="); pw.print(windowType);
pw.print(prefix); pw.print("hasAnimatingParent="); pw.print(hasAnimatingParent);
+ pw.print(prefix); pw.print("backgroundColor="); pw.print(backgroundColor);
}
public void dumpDebug(ProtoOutputStream proto, long fieldId) {