summaryrefslogtreecommitdiff
path: root/services/coverage/java
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2022-10-14 07:41:42 -0700
committer Yohei Yukawa <yukawa@google.com> 2022-10-14 07:41:42 -0700
commit7f0c721fc714d12bb9f302ae039c35aac37dfa99 (patch)
tree78d8e950f1fd5ede681e1fb37bda8d7d1a3dafc9 /services/coverage/java
parente16dbabf16f1d54a8c46e63cdf7416b4cb7ce963 (diff)
Introduce IInputMethodManagerGlobal
In reality methods defined in IInputMethodManager are no more or less than a set of global methods, because you can write the following logic anywhere. var service = IInputMethodManager.Stub.asInterface( ServiceManager.getService(Context.INPUT_METHOD_SERVICE)); if (service != null) { try { service.doSomething(); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } With above observation, this CL introduces IInputMethodManagerGlobal as a collection of static methods that invoke methods defined in IInputMethodManager so that other framework classes do not need to write the same piece of code. public final class IInputMethodManagerGlobal { public static void doSomething() { final var service = getService(); if (service != null) { try { service.doSomething(); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } ...... } This CL then simplifies ImeTracing to demonstrate how IInputMethodManagerGlobal can be used. Basically this is a mechanical refactoring. There should be no observable behavior change. Bug: 234882948 Test: presubmit Change-Id: I5412eb1d44e3d515ca955f00a2e777b659a15b14
Diffstat (limited to 'services/coverage/java')
0 files changed, 0 insertions, 0 deletions