summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2023-02-14 18:21:02 +0000
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2023-02-14 18:21:02 +0000
commit5a2cb3d164568db9394b05db690a35b709661837 (patch)
tree8de221b17b61366d1d8ce36612a9b44b7250f7a6 /libs/gui/LayerState.cpp
parentd1735f8e6ff1737e6aa93e3d92f2b5852e523fd6 (diff)
parentc710617ac6489a7f518c5138a78059a99f98e38d (diff)
Merge cherrypicks of ['googleplex-android-review.googlesource.com/20681289'] into tm-qpr2-release.
Change-Id: I33ee618b57888960c7a24bde307a40032333b807
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 502031c8d8..74e6ae6a9b 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -353,6 +353,27 @@ void DisplayState::merge(const DisplayState& other) {
}
}
+void DisplayState::sanitize(int32_t permissions) {
+ if (what & DisplayState::eLayerStackChanged) {
+ if (!(permissions & layer_state_t::Permission::ACCESS_SURFACE_FLINGER)) {
+ what &= ~DisplayState::eLayerStackChanged;
+ ALOGE("Stripped attempt to set eLayerStackChanged in sanitize");
+ }
+ }
+ if (what & DisplayState::eDisplayProjectionChanged) {
+ if (!(permissions & layer_state_t::Permission::ACCESS_SURFACE_FLINGER)) {
+ what &= ~DisplayState::eDisplayProjectionChanged;
+ ALOGE("Stripped attempt to set eDisplayProjectionChanged in sanitize");
+ }
+ }
+ if (what & DisplayState::eSurfaceChanged) {
+ if (!(permissions & layer_state_t::Permission::ACCESS_SURFACE_FLINGER)) {
+ what &= ~DisplayState::eSurfaceChanged;
+ ALOGE("Stripped attempt to set eSurfaceChanged in sanitize");
+ }
+ }
+}
+
void layer_state_t::sanitize(int32_t permissions) {
// TODO: b/109894387
//