am 2205d204: Merge "System accessibility state update postponed if UI test autmation is running." into jb-dev
* commit '2205d20421994d4e31994c298a22cb8fd9232fb6': System accessibility state update postponed if UI test autmation is running.
This commit is contained in:
@@ -191,8 +191,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
@Override
|
@Override
|
||||||
public void onSomePackagesChanged() {
|
public void onSomePackagesChanged() {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
populateAccessibilityServiceListLocked();
|
// We will update when the automation service dies.
|
||||||
manageServicesLocked();
|
if (mUiAutomationService == null) {
|
||||||
|
populateAccessibilityServiceListLocked();
|
||||||
|
manageServicesLocked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,11 +245,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
|
if (intent.getAction() == Intent.ACTION_BOOT_COMPLETED) {
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
populateAccessibilityServiceListLocked();
|
// We will update when the automation service dies.
|
||||||
handleAccessibilityEnabledSettingChangedLocked();
|
if (mUiAutomationService == null) {
|
||||||
handleTouchExplorationEnabledSettingChangedLocked();
|
populateAccessibilityServiceListLocked();
|
||||||
updateInputFilterLocked();
|
handleAccessibilityEnabledSettingChangedLocked();
|
||||||
sendStateToClientsLocked();
|
handleTouchExplorationEnabledSettingChangedLocked();
|
||||||
|
updateInputFilterLocked();
|
||||||
|
sendStateToClientsLocked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -294,9 +300,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
public void onChange(boolean selfChange) {
|
public void onChange(boolean selfChange) {
|
||||||
super.onChange(selfChange);
|
super.onChange(selfChange);
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
handleAccessibilityEnabledSettingChangedLocked();
|
// We will update when the automation service dies.
|
||||||
updateInputFilterLocked();
|
if (mUiAutomationService == null) {
|
||||||
sendStateToClientsLocked();
|
handleAccessibilityEnabledSettingChangedLocked();
|
||||||
|
updateInputFilterLocked();
|
||||||
|
sendStateToClientsLocked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -309,9 +318,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
public void onChange(boolean selfChange) {
|
public void onChange(boolean selfChange) {
|
||||||
super.onChange(selfChange);
|
super.onChange(selfChange);
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
handleTouchExplorationEnabledSettingChangedLocked();
|
// We will update when the automation service dies.
|
||||||
updateInputFilterLocked();
|
if (mUiAutomationService == null) {
|
||||||
sendStateToClientsLocked();
|
handleTouchExplorationEnabledSettingChangedLocked();
|
||||||
|
updateInputFilterLocked();
|
||||||
|
sendStateToClientsLocked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -324,7 +336,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
public void onChange(boolean selfChange) {
|
public void onChange(boolean selfChange) {
|
||||||
super.onChange(selfChange);
|
super.onChange(selfChange);
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
manageServicesLocked();
|
// We will update when the automation service dies.
|
||||||
|
if (mUiAutomationService == null) {
|
||||||
|
manageServicesLocked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -747,10 +762,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
* Manages services by starting enabled ones and stopping disabled ones.
|
* Manages services by starting enabled ones and stopping disabled ones.
|
||||||
*/
|
*/
|
||||||
private void manageServicesLocked() {
|
private void manageServicesLocked() {
|
||||||
// While the UI automation service is running it takes over.
|
|
||||||
if (mUiAutomationService != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
populateEnabledServicesLocked(mEnabledServices);
|
populateEnabledServicesLocked(mEnabledServices);
|
||||||
final int enabledInstalledServicesCount = updateServicesStateLocked(mInstalledServices,
|
final int enabledInstalledServicesCount = updateServicesStateLocked(mInstalledServices,
|
||||||
mEnabledServices);
|
mEnabledServices);
|
||||||
@@ -926,8 +937,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
|
|
||||||
private void tryEnableTouchExploration(final Service service) {
|
private void tryEnableTouchExploration(final Service service) {
|
||||||
if (!mIsTouchExplorationEnabled && service.mRequestTouchExplorationMode) {
|
if (!mIsTouchExplorationEnabled && service.mRequestTouchExplorationMode) {
|
||||||
mMainHandler.obtainMessage(MSG_SHOW_ENABLE_TOUCH_EXPLORATION_DIALOG,
|
if (!service.mIsAutomation) {
|
||||||
service).sendToTarget();
|
mMainHandler.obtainMessage(MSG_SHOW_ENABLE_TOUCH_EXPLORATION_DIALOG,
|
||||||
|
service).sendToTarget();
|
||||||
|
} else {
|
||||||
|
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||||
|
Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1479,10 +1495,15 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
// the state based on values in the settings database.
|
// the state based on values in the settings database.
|
||||||
if (mIsAutomation) {
|
if (mIsAutomation) {
|
||||||
mUiAutomationService = null;
|
mUiAutomationService = null;
|
||||||
|
|
||||||
handleAccessibilityEnabledSettingChangedLocked();
|
handleAccessibilityEnabledSettingChangedLocked();
|
||||||
|
sendStateToClientsLocked();
|
||||||
|
|
||||||
handleTouchExplorationEnabledSettingChangedLocked();
|
handleTouchExplorationEnabledSettingChangedLocked();
|
||||||
updateInputFilterLocked();
|
updateInputFilterLocked();
|
||||||
sendStateToClientsLocked();
|
|
||||||
|
populateAccessibilityServiceListLocked();
|
||||||
|
manageServicesLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user