Merge "Reset protection path on rotation" into qt-qpr1-dev am: cf0544b022
Change-Id: If0aba2000ab2802bf4df7341754f006485196a55
This commit is contained in:
@@ -26,7 +26,7 @@ import java.util.concurrent.Executor
|
|||||||
|
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
const val TAG = "CameraOpTransitionController"
|
const val TAG = "CameraAvailabilityListener"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listens for usage of the Camera and controls the ScreenDecorations transition to show extra
|
* Listens for usage of the Camera and controls the ScreenDecorations transition to show extra
|
||||||
|
|||||||
@@ -724,9 +724,10 @@ public class ScreenDecorations extends SystemUI implements Tunable {
|
|||||||
private final List<Rect> mBounds = new ArrayList();
|
private final List<Rect> mBounds = new ArrayList();
|
||||||
private final Rect mBoundingRect = new Rect();
|
private final Rect mBoundingRect = new Rect();
|
||||||
private final Path mBoundingPath = new Path();
|
private final Path mBoundingPath = new Path();
|
||||||
// Don't initialize these because they are cached elsewhere and may not exist
|
// Don't initialize these yet because they may never exist
|
||||||
private Rect mProtectionRect;
|
private Rect mProtectionRect;
|
||||||
private Path mProtectionPath;
|
private Path mProtectionPath;
|
||||||
|
private Path mProtectionPathOrig;
|
||||||
private Rect mTotalBounds = new Rect();
|
private Rect mTotalBounds = new Rect();
|
||||||
// Whether or not to show the cutout protection path
|
// Whether or not to show the cutout protection path
|
||||||
private boolean mShowProtection = false;
|
private boolean mShowProtection = false;
|
||||||
@@ -812,7 +813,11 @@ public class ScreenDecorations extends SystemUI implements Tunable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setProtection(Path protectionPath, Rect pathBounds) {
|
void setProtection(Path protectionPath, Rect pathBounds) {
|
||||||
mProtectionPath = protectionPath;
|
if (mProtectionPathOrig == null) {
|
||||||
|
mProtectionPathOrig = new Path();
|
||||||
|
mProtectionPath = new Path();
|
||||||
|
}
|
||||||
|
mProtectionPathOrig.set(protectionPath);
|
||||||
mProtectionRect = pathBounds;
|
mProtectionRect = pathBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -889,7 +894,9 @@ public class ScreenDecorations extends SystemUI implements Tunable {
|
|||||||
Matrix m = new Matrix();
|
Matrix m = new Matrix();
|
||||||
transformPhysicalToLogicalCoordinates(mInfo.rotation, dw, dh, m);
|
transformPhysicalToLogicalCoordinates(mInfo.rotation, dw, dh, m);
|
||||||
mBoundingPath.transform(m);
|
mBoundingPath.transform(m);
|
||||||
if (mProtectionPath != null) {
|
if (mProtectionPathOrig != null) {
|
||||||
|
// Reset the protection path so we don't aggregate rotations
|
||||||
|
mProtectionPath.set(mProtectionPathOrig);
|
||||||
mProtectionPath.transform(m);
|
mProtectionPath.transform(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user