diff options
author | Jeff Brown <jeffbrown@google.com> | 2013-03-27 02:43:54 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-03-27 02:43:54 +0000 |
commit | ca3d655d20c13c71972a4475cec3b98efa7dbdd0 (patch) | |
tree | 2766b887f99e37bcdc423ecf668b7ad6ee58d609 /core/java/com/android | |
parent | b404ecc91a5dd3dd027554490b2ca18c1048bdba (diff) | |
parent | c28867a1d67121ce5963de135e3ae2b1dbd9a33d (diff) | |
download | frameworks_base-ca3d655d20c13c71972a4475cec3b98efa7dbdd0.zip frameworks_base-ca3d655d20c13c71972a4475cec3b98efa7dbdd0.tar.gz frameworks_base-ca3d655d20c13c71972a4475cec3b98efa7dbdd0.tar.bz2 |
Merge "Use input transport for communications between app and IME." into jb-mr2-dev
Diffstat (limited to 'core/java/com/android')
4 files changed, 33 insertions, 41 deletions
diff --git a/core/java/com/android/internal/view/IInputMethod.aidl b/core/java/com/android/internal/view/IInputMethod.aidl index bd947e9..77456da 100644 --- a/core/java/com/android/internal/view/IInputMethod.aidl +++ b/core/java/com/android/internal/view/IInputMethod.aidl @@ -18,6 +18,7 @@ package com.android.internal.view; import android.os.IBinder; import android.os.ResultReceiver; +import android.view.InputChannel; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputBinding; import android.view.inputmethod.InputMethodSubtype; @@ -41,7 +42,7 @@ oneway interface IInputMethod { void restartInput(in IInputContext inputContext, in EditorInfo attribute); - void createSession(IInputSessionCallback callback); + void createSession(in InputChannel channel, IInputSessionCallback callback); void setSessionEnabled(IInputMethodSession session, boolean enabled); diff --git a/core/java/com/android/internal/view/IInputMethodCallback.aidl b/core/java/com/android/internal/view/IInputMethodCallback.aidl deleted file mode 100644 index 717a82d..0000000 --- a/core/java/com/android/internal/view/IInputMethodCallback.aidl +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.view; - -/** - * Helper interface for IInputMethod to allow the input method to call back - * to its client with results from incoming calls. - * {@hide} - */ -oneway interface IInputMethodCallback { - void finishedEvent(int seq, boolean handled); -} diff --git a/core/java/com/android/internal/view/IInputMethodSession.aidl b/core/java/com/android/internal/view/IInputMethodSession.aidl index cdec254..90210ce 100644 --- a/core/java/com/android/internal/view/IInputMethodSession.aidl +++ b/core/java/com/android/internal/view/IInputMethodSession.aidl @@ -22,7 +22,6 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.ExtractedText; -import com.android.internal.view.IInputMethodCallback; /** * Sub-interface of IInputMethod which is safe to give to client applications. @@ -40,14 +39,8 @@ oneway interface IInputMethodSession { void viewClicked(boolean focusChanged); void updateCursor(in Rect newCursor); - - void displayCompletions(in CompletionInfo[] completions); - - void dispatchKeyEvent(int seq, in KeyEvent event, IInputMethodCallback callback); - void dispatchTrackballEvent(int seq, in MotionEvent event, IInputMethodCallback callback); - - void dispatchGenericMotionEvent(int seq, in MotionEvent event, IInputMethodCallback callback); + void displayCompletions(in CompletionInfo[] completions); void appPrivateCommand(String action, in Bundle data); diff --git a/core/java/com/android/internal/view/InputBindResult.java b/core/java/com/android/internal/view/InputBindResult.java index 658f098..9143c61 100644 --- a/core/java/com/android/internal/view/InputBindResult.java +++ b/core/java/com/android/internal/view/InputBindResult.java @@ -18,6 +18,7 @@ package com.android.internal.view; import android.os.Parcel; import android.os.Parcelable; +import android.view.InputChannel; /** * Bundle of information returned by input method manager about a successful @@ -30,7 +31,12 @@ public final class InputBindResult implements Parcelable { * The input method service. */ public final IInputMethodSession method; - + + /** + * The input channel used to send input events to this IME. + */ + public final InputChannel channel; + /** * The ID for this input method, as found in InputMethodInfo; null if * no input method will be bound. @@ -42,18 +48,25 @@ public final class InputBindResult implements Parcelable { */ public final int sequence; - public InputBindResult(IInputMethodSession _method, String _id, int _sequence) { + public InputBindResult(IInputMethodSession _method, InputChannel _channel, + String _id, int _sequence) { method = _method; + channel = _channel; id = _id; sequence = _sequence; } InputBindResult(Parcel source) { method = IInputMethodSession.Stub.asInterface(source.readStrongBinder()); + if (source.readInt() != 0) { + channel = InputChannel.CREATOR.createFromParcel(source); + } else { + channel = null; + } id = source.readString(); sequence = source.readInt(); } - + @Override public String toString() { return "InputBindResult{" + method + " " + id @@ -62,12 +75,19 @@ public final class InputBindResult implements Parcelable { /** * Used to package this object into a {@link Parcel}. - * + * * @param dest The {@link Parcel} to be written. * @param flags The flags used for parceling. */ + @Override public void writeToParcel(Parcel dest, int flags) { dest.writeStrongInterface(method); + if (channel != null) { + dest.writeInt(1); + channel.writeToParcel(dest, 0); + } else { + dest.writeInt(0); + } dest.writeString(id); dest.writeInt(sequence); } @@ -75,17 +95,21 @@ public final class InputBindResult implements Parcelable { /** * Used to make this class parcelable. */ - public static final Parcelable.Creator<InputBindResult> CREATOR = new Parcelable.Creator<InputBindResult>() { + public static final Parcelable.Creator<InputBindResult> CREATOR = + new Parcelable.Creator<InputBindResult>() { + @Override public InputBindResult createFromParcel(Parcel source) { return new InputBindResult(source); } + @Override public InputBindResult[] newArray(int size) { return new InputBindResult[size]; } }; + @Override public int describeContents() { - return 0; + return channel != null ? channel.describeContents() : 0; } } |