API Rename: IC#inputContent to IC#commitContent.
As shown in below, we have already used commit* naming convention in
InputConnection.
- InputConnection#commitCompletion(CompletionInfo);
- InputConnection#commitCorrection(CorrectionInfo);
- InputConnection#commitText(CharSequence, int);
Hence renaming IC#inputContent() to IC#commitContent() would make the
new method more consistent.
Bug: 29450024
Change-Id: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
diff --git a/core/java/com/android/internal/view/IInputConnectionWrapper.java b/core/java/com/android/internal/view/IInputConnectionWrapper.java
index fc189a3..dce9d2c 100644
--- a/core/java/com/android/internal/view/IInputConnectionWrapper.java
+++ b/core/java/com/android/internal/view/IInputConnectionWrapper.java
@@ -62,7 +62,7 @@
private static final int DO_CLEAR_META_KEY_STATES = 130;
private static final int DO_REQUEST_UPDATE_CURSOR_ANCHOR_INFO = 140;
private static final int DO_CLOSE_CONNECTION = 150;
- private static final int DO_INSERT_CONTENT = 160;
+ private static final int DO_COMMIT_CONTENT = 160;
@GuardedBy("mLock")
@Nullable
@@ -243,9 +243,9 @@
dispatchMessage(obtainMessage(DO_CLOSE_CONNECTION));
}
- public void insertContent(InputContentInfo inputContentInfo, Bundle opts,
+ public void commitContent(InputContentInfo inputContentInfo, Bundle opts,
int seq, IInputContextCallback callback) {
- dispatchMessage(obtainMessageOOSC(DO_INSERT_CONTENT, inputContentInfo, opts, seq, callback));
+ dispatchMessage(obtainMessageOOSC(DO_COMMIT_CONTENT, inputContentInfo, opts, seq, callback));
}
void dispatchMessage(Message msg) {
@@ -559,26 +559,26 @@
}
return;
}
- case DO_INSERT_CONTENT: {
+ case DO_COMMIT_CONTENT: {
SomeArgs args = (SomeArgs) msg.obj;
try {
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
- Log.w(TAG, "insertContent on inactive InputConnection");
- args.callback.setInsertContentResult(false, args.seq);
+ Log.w(TAG, "commitContent on inactive InputConnection");
+ args.callback.setCommitContentResult(false, args.seq);
return;
}
final InputContentInfo inputContentInfo = (InputContentInfo) args.arg1;
if (inputContentInfo == null || !inputContentInfo.validate()) {
- Log.w(TAG, "insertContent with invalid inputContentInfo="
+ Log.w(TAG, "commitContent with invalid inputContentInfo="
+ inputContentInfo);
- args.callback.setInsertContentResult(false, args.seq);
+ args.callback.setCommitContentResult(false, args.seq);
return;
}
- args.callback.setInsertContentResult(
- ic.insertContent(inputContentInfo, (Bundle) args.arg2), args.seq);
+ args.callback.setCommitContentResult(
+ ic.commitContent(inputContentInfo, (Bundle) args.arg2), args.seq);
} catch (RemoteException e) {
- Log.w(TAG, "Got RemoteException calling insertContent", e);
+ Log.w(TAG, "Got RemoteException calling commitContent", e);
}
return;
}