summaryrefslogtreecommitdiff
path: root/com/android/internal/view/IInputConnectionWrapper.java
diff options
context:
space:
mode:
Diffstat (limited to 'com/android/internal/view/IInputConnectionWrapper.java')
-rw-r--r--com/android/internal/view/IInputConnectionWrapper.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/com/android/internal/view/IInputConnectionWrapper.java b/com/android/internal/view/IInputConnectionWrapper.java
index 28291aef..e08caa8e 100644
--- a/com/android/internal/view/IInputConnectionWrapper.java
+++ b/com/android/internal/view/IInputConnectionWrapper.java
@@ -23,6 +23,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Bundle;
import android.os.Handler;
+import android.os.LocaleList;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
@@ -64,6 +65,7 @@ public abstract class IInputConnectionWrapper extends IInputContext.Stub {
private static final int DO_REQUEST_UPDATE_CURSOR_ANCHOR_INFO = 140;
private static final int DO_CLOSE_CONNECTION = 150;
private static final int DO_COMMIT_CONTENT = 160;
+ private static final int DO_REPORT_LANGUAGE_HINT = 170;
@GuardedBy("mLock")
@Nullable
@@ -217,6 +219,10 @@ public abstract class IInputConnectionWrapper extends IInputContext.Stub {
callback));
}
+ public void reportLanguageHint(@NonNull LocaleList languageHint) {
+ dispatchMessage(obtainMessageO(DO_REPORT_LANGUAGE_HINT, languageHint));
+ }
+
void dispatchMessage(Message msg) {
// If we are calling this from the main thread, then we can call
// right through. Otherwise, we need to send the message to the
@@ -577,6 +583,16 @@ public abstract class IInputConnectionWrapper extends IInputContext.Stub {
}
return;
}
+ case DO_REPORT_LANGUAGE_HINT: {
+ final LocaleList languageHint = (LocaleList) msg.obj;
+ final InputConnection ic = getInputConnection();
+ if (ic == null || !isActive()) {
+ Log.w(TAG, "reportLanguageHint on inactive InputConnection");
+ return;
+ }
+ ic.reportLanguageHint(languageHint);
+ return;
+ }
}
Log.w(TAG, "Unhandled message code: " + msg.what);
}