Merge "android.view.Surface: Add parceling warning" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0656931d18
@@ -459,6 +459,8 @@ public class Surface implements Parcelable {
|
|||||||
// create a new native Surface and return it after reducing
|
// create a new native Surface and return it after reducing
|
||||||
// the reference count on mNativeObject. Either way, it is
|
// the reference count on mNativeObject. Either way, it is
|
||||||
// not necessary to call nativeRelease() here.
|
// 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();
|
mName = source.readString();
|
||||||
mIsSingleBuffered = source.readInt() != 0;
|
mIsSingleBuffered = source.readInt() != 0;
|
||||||
setNativeObjectLocked(nativeReadFromParcel(mNativeObject, source));
|
setNativeObjectLocked(nativeReadFromParcel(mNativeObject, source));
|
||||||
@@ -471,6 +473,8 @@ public class Surface implements Parcelable {
|
|||||||
throw new IllegalArgumentException("dest must not be null");
|
throw new IllegalArgumentException("dest must not be null");
|
||||||
}
|
}
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
|
// NOTE: This must be kept synchronized with the native parceling code
|
||||||
|
// in frameworks/native/libs/Surface.cpp
|
||||||
dest.writeString(mName);
|
dest.writeString(mName);
|
||||||
dest.writeInt(mIsSingleBuffered ? 1 : 0);
|
dest.writeInt(mIsSingleBuffered ? 1 : 0);
|
||||||
nativeWriteToParcel(mNativeObject, dest);
|
nativeWriteToParcel(mNativeObject, dest);
|
||||||
|
|||||||
Reference in New Issue
Block a user