summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2021-06-29 15:42:56 -0700
committer Winson Chung <winsonc@google.com> 2021-11-05 21:47:27 +0000
commit7605fb4273cfdf922a041f201dbcc1e10fae1fe2 (patch)
tree4cddb42a47789428ea4cde8fc7a3b3c92633b9ec /libs/gui/LayerState.cpp
parent39bc6117dda8cf5f6f43846f18fc0fed87692efa (diff)
Add mechanism for a task's windows to be trusted overlays (SF)
- Add a layer state to indicate that this layer and its children in the hierarchy are trusted. This can only be set by callers holding ACCESS_SURFACE_FLINGER, and will be used for the PIP task layer to indicate that activities in PIP are trusted (as they are controlled only by the user and SystemUI) Bug: 191529039 Bug: 196389741 Test: TBD Change-Id: Id92ccb087bd0d8dbaeeef3ba50b67fe015e53db8 Merged-In: Id92ccb087bd0d8dbaeeef3ba50b67fe015e53db8
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index e43446ac8c..a897d1025f 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -117,6 +117,8 @@ status_t layer_state_t::write(Parcel& output) const
output.writeFloat(frameRate);
output.writeByte(frameRateCompatibility);
output.writeUint32(fixedTransformHint);
+ output.writeBool(isTrustedOverlay);
+
return NO_ERROR;
}
@@ -200,6 +202,8 @@ status_t layer_state_t::read(const Parcel& input)
frameRate = input.readFloat();
frameRateCompatibility = input.readByte();
fixedTransformHint = static_cast<ui::Transform::RotationFlags>(input.readUint32());
+ isTrustedOverlay = input.readBool();
+
return NO_ERROR;
}
@@ -439,6 +443,10 @@ void layer_state_t::merge(const layer_state_t& other) {
what |= eFixedTransformHintChanged;
fixedTransformHint = other.fixedTransformHint;
}
+ if (other.what & eTrustedOverlayChanged) {
+ what |= eTrustedOverlayChanged;
+ isTrustedOverlay = other.isTrustedOverlay;
+ }
if ((other.what & what) != other.what) {
ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? "
"other.what=0x%" PRIu64 " what=0x%" PRIu64,