summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eino-Ville Talvala <etalvala@google.com> 2016-08-29 17:51:23 -0700
committer Eino-Ville Talvala <etalvala@google.com> 2016-08-29 17:51:23 -0700
commitf005f5ed88aa67bed6c678a7e89b47e3ec436835 (patch)
tree2a884cb4e694f6c5e53242682f91991be88a63a4
parent199d4902e223479791e4c202164f16fffe3ce5a8 (diff)
android.view.Surface: Add parceling warning
Surface is parcelled partly in java, partly in native, and any fields added in java have to be accounted for in the native side as well. Add a warning to avoid issues in the future Bug: 31162160 Change-Id: I48ca1bc3eea29f1ac3d3065f6defb6ed2be4052a
-rw-r--r--core/java/android/view/Surface.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index dc19d3281507..f92d83af93a0 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -459,6 +459,8 @@ public class Surface implements Parcelable {
// create a new native Surface and return it after reducing
// the reference count on mNativeObject. Either way, it is
// not necessary to call nativeRelease() here.
+ // NOTE: This must be kept synchronized with the native parceling code
+ // in frameworks/native/libs/Surface.cpp
mName = source.readString();
mIsSingleBuffered = source.readInt() != 0;
setNativeObjectLocked(nativeReadFromParcel(mNativeObject, source));
@@ -471,6 +473,8 @@ public class Surface implements Parcelable {
throw new IllegalArgumentException("dest must not be null");
}
synchronized (mLock) {
+ // NOTE: This must be kept synchronized with the native parceling code
+ // in frameworks/native/libs/Surface.cpp
dest.writeString(mName);
dest.writeInt(mIsSingleBuffered ? 1 : 0);
nativeWriteToParcel(mNativeObject, dest);