summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Alan Ding <alanding@google.com> 2024-05-02 18:28:45 -0700
committer Alan Ding <alanding@google.com> 2024-05-10 21:26:34 +0000
commitfc6eab5d5b3c6372118ba5193bcf5ea7e73a0a67 (patch)
tree04e07e56c04aa1cfc42df009b9a5a5a303f5ac59 /libs/gui/SurfaceComposerClient.cpp
parentdb8c7b40ec0fbb491f5f3ca6b7cc50a7144ee6c0 (diff)
SF: Propagate uniqueID when creating virtual displays
This is part of Trunk Stable effort to upstream SF-ARC screen record capabiliy (undiverging http://ag/20003031) which requires mirroring virtual displays to be associated with screen capture sessions using the package name within the unique ID. Creating virtual display with unique ID specified is optional such that it doesn't affect existing consumers who don't need it (i.e. av). Bug: 137375833 Bug: 194863377 Test: libsurfaceflinger_unittest Change-Id: Ia3cd13df07f701593ddc94c196df0b04844cf502
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 4f1356bebb..07664ca701 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -89,6 +89,8 @@ int64_t generateId() {
void emptyCallback(nsecs_t, const sp<Fence>&, const std::vector<SurfaceControlStats>&) {}
} // namespace
+const std::string SurfaceComposerClient::kEmpty{};
+
ComposerService::ComposerService()
: Singleton<ComposerService>() {
Mutex::Autolock _l(mLock);
@@ -1276,14 +1278,13 @@ status_t SurfaceComposerClient::Transaction::sendSurfaceFlushJankDataTransaction
}
// ---------------------------------------------------------------------------
-sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool secure,
- float requestedRefereshRate) {
+sp<IBinder> SurfaceComposerClient::createDisplay(const String8& displayName, bool isSecure,
+ const std::string& uniqueId,
+ float requestedRefreshRate) {
sp<IBinder> display = nullptr;
- binder::Status status =
- ComposerServiceAIDL::getComposerService()->createDisplay(std::string(
- displayName.c_str()),
- secure, requestedRefereshRate,
- &display);
+ binder::Status status = ComposerServiceAIDL::getComposerService()
+ ->createDisplay(std::string(displayName.c_str()), isSecure,
+ uniqueId, requestedRefreshRate, &display);
return status.isOk() ? display : nullptr;
}