Improve HidlMemory annotation

Change-Id: I6f977f52b96a9a2dd1c47b027d5f314ff92f473f
Bug: 147287669
This commit is contained in:
Ytai Ben-Tsvi
2020-01-17 10:57:53 -08:00
parent 83d3fb1805
commit 70ba0ac09e
3 changed files with 4 additions and 4 deletions

View File

@@ -7099,7 +7099,7 @@ package android.os {
method @Nullable public android.os.NativeHandle getHandle();
method @NonNull public String getName();
method public long getSize();
method @NonNull public android.os.NativeHandle releaseHandle();
method @Nullable public android.os.NativeHandle releaseHandle();
}
public class HidlSupport {

View File

@@ -1889,7 +1889,7 @@ package android.os {
method @Nullable public android.os.NativeHandle getHandle();
method @NonNull public String getName();
method public long getSize();
method @NonNull public android.os.NativeHandle releaseHandle();
method @Nullable public android.os.NativeHandle releaseHandle();
}
public abstract class HwBinder implements android.os.IHwBinder {

View File

@@ -85,11 +85,11 @@ public class HidlMemory implements Closeable {
}
/**
* Disowns the underlying handle and returns it. This object becomes invalid.
* Disowns the underlying handle and returns it. The underlying handle becomes null.
*
* @return The underlying handle.
*/
@NonNull
@Nullable
public NativeHandle releaseHandle() {
NativeHandle handle = mHandle;
mHandle = null;