Merge "Keep changed focus data after service disable"

This commit is contained in:
Jacky Kao
2020-12-23 03:57:59 +00:00
committed by Android (Google) Code Review
3 changed files with 6 additions and 14 deletions

View File

@@ -2120,6 +2120,10 @@ public abstract class AccessibilityService extends Service {
/**
* Sets the strokeWidth and color of the accessibility focus rectangle.
* <p>
* <strong>Note:</strong> This setting persists until this or another active
* AccessibilityService changes it or the device reboots.
* </p>
*
* @param strokeWidth The stroke width of the rectangle in pixels.
* Setting this value to zero results in no focus rectangle being drawn.

View File

@@ -120,8 +120,6 @@ class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnect
AccessibilityUserState userState = mUserStateWeakReference.get();
if (userState == null) return;
userState.removeServiceLocked(this);
userState.resetFocusAppearanceLocked();
mSystemSupport.onClientChangeLocked(false);
mSystemSupport.getFullScreenMagnificationController().resetAllIfNeeded(mId);
mActivityTaskManagerService.setAllowAppSwitches(mComponentName.flattenToString(), -1,
userState.mUserId);
@@ -146,7 +144,6 @@ class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnect
} finally {
Binder.restoreCallingIdentity(identity);
}
userState.resetFocusAppearanceLocked();
mSystemSupport.onClientChangeLocked(false);
}
}
@@ -313,7 +310,6 @@ class AccessibilityServiceConnection extends AbstractAccessibilityServiceConnect
AccessibilityUserState userState = mUserStateWeakReference.get();
if (userState != null) {
userState.serviceDisconnectedLocked(this);
userState.resetFocusAppearanceLocked();
}
resetLocked();
mSystemSupport.getFullScreenMagnificationController().resetAllIfNeeded(mId);

View File

@@ -194,7 +194,8 @@ class AccessibilityUserState {
mUserNonInteractiveUiTimeout = 0;
mUserInteractiveUiTimeout = 0;
mMagnificationMode = ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
resetFocusAppearanceLocked();
mFocusStrokeWidth = mFocusStrokeWidthDefaultValue;
mFocusColor = mFocusColorDefaultValue;
}
void addServiceLocked(AccessibilityServiceConnection serviceConnection) {
@@ -924,13 +925,4 @@ class AccessibilityUserState {
mFocusStrokeWidth = strokeWidth;
mFocusColor = color;
}
/**
* Resets the stroke width and color of the focus rectangle to the default value.
*
*/
public void resetFocusAppearanceLocked() {
mFocusStrokeWidth = mFocusStrokeWidthDefaultValue;
mFocusColor = mFocusColorDefaultValue;
}
}