Merge "Surfaceflinger: Propagate type & UID from parent layers" into oc-dev
am: 4ba6f99070
Change-Id: Iefbb9bd3c578fe8d8662f7d35422f6f20b8110a1
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 8220d0a..b43b30d 100755
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -697,7 +697,16 @@
mName.string(), z, to_string(error).c_str(),
static_cast<int32_t>(error));
- error = hwcLayer->setInfo(s.type, s.appId);
+ int type = s.type;
+ int appId = s.appId;
+ sp<Layer> parent = mParent.promote();
+ if (parent.get()) {
+ auto& parentState = parent->getDrawingState();
+ type = parentState.type;
+ appId = parentState.appId;
+ }
+
+ error = hwcLayer->setInfo(type, appId);
ALOGE_IF(error != HWC2::Error::None, "[%s] Failed to set info (%d)",
mName.string(), static_cast<int32_t>(error));
#else