am 236cc476: Temporarily revert field name change (DO NOT MERGE)
* commit '236cc476e6792a11502ba4f40c7ab4586f40d282':
Temporarily revert field name change (DO NOT MERGE)
diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java
index e0786f7..ae4005b 100644
--- a/core/java/android/view/Surface.java
+++ b/core/java/android/view/Surface.java
@@ -71,8 +71,8 @@
// Guarded state.
final Object mLock = new Object(); // protects the native state
private String mName;
- int mNativeObject; // package scope only for SurfaceControl access
- private int mGenerationId; // incremented each time mNativeObject changes
+ int mNativeSurface; // package scope only for SurfaceControl access
+ private int mGenerationId; // incremented each time mNativeSurface changes
private final Canvas mCanvas = new CompatibleCanvas();
// A matrix to scale the matrix set by application. This is set to null for
@@ -158,8 +158,8 @@
*/
public void release() {
synchronized (mLock) {
- if (mNativeObject != 0) {
- nativeRelease(mNativeObject);
+ if (mNativeSurface != 0) {
+ nativeRelease(mNativeSurface);
setNativeObjectLocked(0);
}
}
@@ -183,8 +183,8 @@
*/
public boolean isValid() {
synchronized (mLock) {
- if (mNativeObject == 0) return false;
- return nativeIsValid(mNativeObject);
+ if (mNativeSurface == 0) return false;
+ return nativeIsValid(mNativeSurface);
}
}
@@ -210,7 +210,7 @@
public boolean isConsumerRunningBehind() {
synchronized (mLock) {
checkNotReleasedLocked();
- return nativeIsConsumerRunningBehind(mNativeObject);
+ return nativeIsConsumerRunningBehind(mNativeSurface);
}
}
@@ -233,7 +233,7 @@
throws OutOfResourcesException, IllegalArgumentException {
synchronized (mLock) {
checkNotReleasedLocked();
- nativeLockCanvas(mNativeObject, mCanvas, inOutDirty);
+ nativeLockCanvas(mNativeSurface, mCanvas, inOutDirty);
return mCanvas;
}
}
@@ -252,7 +252,7 @@
synchronized (mLock) {
checkNotReleasedLocked();
- nativeUnlockCanvasAndPost(mNativeObject, canvas);
+ nativeUnlockCanvasAndPost(mNativeSurface, canvas);
}
}
@@ -298,8 +298,8 @@
int newNativeObject = nativeCreateFromSurfaceControl(surfaceControlPtr);
synchronized (mLock) {
- if (mNativeObject != 0) {
- nativeRelease(mNativeObject);
+ if (mNativeSurface != 0) {
+ nativeRelease(mNativeSurface);
}
setNativeObjectLocked(newNativeObject);
}
@@ -319,13 +319,13 @@
if (other != this) {
final int newPtr;
synchronized (other.mLock) {
- newPtr = other.mNativeObject;
+ newPtr = other.mNativeSurface;
other.setNativeObjectLocked(0);
}
synchronized (mLock) {
- if (mNativeObject != 0) {
- nativeRelease(mNativeObject);
+ if (mNativeSurface != 0) {
+ nativeRelease(mNativeSurface);
}
setNativeObjectLocked(newPtr);
}
@@ -344,7 +344,7 @@
synchronized (mLock) {
mName = source.readString();
- setNativeObjectLocked(nativeReadFromParcel(mNativeObject, source));
+ setNativeObjectLocked(nativeReadFromParcel(mNativeSurface, source));
}
}
@@ -355,7 +355,7 @@
}
synchronized (mLock) {
dest.writeString(mName);
- nativeWriteToParcel(mNativeObject, dest);
+ nativeWriteToParcel(mNativeSurface, dest);
}
if ((flags & Parcelable.PARCELABLE_WRITE_RETURN_VALUE) != 0) {
release();
@@ -370,19 +370,19 @@
}
private void setNativeObjectLocked(int ptr) {
- if (mNativeObject != ptr) {
- if (mNativeObject == 0 && ptr != 0) {
+ if (mNativeSurface != ptr) {
+ if (mNativeSurface == 0 && ptr != 0) {
mCloseGuard.open("release");
- } else if (mNativeObject != 0 && ptr == 0) {
+ } else if (mNativeSurface != 0 && ptr == 0) {
mCloseGuard.close();
}
- mNativeObject = ptr;
+ mNativeSurface = ptr;
mGenerationId += 1;
}
}
private void checkNotReleasedLocked() {
- if (mNativeObject == 0) {
+ if (mNativeSurface == 0) {
throw new IllegalStateException("Surface has already been released.");
}
}
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 6b530ef..c6da84f 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -499,7 +499,7 @@
if (surface != null) {
synchronized (surface.mLock) {
- nativeSetDisplaySurface(displayToken, surface.mNativeObject);
+ nativeSetDisplaySurface(displayToken, surface.mNativeSurface);
}
} else {
nativeSetDisplaySurface(displayToken, 0);
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index 9a19ce5..d9f6be9 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -392,7 +392,7 @@
jclass clazz = env->FindClass("android/view/Surface");
gSurfaceClassInfo.clazz = jclass(env->NewGlobalRef(clazz));
gSurfaceClassInfo.mNativeObject =
- env->GetFieldID(gSurfaceClassInfo.clazz, "mNativeObject", "I");
+ env->GetFieldID(gSurfaceClassInfo.clazz, "mNativeSurface", "I");
gSurfaceClassInfo.mLock =
env->GetFieldID(gSurfaceClassInfo.clazz, "mLock", "Ljava/lang/Object;");
gSurfaceClassInfo.ctor = env->GetMethodID(gSurfaceClassInfo.clazz, "<init>", "(I)V");