Update the how we propogate parent type and appId
SurfaceFlinger sends each layer's metadata (i.e. type and appId) to the hardware composer. The feature was introduced in Android Q for the 2D-in-VR feature that Daydream uses. The logic was introduced in ag/3738015. When sending layer information to hal, layers also inherit type and app id from parent node when parent node has valid type/appId. However, there are some descendents about what is the invalid type and appId. The original CL ag/3738015 assumes -1 is invalid, while newer CLs ag/6072974 and unittests assumes 0 as default value. Actually, the current unittests is correct, for two reasons: 1/ window type comes from WindowManager.LayoutParams and all values defined here are non-zero. 2/ appId is basically app's UID, which should not be zero (i.e. app never runs under root). Thus, I now have enough reason to conclude that the parent type and appId should be tested with "type > 0 && appId > 0". In another word, the parent is only valid when the type and appId are both non-zero. Bug: 133452166 Test: Inspect the output of "adb shell lshal debug android.hardware.graphics.composer@2.1::IComposer/vr" and verify that each layer's type and app_id are correctly populated. Test: atest libsurfaceflinger_unittest Change-Id: Ib039a54bba241839f49e0be6d87c021001b470e9
Loading
Please register or sign in to comment