Migrate VirtualKeyboardFragment to DashboardFragment

Fixes: 134451794
Test: robolectric
Change-Id: I2a40090178b3daea894bdad570549c7bfa34e4e6
This commit is contained in:
Raff Tsai
2019-06-12 16:46:40 +08:00
parent 64fec889df
commit 74942cee5e
5 changed files with 214 additions and 70 deletions

View File

@@ -35,6 +35,7 @@ import java.util.List;
public class ShadowInputMethodManagerWithMethodList extends ShadowInputMethodManager {
private List<InputMethodInfo> mInputMethodInfos = Collections.emptyList();
private List<InputMethodInfo> mEnabledInputMethodInfos = Collections.emptyList();
@Implementation
public static InputMethodManager getInstance() {
@@ -46,11 +47,26 @@ public class ShadowInputMethodManagerWithMethodList extends ShadowInputMethodMan
return mInputMethodInfos;
}
@Implementation
protected List<InputMethodInfo> getEnabledInputMethodList() {
return mEnabledInputMethodInfos;
}
@Implementation
protected List<InputMethodInfo> getEnabledInputMethodSubtypeList(InputMethodInfo imi,
boolean allowsImplicitlySelectedSubtypes) {
return Collections.emptyList();
}
// Non-Android setter.
public void setInputMethodList(List<InputMethodInfo> inputMethodInfos) {
mInputMethodInfos = inputMethodInfos;
}
public void setEnabledInputMethodList(List<InputMethodInfo> inputMethodInfos) {
mEnabledInputMethodInfos = inputMethodInfos;
}
public static ShadowInputMethodManagerWithMethodList getShadow() {
return (ShadowInputMethodManagerWithMethodList) Shadow.extract(
RuntimeEnvironment.application.getSystemService(InputMethodManager.class));