diff options
| author | Xavier Ducrohet <xav@android.com> | 2011-07-12 12:35:50 -0700 |
|---|---|---|
| committer | Xavier Ducrohet <xav@android.com> | 2011-07-12 12:35:50 -0700 |
| commit | 96131eef3869f2be1300e1620f5c3874b41bb534 (patch) | |
| tree | 8c378e7302477213510655ec5b9bae290de9f744 /tools/layoutlib/bridge/src/android/view/accessibility | |
| parent | 0a49635b171f3ba366b1a7ebf28791c4661829bd (diff) | |
| download | frameworks_base-96131eef3869f2be1300e1620f5c3874b41bb534.zip frameworks_base-96131eef3869f2be1300e1620f5c3874b41bb534.tar.gz frameworks_base-96131eef3869f2be1300e1620f5c3874b41bb534.tar.bz2 | |
LayoutLib: updated fake accessbility manager and ensure there's an InputMethodManager
We had replaced the accessibility Manager but it lacked some new API. Obvisouly
this is fragile and should be fixed, but this works for now.
After fixing this there was another issue with the lack of InputMethodManager.
To fix this I had to create an implementation of IInputMethodManager which
normally comes from a binder object.
I may want to do a similar trick with the accessibility manager later.
Change-Id: I28c6494e333f39072f348d0199124efac93256a5
Diffstat (limited to 'tools/layoutlib/bridge/src/android/view/accessibility')
| -rw-r--r-- | tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java index 251c053..1fd7836 100644 --- a/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java +++ b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java @@ -16,8 +16,11 @@ package android.view.accessibility; +import android.accessibilityservice.AccessibilityServiceInfo; import android.content.Context; import android.content.pm.ServiceInfo; +import android.view.IWindow; +import android.view.View; import java.util.Collections; import java.util.List; @@ -38,6 +41,19 @@ public final class AccessibilityManager { private static AccessibilityManager sInstance = new AccessibilityManager(); /** + * Listener for the accessibility state. + */ + public interface AccessibilityStateChangeListener { + + /** + * Called back on change in the accessibility state. + * + * @param enabled Whether accessibility is enabled. + */ + public void onAccessibilityStateChanged(boolean enabled); + } + + /** * Get an AccessibilityManager instance (create one if necessary). * * @hide @@ -92,4 +108,30 @@ public final class AccessibilityManager { List<ServiceInfo> services = null; return Collections.unmodifiableList(services); } + + public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() { + // normal implementation does this in some case, so let's do the same + // (unmodifiableList wrapped around null). + List<AccessibilityServiceInfo> services = null; + return Collections.unmodifiableList(services); + } + + public boolean addAccessibilityStateChangeListener( + AccessibilityStateChangeListener listener) { + return true; + } + + public boolean removeAccessibilityStateChangeListener( + AccessibilityStateChangeListener listener) { + return true; + } + + public int addAccessibilityInteractionConnection(IWindow windowToken, + IAccessibilityInteractionConnection connection) { + return View.NO_ID; + } + + public void removeAccessibilityInteractionConnection(IWindow windowToken) { + } + } |
