fix dumpsys Layer name when using multiple displays
Bug: 7288401
Change-Id: I14beeef58fac5270cef3b611e18c163060efe6c3
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index dd9a762..be4af51 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -901,14 +901,16 @@
return getLayerIterator(id, numLayers);
}
-void HWComposer::dump(String8& result, char* buffer, size_t SIZE,
- const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const {
+void HWComposer::dump(String8& result, char* buffer, size_t SIZE) const {
if (mHwc) {
result.appendFormat("Hardware Composer state (version %8x):\n", hwcApiVersion(mHwc));
result.appendFormat(" mDebugForceFakeVSync=%d\n", mDebugForceFakeVSync);
for (size_t i=0 ; i<mNumDisplays ; i++) {
const DisplayData& disp(mDisplayData[i]);
+ const Vector< sp<LayerBase> >& visibleLayersSortedByZ =
+ mFlinger->getLayerSortedByZForHwcDisplay(i);
+
if (disp.connected) {
result.appendFormat(
" Display[%d] : %ux%u, xdpi=%f, ydpi=%f, refresh=%lld\n",
@@ -928,6 +930,7 @@
const hwc_layer_1_t&l = disp.list->hwLayers[i];
int32_t format = -1;
String8 name("unknown");
+
if (i < visibleLayersSortedByZ.size()) {
const sp<LayerBase>& layer(visibleLayersSortedByZ[i]);
if (layer->getLayer() != NULL) {
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 269e147..a78ffac 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -258,8 +258,7 @@
friend class VSyncThread;
// for debugging ----------------------------------------------------------
- void dump(String8& out, char* scratch, size_t SIZE,
- const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const;
+ void dump(String8& out, char* scratch, size_t SIZE) const;
private:
void loadHwcModule();