Use Transactions for RefreshRateOverlay
RefreshRateOverlay currently calls directly in Layer to update
properties. This is ends up adding confusing code to RefreshRateOverlay
since it needs to notify SF to handle the updates. It also creates
addtional confusion since there are multiple entries to layer
properties.
Instead, use the SCC Transaction requests to accomplish the same
behavior. This simplifies the code and also allows SF to handle the
updates instead of RefreshRateOverlay invoking force updates.
Test: RefreshRateOverlay works with rotation, different refresh rates
Test: RefreshRateOverlayTest
Bug: 200820757
Change-Id: I8503c61456c4c14ce6cbcdb2b27035a340fecbf5
diff --git a/services/surfaceflinger/ClientCache.cpp b/services/surfaceflinger/ClientCache.cpp
index 1ef8f78..e7b8995 100644
--- a/services/surfaceflinger/ClientCache.cpp
+++ b/services/surfaceflinger/ClientCache.cpp
@@ -82,10 +82,13 @@
return false;
}
- status_t err = token->linkToDeath(mDeathRecipient);
- if (err != NO_ERROR) {
- ALOGE("failed to cache buffer: could not link to death");
- return false;
+ // Only call linkToDeath if not a local binder
+ if (token->localBinder() == nullptr) {
+ status_t err = token->linkToDeath(mDeathRecipient);
+ if (err != NO_ERROR) {
+ ALOGE("failed to cache buffer: could not link to death");
+ return false;
+ }
}
auto [itr, success] =
mBuffers.emplace(processToken,