Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 611b80cf authored by Daniel Hsieh's avatar Daniel Hsieh
Browse files

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
parent 7481586a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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:{");
+4 −0
Original line number Diff line number Diff line
@@ -769,6 +769,10 @@ public class FullScreenMagnificationController implements
        mMagnificationFollowTypingEnabled = enabled;
    }

    boolean isMagnificationFollowTypingEnabled() {
        return mMagnificationFollowTypingEnabled;
    }

    /**
     * Remove the display magnification with given id.
     *
+17 −1
Original line number Diff line number Diff line
@@ -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();
        }
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -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.
     *