Loading services/core/java/com/android/server/wm/AccessibilityController.java +11 −8 Original line number Original line Diff line number Diff line Loading @@ -412,8 +412,9 @@ final class AccessibilityController { private final WindowManager mWindowManager; private final WindowManager mWindowManager; private final int mBorderWidth; private final float mBorderWidth; private final int mHalfBorderWidth; private final int mHalfBorderWidth; private final int mDrawBorderInset; private final ViewportWindow mWindow; private final ViewportWindow mWindow; Loading @@ -421,10 +422,11 @@ final class AccessibilityController { public MagnifiedViewport() { public MagnifiedViewport() { mWindowManager = (WindowManager) mContext.getSystemService(Service.WINDOW_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Service.WINDOW_SERVICE); mBorderWidth = (int) TypedValue.applyDimension( mBorderWidth = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, DEFAUTLT_BORDER_WIDTH_DIP, TypedValue.COMPLEX_UNIT_DIP, DEFAUTLT_BORDER_WIDTH_DIP, mContext.getResources().getDisplayMetrics()); mContext.getResources().getDisplayMetrics()); mHalfBorderWidth = (int) (mBorderWidth + 0.5) / 2; mHalfBorderWidth = (int) Math.ceil(mBorderWidth / 2); mDrawBorderInset = (int) mBorderWidth / 2; mWindow = new ViewportWindow(mContext); mWindow = new ViewportWindow(mContext); recomputeBoundsLocked(); recomputeBoundsLocked(); } } Loading @@ -437,7 +439,8 @@ final class AccessibilityController { } } // If this message is pending we are in a rotation animation and do not want // If this message is pending we are in a rotation animation and do not want // to show the border. We will do so when the pending message is handled. // to show the border. We will do so when the pending message is handled. if (!mHandler.hasMessages(MyHandler.MESSAGE_SHOW_MAGNIFIED_REGION_BOUNDS_IF_NEEDED)) { if (!mHandler.hasMessages( MyHandler.MESSAGE_SHOW_MAGNIFIED_REGION_BOUNDS_IF_NEEDED)) { setMagnifiedRegionBorderShownLocked(isMagnifyingLocked(), true); setMagnifiedRegionBorderShownLocked(isMagnifyingLocked(), true); } } } } Loading Loading @@ -513,8 +516,8 @@ final class AccessibilityController { visibleWindows.clear(); visibleWindows.clear(); magnifiedBounds.op(mHalfBorderWidth, mHalfBorderWidth, magnifiedBounds.op(mDrawBorderInset, mDrawBorderInset, screenWidth - mHalfBorderWidth, screenHeight - mHalfBorderWidth, screenWidth - mDrawBorderInset, screenHeight - mDrawBorderInset, Region.Op.INTERSECT); Region.Op.INTERSECT); if (!mOldMagnifiedBounds.equals(magnifiedBounds)) { if (!mOldMagnifiedBounds.equals(magnifiedBounds)) { Loading @@ -527,8 +530,8 @@ final class AccessibilityController { Rect dirtyRect = mTempRect1; Rect dirtyRect = mTempRect1; if (mFullRedrawNeeded) { if (mFullRedrawNeeded) { mFullRedrawNeeded = false; mFullRedrawNeeded = false; dirtyRect.set(mHalfBorderWidth, mHalfBorderWidth, dirtyRect.set(mDrawBorderInset, mDrawBorderInset, screenWidth - mHalfBorderWidth, screenHeight - mHalfBorderWidth); screenWidth - mDrawBorderInset, screenHeight - mDrawBorderInset); mWindow.invalidate(dirtyRect); mWindow.invalidate(dirtyRect); } else { } else { Region dirtyRegion = mTempRegion3; Region dirtyRegion = mTempRegion3; Loading Loading
services/core/java/com/android/server/wm/AccessibilityController.java +11 −8 Original line number Original line Diff line number Diff line Loading @@ -412,8 +412,9 @@ final class AccessibilityController { private final WindowManager mWindowManager; private final WindowManager mWindowManager; private final int mBorderWidth; private final float mBorderWidth; private final int mHalfBorderWidth; private final int mHalfBorderWidth; private final int mDrawBorderInset; private final ViewportWindow mWindow; private final ViewportWindow mWindow; Loading @@ -421,10 +422,11 @@ final class AccessibilityController { public MagnifiedViewport() { public MagnifiedViewport() { mWindowManager = (WindowManager) mContext.getSystemService(Service.WINDOW_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Service.WINDOW_SERVICE); mBorderWidth = (int) TypedValue.applyDimension( mBorderWidth = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, DEFAUTLT_BORDER_WIDTH_DIP, TypedValue.COMPLEX_UNIT_DIP, DEFAUTLT_BORDER_WIDTH_DIP, mContext.getResources().getDisplayMetrics()); mContext.getResources().getDisplayMetrics()); mHalfBorderWidth = (int) (mBorderWidth + 0.5) / 2; mHalfBorderWidth = (int) Math.ceil(mBorderWidth / 2); mDrawBorderInset = (int) mBorderWidth / 2; mWindow = new ViewportWindow(mContext); mWindow = new ViewportWindow(mContext); recomputeBoundsLocked(); recomputeBoundsLocked(); } } Loading @@ -437,7 +439,8 @@ final class AccessibilityController { } } // If this message is pending we are in a rotation animation and do not want // If this message is pending we are in a rotation animation and do not want // to show the border. We will do so when the pending message is handled. // to show the border. We will do so when the pending message is handled. if (!mHandler.hasMessages(MyHandler.MESSAGE_SHOW_MAGNIFIED_REGION_BOUNDS_IF_NEEDED)) { if (!mHandler.hasMessages( MyHandler.MESSAGE_SHOW_MAGNIFIED_REGION_BOUNDS_IF_NEEDED)) { setMagnifiedRegionBorderShownLocked(isMagnifyingLocked(), true); setMagnifiedRegionBorderShownLocked(isMagnifyingLocked(), true); } } } } Loading Loading @@ -513,8 +516,8 @@ final class AccessibilityController { visibleWindows.clear(); visibleWindows.clear(); magnifiedBounds.op(mHalfBorderWidth, mHalfBorderWidth, magnifiedBounds.op(mDrawBorderInset, mDrawBorderInset, screenWidth - mHalfBorderWidth, screenHeight - mHalfBorderWidth, screenWidth - mDrawBorderInset, screenHeight - mDrawBorderInset, Region.Op.INTERSECT); Region.Op.INTERSECT); if (!mOldMagnifiedBounds.equals(magnifiedBounds)) { if (!mOldMagnifiedBounds.equals(magnifiedBounds)) { Loading @@ -527,8 +530,8 @@ final class AccessibilityController { Rect dirtyRect = mTempRect1; Rect dirtyRect = mTempRect1; if (mFullRedrawNeeded) { if (mFullRedrawNeeded) { mFullRedrawNeeded = false; mFullRedrawNeeded = false; dirtyRect.set(mHalfBorderWidth, mHalfBorderWidth, dirtyRect.set(mDrawBorderInset, mDrawBorderInset, screenWidth - mHalfBorderWidth, screenHeight - mHalfBorderWidth); screenWidth - mDrawBorderInset, screenHeight - mDrawBorderInset); mWindow.invalidate(dirtyRect); mWindow.invalidate(dirtyRect); } else { } else { Region dirtyRegion = mTempRegion3; Region dirtyRegion = mTempRegion3; Loading