Merge "Update typeId for BufferQueueLayer and BufferStateLayer"
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index fb8d7d0..ee44cbe 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -62,10 +62,6 @@
void useSurfaceDamage() override;
void useEmptyDamage() override;
- // getTypeId - Provide unique string for each class type in the Layer
- // hierarchy
- const char* getTypeId() const override { return "BufferLayer"; }
-
bool isOpaque(const Layer::State& s) const override;
// isVisible - true if this layer is visible, false otherwise
diff --git a/services/surfaceflinger/BufferQueueLayer.h b/services/surfaceflinger/BufferQueueLayer.h
index 392b706..3bc625e 100644
--- a/services/surfaceflinger/BufferQueueLayer.h
+++ b/services/surfaceflinger/BufferQueueLayer.h
@@ -38,6 +38,8 @@
// Interface implementation for Layer
// -----------------------------------------------------------------------
public:
+ const char* getType() const override { return "BufferQueueLayer"; }
+
void onLayerDisplayed(const sp<Fence>& releaseFence) override;
void setTransformHint(uint32_t orientation) const override;
diff --git a/services/surfaceflinger/BufferStateLayer.h b/services/surfaceflinger/BufferStateLayer.h
index 0ee941e..cc67008 100644
--- a/services/surfaceflinger/BufferStateLayer.h
+++ b/services/surfaceflinger/BufferStateLayer.h
@@ -40,6 +40,8 @@
// -----------------------------------------------------------------------
// Interface implementation for Layer
// -----------------------------------------------------------------------
+ const char* getType() const override { return "BufferStateLayer"; }
+
void onLayerDisplayed(const sp<Fence>& releaseFence) override;
void setTransformHint(uint32_t orientation) const override;
void releasePendingBuffer(nsecs_t dequeueReadyTime) override;
diff --git a/services/surfaceflinger/ColorLayer.h b/services/surfaceflinger/ColorLayer.h
index c793142..57c54c7 100644
--- a/services/surfaceflinger/ColorLayer.h
+++ b/services/surfaceflinger/ColorLayer.h
@@ -30,7 +30,7 @@
std::shared_ptr<compositionengine::Layer> getCompositionLayer() const override;
- virtual const char* getTypeId() const { return "ColorLayer"; }
+ const char* getType() const override { return "ColorLayer"; }
bool isVisible() const override;
bool setColor(const half3& color) override;
diff --git a/services/surfaceflinger/ContainerLayer.h b/services/surfaceflinger/ContainerLayer.h
index a1607ff..f0fbb61 100644
--- a/services/surfaceflinger/ContainerLayer.h
+++ b/services/surfaceflinger/ContainerLayer.h
@@ -28,7 +28,7 @@
explicit ContainerLayer(const LayerCreationArgs&);
~ContainerLayer() override;
- const char* getTypeId() const override { return "ContainerLayer"; }
+ const char* getType() const override { return "ContainerLayer"; }
bool isVisible() const override;
bool canReceiveInput() const override;
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index db4ae41..5121835 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1217,7 +1217,7 @@
info.mName = getName();
sp<Layer> parent = getParent();
info.mParentName = (parent == nullptr ? std::string("none") : parent->getName().string());
- info.mType = std::string(getTypeId());
+ info.mType = getType();
info.mTransparentRegion = ds.activeTransparentRegion_legacy;
info.mVisibleRegion = visibleRegion;
info.mSurfaceDamageRegion = surfaceDamageRegion;
@@ -1334,7 +1334,7 @@
}
void Layer::dumpFrameEvents(std::string& result) {
- StringAppendF(&result, "- Layer %s (%s, %p)\n", getName().string(), getTypeId(), this);
+ StringAppendF(&result, "- Layer %s (%s, %p)\n", getName().string(), getType(), this);
Mutex::Autolock lock(mFrameEventHistoryMutex);
mFrameEventHistory.checkFencesForCompletion();
mFrameEventHistory.dump(result);
@@ -1868,7 +1868,7 @@
if (traceFlags & SurfaceTracing::TRACE_CRITICAL) {
layerInfo->set_id(sequence);
layerInfo->set_name(getName().c_str());
- layerInfo->set_type(String8(getTypeId()));
+ layerInfo->set_type(getType());
for (const auto& child : children) {
layerInfo->add_children(child->sequence);
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 53091a0..9107189 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -378,7 +378,9 @@
// -----------------------------------------------------------------------
// Virtuals
- virtual const char* getTypeId() const = 0;
+
+ // Provide unique string for each class type in the Layer hierarchy
+ virtual const char* getType() const = 0;
/*
* isOpaque - true if this surface is opaque