Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -3497,6 +3497,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub pw.append("hasWindowMagnificationConnection=").append( String.valueOf(getWindowMagnificationMgr().isConnected())); pw.println(); mMagnificationProcessor.dump(pw, getValidDisplayList()); final int userCount = mUserStates.size(); for (int i = 0; i < userCount; i++) { mUserStates.valueAt(i).dump(fd, pw, args); Loading services/accessibility/java/com/android/server/accessibility/magnification/MagnificationProcessor.java +29 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ import static android.view.accessibility.MagnificationAnimationCallback.STUB_ANI import android.accessibilityservice.MagnificationConfig; import android.annotation.NonNull; import android.graphics.Region; import android.view.Display; import java.io.PrintWriter; import java.util.ArrayList; /** * Processor class for AccessibilityService connection to control magnification on the specified Loading Loading @@ -360,4 +364,29 @@ public class MagnificationProcessor { private void unregister(int displayId) { mController.getFullScreenMagnificationController().unregister(displayId); } /** Dumps {@link MagnificationConfig} and magnification region of magnifiers on the displays. */ 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()) { pw.append(" Magnification region=").append(region.toString()).println(); } pw.append(" IdOfLastServiceToMagnify=" + getIdOfLastServiceToMagnify(config.getMode(), displayId)).println(); } } private int getIdOfLastServiceToMagnify(int mode, int displayId) { return (mode == MAGNIFICATION_MODE_FULLSCREEN) ? mController.getFullScreenMagnificationController() .getIdOfLastServiceToMagnify(displayId) : mController.getWindowMagnificationMgr().getIdOfLastServiceToMagnify( displayId); } } services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,22 @@ public class WindowMagnificationManager implements mMagnificationFollowTypingEnabled = enabled; } /** * Get the ID of the last service that changed the magnification config. * * @param displayId The logical display id. * @return The id */ public int getIdOfLastServiceToMagnify(int displayId) { synchronized (mLock) { final WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); if (magnifier != null) { return magnifier.mIdOfLastServiceToControl; } } return INVALID_SERVICE_ID; } /** * Enable or disable tracking typing focus for the specific magnification window. * Loading Loading @@ -466,6 +482,7 @@ public class WindowMagnificationManager implements boolean previousEnabled; synchronized (mLock) { if (mConnectionWrapper == null) { Slog.w(TAG, "enableWindowMagnification failed: connection null"); return false; } WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); Loading Loading @@ -508,6 +525,7 @@ public class WindowMagnificationManager implements synchronized (mLock) { WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); if (magnifier == null || mConnectionWrapper == null) { Slog.w(TAG, "disableWindowMagnification failed: connection " + mConnectionWrapper); return false; } disabled = magnifier.disableWindowMagnificationInternal(animationCallback); Loading Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +1 −0 Original line number Diff line number Diff line Loading @@ -3497,6 +3497,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub pw.append("hasWindowMagnificationConnection=").append( String.valueOf(getWindowMagnificationMgr().isConnected())); pw.println(); mMagnificationProcessor.dump(pw, getValidDisplayList()); final int userCount = mUserStates.size(); for (int i = 0; i < userCount; i++) { mUserStates.valueAt(i).dump(fd, pw, args); Loading
services/accessibility/java/com/android/server/accessibility/magnification/MagnificationProcessor.java +29 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,10 @@ import static android.view.accessibility.MagnificationAnimationCallback.STUB_ANI import android.accessibilityservice.MagnificationConfig; import android.annotation.NonNull; import android.graphics.Region; import android.view.Display; import java.io.PrintWriter; import java.util.ArrayList; /** * Processor class for AccessibilityService connection to control magnification on the specified Loading Loading @@ -360,4 +364,29 @@ public class MagnificationProcessor { private void unregister(int displayId) { mController.getFullScreenMagnificationController().unregister(displayId); } /** Dumps {@link MagnificationConfig} and magnification region of magnifiers on the displays. */ 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()) { pw.append(" Magnification region=").append(region.toString()).println(); } pw.append(" IdOfLastServiceToMagnify=" + getIdOfLastServiceToMagnify(config.getMode(), displayId)).println(); } } private int getIdOfLastServiceToMagnify(int mode, int displayId) { return (mode == MAGNIFICATION_MODE_FULLSCREEN) ? mController.getFullScreenMagnificationController() .getIdOfLastServiceToMagnify(displayId) : mController.getWindowMagnificationMgr().getIdOfLastServiceToMagnify( displayId); } }
services/accessibility/java/com/android/server/accessibility/magnification/WindowMagnificationManager.java +18 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,22 @@ public class WindowMagnificationManager implements mMagnificationFollowTypingEnabled = enabled; } /** * Get the ID of the last service that changed the magnification config. * * @param displayId The logical display id. * @return The id */ public int getIdOfLastServiceToMagnify(int displayId) { synchronized (mLock) { final WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); if (magnifier != null) { return magnifier.mIdOfLastServiceToControl; } } return INVALID_SERVICE_ID; } /** * Enable or disable tracking typing focus for the specific magnification window. * Loading Loading @@ -466,6 +482,7 @@ public class WindowMagnificationManager implements boolean previousEnabled; synchronized (mLock) { if (mConnectionWrapper == null) { Slog.w(TAG, "enableWindowMagnification failed: connection null"); return false; } WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); Loading Loading @@ -508,6 +525,7 @@ public class WindowMagnificationManager implements synchronized (mLock) { WindowMagnifier magnifier = mWindowMagnifiers.get(displayId); if (magnifier == null || mConnectionWrapper == null) { Slog.w(TAG, "disableWindowMagnification failed: connection " + mConnectionWrapper); return false; } disabled = magnifier.disableWindowMagnificationInternal(animationCallback); Loading