summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2024-09-10 20:39:39 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2024-09-10 20:48:28 +0000
commit14406149022cde05386523402c4edbc15ee00902 (patch)
tree96b59cecbe43280119e0b4700d5e7beb74fa5c59
parent486822e9db8e4eb7110c93681a0f5f65431eab06 (diff)
Remove PointerIcon frame size checks for animated drawables
PointerIcons are already only loaded from system server's UiThread. However, there are still some cases where system resources, such as display density, change asynchronously from different threads. It is difficult to synchronize resource updates and resource loading. After the introduction of Vector icons, the frame size of PointerIcons will depend on the display density, so we must assume that the density can change while loading icons. We should no longer enforce that all frames of an animated icon are the same size. The rest of the pipeline makes no assertions that all animation frames are the same size. Bug: 362296003 Bug: 362462770 Change-Id: If04ff8224e64c7efa57d10a5f149d52a7569ef9a Test: Presubmit Flag: EXEMPT bug fix
-rw-r--r--core/java/android/view/PointerIcon.java5
1 files changed, 0 insertions, 5 deletions
diff --git a/core/java/android/view/PointerIcon.java b/core/java/android/view/PointerIcon.java
index 815fd1c49a38..dd950e83dd52 100644
--- a/core/java/android/view/PointerIcon.java
+++ b/core/java/android/view/PointerIcon.java
@@ -540,8 +540,6 @@ public final class PointerIcon implements Parcelable {
// Assumes they have the exact duration.
mDurationPerFrame = animationDrawable.getDuration(0);
mBitmapFrames = new Bitmap[frames - 1];
- final int width = drawable.getIntrinsicWidth();
- final int height = drawable.getIntrinsicHeight();
final boolean isVectorAnimation = drawable instanceof VectorDrawable;
mDrawNativeDropShadow = isVectorAnimation;
for (int i = 1; i < frames; ++i) {
@@ -556,9 +554,6 @@ public final class PointerIcon implements Parcelable {
+ "is a different type from the others. All frames should be the "
+ "same type.");
}
- // TODO(b/361232935): Check when bitmap size of the ith frame is different
- // drawableFrame.getIntrinsicWidth() != width ||
- // drawableFrame.getIntrinsicHeight() != height
if (isVectorAnimation) {
drawableFrame = getBitmapDrawableFromVectorDrawable(resources,
(VectorDrawable) drawableFrame, pointerScale);