Merge "Make IInputMethodPrivilegedOperations to async (3/N)" into sc-dev

This commit is contained in:
Wilson Wu
2021-04-22 04:50:11 +00:00
committed by Android (Google) Code Review
4 changed files with 7 additions and 11 deletions

View File

@@ -1627,7 +1627,7 @@ public class InputMethodService extends AbstractInputMethodService {
}
private void reportFullscreenMode() {
mPrivOps.reportFullscreenMode(mIsFullscreen);
mPrivOps.reportFullscreenModeAsync(mIsFullscreen);
}
/**

View File

@@ -33,7 +33,7 @@ oneway interface IInputMethodPrivilegedOperations {
void reportStartInputAsync(in IBinder startInputToken);
void createInputContentUriToken(in Uri contentUri, in String packageName,
in IIInputContentUriTokenResultCallback resultCallback);
void reportFullscreenMode(boolean fullscreen, in IVoidResultCallback resultCallback);
void reportFullscreenModeAsync(boolean fullscreen);
void setInputMethod(String id, in IVoidResultCallback resultCallback);
void setInputMethodAndSubtype(String id, in InputMethodSubtype subtype,
in IVoidResultCallback resultCallback);

View File

@@ -169,21 +169,18 @@ public final class InputMethodPrivilegedOperations {
}
/**
* Calls {@link IInputMethodPrivilegedOperations#reportFullscreenMode(boolean,
* IVoidResultCallback)}.
* Calls {@link IInputMethodPrivilegedOperations#reportFullscreenModeAsync(boolean)}.
*
* @param fullscreen {@code true} if the IME enters full screen mode
*/
@AnyThread
public void reportFullscreenMode(boolean fullscreen) {
public void reportFullscreenModeAsync(boolean fullscreen) {
final IInputMethodPrivilegedOperations ops = mOps.getAndWarnIfNull();
if (ops == null) {
return;
}
try {
final Completable.Void value = Completable.createVoid();
ops.reportFullscreenMode(fullscreen, ResultCallbacks.of(value));
Completable.getResult(value);
ops.reportFullscreenModeAsync(fullscreen);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}

View File

@@ -6006,9 +6006,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
@BinderThread
@Override
public void reportFullscreenMode(boolean fullscreen, IVoidResultCallback resultCallback) {
CallbackUtils.onResult(resultCallback,
() -> mImms.reportFullscreenMode(mToken, fullscreen));
public void reportFullscreenModeAsync(boolean fullscreen) {
mImms.reportFullscreenMode(mToken, fullscreen);
}
@BinderThread