Name the ScreenCaptureOutput
Set a name for ScreenCaptureOutput based on whether it's used for region
sampling or not and include the display's id if present.
In Output's mNamePlusId, drop " (NA)" for those without a display id.
This would be extraneous on the ScreenCaptureOutput, which will mark the
display for which it's being used.
Bug: 262706813
Test: look at traces
Change-Id: If447795f3580601434cbcb6493f5fb7c3fa734c9
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index d513731..d27add9 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -118,8 +118,9 @@
void Output::setName(const std::string& name) {
mName = name;
auto displayIdOpt = getDisplayId();
- mNamePlusId = base::StringPrintf("%s (%s)", mName.c_str(),
- displayIdOpt ? to_string(*displayIdOpt).c_str() : "NA");
+ mNamePlusId = displayIdOpt ? base::StringPrintf("%s (%s)", mName.c_str(),
+ to_string(*displayIdOpt).c_str())
+ : mName;
}
void Output::setCompositionEnabled(bool enabled) {