Merge "The accessibility input filter state was not unregistered when no spoken feedback accessibility services are regitstered."
This commit is contained in:
committed by
Android (Google) Code Review
commit
13dfabde84
@@ -642,14 +642,16 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs or removes the accessibility input filter when accessibility is enabled
|
||||
* or disabled.
|
||||
* Sets the input filter state. If the filter is in enabled it is registered
|
||||
* in the window manager, otherwise the filter is removed from the latter.
|
||||
*
|
||||
* @param enabled Whether the input filter is enabled.
|
||||
*/
|
||||
private void updateInputFilterLocked() {
|
||||
private void setInputFilterEnabledLocked(boolean enabled) {
|
||||
WindowManagerService wm = (WindowManagerService)ServiceManager.getService(
|
||||
Context.WINDOW_SERVICE);
|
||||
if (wm != null) {
|
||||
if (mIsEnabled) {
|
||||
if (enabled) {
|
||||
if (mInputFilter == null) {
|
||||
mInputFilter = new AccessibilityInputFilter(mContext);
|
||||
}
|
||||
@@ -681,7 +683,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
||||
if (enabledServices.size() > 0
|
||||
&& service.mFeedbackType == AccessibilityServiceInfo.FEEDBACK_SPOKEN) {
|
||||
updateClientsLocked();
|
||||
updateInputFilterLocked();
|
||||
setInputFilterEnabledLocked(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,7 +699,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
|
||||
if (enabledServices.isEmpty()
|
||||
&& service.mFeedbackType == AccessibilityServiceInfo.FEEDBACK_SPOKEN) {
|
||||
updateClientsLocked();
|
||||
updateInputFilterLocked();
|
||||
setInputFilterEnabledLocked(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user