Merge "Dump magnification tracking typing focus info for dumpsys accessibility"

This commit is contained in:
Daniel Hsieh
2022-01-25 12:05:01 +00:00
committed by Android (Google) Code Review
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.
*