Merge "Revert "Add logs that indicate why a surface is invalid"" into rvc-dev am: d82080094e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11874469

Change-Id: I744413842bbc74724268c1fe58187a74f4d90461
This commit is contained in:
TreeHugger Robot
2020-06-17 14:15:17 +00:00
committed by Automerger Merge Worker

View File

@@ -230,7 +230,6 @@ public final class SurfaceControl implements Parcelable {
*/ */
public long mNativeObject; public long mNativeObject;
private long mNativeHandle; private long mNativeHandle;
private Throwable mReleaseStack = null;
// TODO: Move this to native. // TODO: Move this to native.
private final Object mSizeLock = new Object(); private final Object mSizeLock = new Object();
@@ -442,13 +441,6 @@ public final class SurfaceControl implements Parcelable {
} }
mNativeObject = nativeObject; mNativeObject = nativeObject;
mNativeHandle = mNativeObject != 0 ? nativeGetHandle(nativeObject) : 0; mNativeHandle = mNativeObject != 0 ? nativeGetHandle(nativeObject) : 0;
if (mNativeObject == 0) {
if (Build.IS_DEBUGGABLE) {
mReleaseStack = new Throwable("assigned zero nativeObject here");
}
} else {
mReleaseStack = null;
}
} }
/** /**
@@ -1024,21 +1016,10 @@ public final class SurfaceControl implements Parcelable {
nativeRelease(mNativeObject); nativeRelease(mNativeObject);
mNativeObject = 0; mNativeObject = 0;
mNativeHandle = 0; mNativeHandle = 0;
if (Build.IS_DEBUGGABLE) {
mReleaseStack = new Throwable("released here");
}
mCloseGuard.close(); mCloseGuard.close();
} }
} }
/**
* Returns the call stack that assigned mNativeObject to zero.
* @hide
*/
public Throwable getReleaseStack() {
return mReleaseStack;
}
/** /**
* Disconnect any client still connected to the surface. * Disconnect any client still connected to the surface.
* @hide * @hide
@@ -1050,11 +1031,8 @@ public final class SurfaceControl implements Parcelable {
} }
private void checkNotReleased() { private void checkNotReleased() {
if (mNativeObject == 0) { if (mNativeObject == 0) throw new NullPointerException(
Log.wtf(TAG, "Invalid " + this + " caused by:", mReleaseStack); "Invalid " + this + ", mNativeObject is null. Have you called release() already?");
throw new NullPointerException(
"mNativeObject of " + this + " is null. Have you called release() already?");
}
} }
/** /**