Dump magnification tracking typing focus info for dumpsys accessibility

To make the magnification debugging easier, we add the dump information
for magnification tracking typing focus feature.

For full screen magnification, it includes
MagnificationFollowTypingEnabled.

For window magnification, it includes both
MagnificationFollowTypingEnabled and TrackingTypingFocusEnabled.

MagnificationFollowTypingEnabled is controlled by system preference
setting.

TrackingTypingFocusEnabled is controlled by a user behavior.

Bug: 216208936
Test: manual - Turn on the magnifier
      $adb shell settings put secure
          accessibility_magnification_follow_typing_enabled 0/1
      $adb shell dumpsys accessibility
Change-Id: Id584ece3b2e3d9b849ff1275b55f4fd0ba09a6b8
This commit is contained in:
Daniel Hsieh
2022-01-25 02:31:16 +00:00
parent 7481586ab6
commit 611b80cfeb
4 changed files with 27 additions and 1 deletions

View File

@@ -516,6 +516,8 @@ class AccessibilityUserState {
.append(String.valueOf(mMagnificationCapabilities));
pw.append(", audioDescriptionByDefaultEnabled=")
.append(String.valueOf(mIsAudioDescriptionByDefaultRequested));
pw.append(", magnificationFollowTypingEnabled=")
.append(String.valueOf(mMagnificationFollowTypingEnabled));
pw.append("}");
pw.println();
pw.append(" shortcut key:{");

View File

@@ -769,6 +769,10 @@ public class FullScreenMagnificationController implements
mMagnificationFollowTypingEnabled = enabled;
}
boolean isMagnificationFollowTypingEnabled() {
return mMagnificationFollowTypingEnabled;
}
/**
* Remove the display magnification with given id.
*

View File

@@ -365,13 +365,18 @@ public class MagnificationProcessor {
mController.getFullScreenMagnificationController().unregister(displayId);
}
/** Dumps {@link MagnificationConfig} and magnification region of magnifiers on the displays. */
/**
* Dumps magnification configuration {@link MagnificationConfig} and state for each
* {@link Display}
*/
public void dump(final PrintWriter pw, ArrayList<Display> displaysList) {
for (int i = 0; i < displaysList.size(); i++) {
final int displayId = displaysList.get(i).getDisplayId();
final MagnificationConfig config = getMagnificationConfig(displayId);
pw.println("Magnifier on display#" + displayId);
pw.append(" " + config).println();
final Region region = new Region();
getCurrentMagnificationRegion(displayId, region, true);
if (!region.isEmpty()) {
@@ -379,6 +384,8 @@ public class MagnificationProcessor {
}
pw.append(" IdOfLastServiceToMagnify="
+ getIdOfLastServiceToMagnify(config.getMode(), displayId)).println();
dumpTrackingTypingFocusEnabledState(pw, displayId, config.getMode());
}
}
@@ -389,4 +396,13 @@ public class MagnificationProcessor {
: mController.getWindowMagnificationMgr().getIdOfLastServiceToMagnify(
displayId);
}
private void dumpTrackingTypingFocusEnabledState(final PrintWriter pw, int displayId,
int mode) {
if (mode == MAGNIFICATION_MODE_WINDOW) {
pw.append(" TrackingTypingFocusEnabled=" + mController
.getWindowMagnificationMgr().isTrackingTypingFocusEnabled(displayId))
.println();
}
}
}

View File

@@ -318,6 +318,10 @@ public class WindowMagnificationManager implements
mMagnificationFollowTypingEnabled = enabled;
}
boolean isMagnificationFollowTypingEnabled() {
return mMagnificationFollowTypingEnabled;
}
/**
* Get the ID of the last service that changed the magnification config.
*