diff options
| author | 2011-08-14 20:13:19 -0700 | |
|---|---|---|
| committer | 2011-08-14 20:13:19 -0700 | |
| commit | 8b65c902ee25e9c38f64eef9f7af0cf9e86491e3 (patch) | |
| tree | 25443a1cca2a8ac849d3074362b085d839bd1547 | |
| parent | cb04a1f3a31c252a0e3fda5e7eaa16f3257c9397 (diff) | |
| parent | 0a0ab128a65900a23f1018a14f5cbecec6443dd3 (diff) | |
Merge "Use PARCELABLE_WIRTE_RETURN_VALUE flag in InputChannel. Bug: 5161290"
| -rw-r--r-- | core/java/android/view/InputChannel.java | 7 | ||||
| -rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/core/java/android/view/InputChannel.java b/core/java/android/view/InputChannel.java index f2cad2f94d1d..523af04ada5e 100644 --- a/core/java/android/view/InputChannel.java +++ b/core/java/android/view/InputChannel.java @@ -48,8 +48,6 @@ public final class InputChannel implements Parcelable { @SuppressWarnings("unused") private int mPtr; // used by native code - private boolean mDisposeAfterWriteToParcel; - private static native InputChannel[] nativeOpenInputChannelPair(String name); private native void nativeDispose(boolean finalized); @@ -117,13 +115,12 @@ public final class InputChannel implements Parcelable { * as an out parameter in a binder call. * @param other The other input channel instance. */ - public void transferToBinderOutParameter(InputChannel outParameter) { + public void transferTo(InputChannel outParameter) { if (outParameter == null) { throw new IllegalArgumentException("outParameter must not be null"); } nativeTransferTo(outParameter); - outParameter.mDisposeAfterWriteToParcel = true; } public int describeContents() { @@ -145,7 +142,7 @@ public final class InputChannel implements Parcelable { nativeWriteToParcel(out); - if (mDisposeAfterWriteToParcel) { + if ((flags & PARCELABLE_WRITE_RETURN_VALUE) != 0) { dispose(); } } diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 558ba3e7b67e..5967428a33b6 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -2052,7 +2052,7 @@ public class WindowManagerService extends IWindowManager.Stub String name = win.makeInputChannelName(); InputChannel[] inputChannels = InputChannel.openInputChannelPair(name); win.mInputChannel = inputChannels[0]; - inputChannels[1].transferToBinderOutParameter(outInputChannel); + inputChannels[1].transferTo(outInputChannel); mInputManager.registerInputChannel(win.mInputChannel, win.mInputWindowHandle); } |