am f81dc4c0: Merge "Screen magnification cannot be engaged in landscape on a phone." into jb-mr1-dev
* commit 'f81dc4c08b2985ef369134b73e1b383b8284e912': Screen magnification cannot be engaged in landscape on a phone.
This commit is contained in:
@@ -846,7 +846,6 @@ public final class ScreenMagnifier implements EventStreamTransformation {
|
|||||||
private static final class DisplayContentObserver {
|
private static final class DisplayContentObserver {
|
||||||
|
|
||||||
private static final int MESSAGE_SHOW_VIEWPORT_FRAME = 1;
|
private static final int MESSAGE_SHOW_VIEWPORT_FRAME = 1;
|
||||||
private static final int MESSAGE_RECOMPUTE_VIEWPORT_BOUNDS = 2;
|
|
||||||
private static final int MESSAGE_ON_RECTANGLE_ON_SCREEN_REQUESTED = 3;
|
private static final int MESSAGE_ON_RECTANGLE_ON_SCREEN_REQUESTED = 3;
|
||||||
private static final int MESSAGE_ON_WINDOW_TRANSITION = 4;
|
private static final int MESSAGE_ON_WINDOW_TRANSITION = 4;
|
||||||
private static final int MESSAGE_ON_ROTATION_CHANGED = 5;
|
private static final int MESSAGE_ON_ROTATION_CHANGED = 5;
|
||||||
@@ -892,7 +891,9 @@ public final class ScreenMagnifier implements EventStreamTransformation {
|
|||||||
|| info.type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
|
|| info.type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
|
||||||
&& (transition == WindowManagerPolicy.TRANSIT_EXIT
|
&& (transition == WindowManagerPolicy.TRANSIT_EXIT
|
||||||
|| transition == WindowManagerPolicy.TRANSIT_HIDE)) {
|
|| transition == WindowManagerPolicy.TRANSIT_HIDE)) {
|
||||||
mHandler.sendMessageDelayed(message, mLongAnimationDuration);
|
final long delay = (long) (2 * mLongAnimationDuration
|
||||||
|
* mWindowAnimationScale);
|
||||||
|
mHandler.sendMessageDelayed(message, delay);
|
||||||
} else {
|
} else {
|
||||||
message.sendToTarget();
|
message.sendToTarget();
|
||||||
}
|
}
|
||||||
@@ -1170,10 +1171,6 @@ public final class ScreenMagnifier implements EventStreamTransformation {
|
|||||||
case MESSAGE_SHOW_VIEWPORT_FRAME: {
|
case MESSAGE_SHOW_VIEWPORT_FRAME: {
|
||||||
mViewport.setFrameShown(true, true);
|
mViewport.setFrameShown(true, true);
|
||||||
} break;
|
} break;
|
||||||
case MESSAGE_RECOMPUTE_VIEWPORT_BOUNDS: {
|
|
||||||
final boolean animate = message.arg1 == 1;
|
|
||||||
mViewport.recomputeBounds(animate);
|
|
||||||
} break;
|
|
||||||
case MESSAGE_ON_RECTANGLE_ON_SCREEN_REQUESTED: {
|
case MESSAGE_ON_RECTANGLE_ON_SCREEN_REQUESTED: {
|
||||||
SomeArgs args = (SomeArgs) message.obj;
|
SomeArgs args = (SomeArgs) message.obj;
|
||||||
try {
|
try {
|
||||||
@@ -1526,8 +1523,10 @@ public final class ScreenMagnifier implements EventStreamTransformation {
|
|||||||
Rect magnifiedFrame = mTempRect1;
|
Rect magnifiedFrame = mTempRect1;
|
||||||
magnifiedFrame.set(0, 0, 0, 0);
|
magnifiedFrame.set(0, 0, 0, 0);
|
||||||
|
|
||||||
Rect notMagnifiedFrame = mTempRect2;
|
DisplayInfo displayInfo = mDisplayProvider.getDisplayInfo();
|
||||||
notMagnifiedFrame.set(0, 0, 0, 0);
|
|
||||||
|
Rect availableFrame = mTempRect2;
|
||||||
|
availableFrame.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight);
|
||||||
|
|
||||||
ArrayList<WindowInfo> infos = mTempWindowInfoList;
|
ArrayList<WindowInfo> infos = mTempWindowInfoList;
|
||||||
infos.clear();
|
infos.clear();
|
||||||
@@ -1542,18 +1541,16 @@ public final class ScreenMagnifier implements EventStreamTransformation {
|
|||||||
if (info.type == WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY) {
|
if (info.type == WindowManager.LayoutParams.TYPE_MAGNIFICATION_OVERLAY) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Rect windowFrame = mTempRect3;
|
||||||
|
windowFrame.set(info.touchableRegion);
|
||||||
if (isWindowMagnified(info.type)) {
|
if (isWindowMagnified(info.type)) {
|
||||||
Rect clippedFrame = mTempRect3;
|
magnifiedFrame.union(windowFrame);
|
||||||
clippedFrame.set(info.touchableRegion);
|
magnifiedFrame.intersect(availableFrame);
|
||||||
subtract(clippedFrame, notMagnifiedFrame);
|
|
||||||
magnifiedFrame.union(clippedFrame);
|
|
||||||
} else {
|
} else {
|
||||||
Rect clippedFrame = mTempRect3;
|
subtract(windowFrame, magnifiedFrame);
|
||||||
clippedFrame.set(info.touchableRegion);
|
subtract(availableFrame, windowFrame);
|
||||||
subtract(clippedFrame, magnifiedFrame);
|
|
||||||
notMagnifiedFrame.union(clippedFrame);
|
|
||||||
}
|
}
|
||||||
if (magnifiedFrame.bottom >= notMagnifiedFrame.top) {
|
if (availableFrame.equals(magnifiedFrame)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user