Loading services/core/java/com/android/server/wm/AccessibilityController.java +29 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.content.pm.PackageManagerInternal; import android.graphics.BLASTBufferQueue; import android.graphics.BLASTBufferQueue; import android.graphics.Canvas; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Color; import android.graphics.Insets; import android.graphics.Matrix; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path; Loading Loading @@ -965,6 +966,13 @@ final class AccessibilityController { availableBounds.op(navBarInsets, Region.Op.DIFFERENCE); availableBounds.op(navBarInsets, Region.Op.DIFFERENCE); } } // Count letterbox into nonMagnifiedBounds if (windowState.areAppWindowBoundsLetterboxed()) { Region letterboxBounds = getLetterboxBounds(windowState); nonMagnifiedBounds.op(letterboxBounds, Region.Op.UNION); availableBounds.op(letterboxBounds, Region.Op.DIFFERENCE); } // Update accounted bounds // Update accounted bounds Region accountedBounds = mTempRegion2; Region accountedBounds = mTempRegion2; accountedBounds.set(mMagnificationRegion); accountedBounds.set(mMagnificationRegion); Loading Loading @@ -1014,6 +1022,27 @@ final class AccessibilityController { } } } } private Region getLetterboxBounds(WindowState windowState) { final ActivityRecord appToken = windowState.mActivityRecord; if (appToken == null) { return new Region(); } final Rect boundsWithoutLetterbox = windowState.getBounds(); final Rect letterboxInsets = appToken.getLetterboxInsets(); final Rect boundsIncludingLetterbox = Rect.copyOrNull(boundsWithoutLetterbox); // Letterbox insets from mActivityRecord are positive, so we negate them to grow the // bounds to include the letterbox. boundsIncludingLetterbox.inset( Insets.subtract(Insets.NONE, Insets.of(letterboxInsets))); final Region letterboxBounds = new Region(); letterboxBounds.set(boundsIncludingLetterbox); letterboxBounds.op(boundsWithoutLetterbox, Region.Op.DIFFERENCE); return letterboxBounds; } private boolean isExcludedWindowType(int windowType) { private boolean isExcludedWindowType(int windowType) { return windowType == TYPE_MAGNIFICATION_OVERLAY return windowType == TYPE_MAGNIFICATION_OVERLAY // Omit the touch region of window magnification to avoid the cut out of the // Omit the touch region of window magnification to avoid the cut out of the Loading Loading
services/core/java/com/android/server/wm/AccessibilityController.java +29 −0 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.content.pm.PackageManagerInternal; import android.graphics.BLASTBufferQueue; import android.graphics.BLASTBufferQueue; import android.graphics.Canvas; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Color; import android.graphics.Insets; import android.graphics.Matrix; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Path; Loading Loading @@ -965,6 +966,13 @@ final class AccessibilityController { availableBounds.op(navBarInsets, Region.Op.DIFFERENCE); availableBounds.op(navBarInsets, Region.Op.DIFFERENCE); } } // Count letterbox into nonMagnifiedBounds if (windowState.areAppWindowBoundsLetterboxed()) { Region letterboxBounds = getLetterboxBounds(windowState); nonMagnifiedBounds.op(letterboxBounds, Region.Op.UNION); availableBounds.op(letterboxBounds, Region.Op.DIFFERENCE); } // Update accounted bounds // Update accounted bounds Region accountedBounds = mTempRegion2; Region accountedBounds = mTempRegion2; accountedBounds.set(mMagnificationRegion); accountedBounds.set(mMagnificationRegion); Loading Loading @@ -1014,6 +1022,27 @@ final class AccessibilityController { } } } } private Region getLetterboxBounds(WindowState windowState) { final ActivityRecord appToken = windowState.mActivityRecord; if (appToken == null) { return new Region(); } final Rect boundsWithoutLetterbox = windowState.getBounds(); final Rect letterboxInsets = appToken.getLetterboxInsets(); final Rect boundsIncludingLetterbox = Rect.copyOrNull(boundsWithoutLetterbox); // Letterbox insets from mActivityRecord are positive, so we negate them to grow the // bounds to include the letterbox. boundsIncludingLetterbox.inset( Insets.subtract(Insets.NONE, Insets.of(letterboxInsets))); final Region letterboxBounds = new Region(); letterboxBounds.set(boundsIncludingLetterbox); letterboxBounds.op(boundsWithoutLetterbox, Region.Op.DIFFERENCE); return letterboxBounds; } private boolean isExcludedWindowType(int windowType) { private boolean isExcludedWindowType(int windowType) { return windowType == TYPE_MAGNIFICATION_OVERLAY return windowType == TYPE_MAGNIFICATION_OVERLAY // Omit the touch region of window magnification to avoid the cut out of the // Omit the touch region of window magnification to avoid the cut out of the Loading