diff options
| author | Riddle Hsu <riddlehsu@google.com> | 2021-03-03 03:58:07 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-03-03 03:58:07 +0000 |
| commit | 304d3a07ea3a49d015f2cd793fe1b113f189efff (patch) | |
| tree | 2b6b6e8420a46aaf606826fb7f84aac1736af652 /core/java/android/window | |
| parent | 04faa88ad9667079d085d3b6aff8f454aa653496 (diff) | |
| parent | ec999979a7456a5d698f9a71f21b448ce0d9a661 (diff) | |
Merge "Optimize the Parcel read/write of remote animation" into sc-dev
Diffstat (limited to 'core/java/android/window')
| -rw-r--r-- | core/java/android/window/TaskSnapshot.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/java/android/window/TaskSnapshot.java b/core/java/android/window/TaskSnapshot.java index dc07e44d4d98..f1e5fb95ea54 100644 --- a/core/java/android/window/TaskSnapshot.java +++ b/core/java/android/window/TaskSnapshot.java @@ -46,7 +46,7 @@ public class TaskSnapshot implements Parcelable { private final int mOrientation; /** See {@link android.view.Surface.Rotation} */ @Surface.Rotation - private int mRotation; + private final int mRotation; /** The size of the snapshot before scaling */ private final Point mTaskSize; private final Rect mContentInsets; @@ -90,15 +90,15 @@ public class TaskSnapshot implements Parcelable { private TaskSnapshot(Parcel source) { mId = source.readLong(); mTopActivityComponent = ComponentName.readFromParcel(source); - mSnapshot = source.readParcelable(null /* classLoader */); + mSnapshot = source.readTypedObject(HardwareBuffer.CREATOR); int colorSpaceId = source.readInt(); mColorSpace = colorSpaceId >= 0 && colorSpaceId < ColorSpace.Named.values().length ? ColorSpace.get(ColorSpace.Named.values()[colorSpaceId]) : ColorSpace.get(ColorSpace.Named.SRGB); mOrientation = source.readInt(); mRotation = source.readInt(); - mTaskSize = source.readParcelable(null /* classLoader */); - mContentInsets = source.readParcelable(null /* classLoader */); + mTaskSize = source.readTypedObject(Point.CREATOR); + mContentInsets = source.readTypedObject(Rect.CREATOR); mIsLowResolution = source.readBoolean(); mIsRealSnapshot = source.readBoolean(); mWindowingMode = source.readInt(); @@ -235,13 +235,12 @@ public class TaskSnapshot implements Parcelable { public void writeToParcel(Parcel dest, int flags) { dest.writeLong(mId); ComponentName.writeToParcel(mTopActivityComponent, dest); - dest.writeParcelable(mSnapshot != null && !mSnapshot.isClosed() ? mSnapshot : null, - 0); + dest.writeTypedObject(mSnapshot != null && !mSnapshot.isClosed() ? mSnapshot : null, 0); dest.writeInt(mColorSpace.getId()); dest.writeInt(mOrientation); dest.writeInt(mRotation); - dest.writeParcelable(mTaskSize, 0); - dest.writeParcelable(mContentInsets, 0); + dest.writeTypedObject(mTaskSize, 0); + dest.writeTypedObject(mContentInsets, 0); dest.writeBoolean(mIsLowResolution); dest.writeBoolean(mIsRealSnapshot); dest.writeInt(mWindowingMode); |
