VRR: Use appId to replace uid mapping
Uid is combination of user id and app id. Because the allowlist
is recored by pkg for each users. We could ignore the user id part
and it also could solve the issue we didn't update the mapping
when user added case.
Bug: 298722189
Test: atest SmallAreaDetectionAllowMappingsTest
Test: atest SmallAreaDetectionControllerTest
Test: Add new user and open Youtube short to check refresh rate
Change-Id: Ic80be38ebc19938bc061bf6121c68efc4ff9ac4c
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 9a5173b..6b56138 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -205,6 +205,7 @@
mOwnerUid = args.ownerUid;
mOwnerPid = args.ownerPid;
+ mOwnerAppId = mOwnerUid % PER_USER_RANGE;
mPremultipliedAlpha = !(args.flags & ISurfaceComposerClient::eNonPremultiplied);
mPotentialCursor = args.flags & ISurfaceComposerClient::eCursorWindow;
@@ -4388,7 +4389,7 @@
// If the damage region is a small dirty, this could give the hint for the layer history that
// it could suppress the heuristic rate when calculating.
- mSmallDirty = mFlinger->mScheduler->isSmallDirtyArea(mOwnerUid,
+ mSmallDirty = mFlinger->mScheduler->isSmallDirtyArea(mOwnerAppId,
bounds.getWidth() * bounds.getHeight());
}