Merge "Make IInputMethodPrivilegedOperations to async (3/N)" into sc-dev
This commit is contained in:
@@ -1627,7 +1627,7 @@ public class InputMethodService extends AbstractInputMethodService {
|
||||
}
|
||||
|
||||
private void reportFullscreenMode() {
|
||||
mPrivOps.reportFullscreenMode(mIsFullscreen);
|
||||
mPrivOps.reportFullscreenModeAsync(mIsFullscreen);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user