Revert "SF: use shared_ptr to track hwcLayer"

This reverts commit 5d89c1d614426144b6430868a69db2b29b179213.

The original commit was part of a larger set that has been backed
out temporarily while some bugs are sorted out.   This change
should have been backed out as well as it depends on the others
in the larger change.

Test: run cts -m CtsViewTestCases
Bug: 79264214

Change-Id: Ifa9388d9f9573073832a40075317fdabf74b180c
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 182ef8a..52d2de2 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -455,15 +455,7 @@
         if (getBE().mHwcLayers.count(hwcId) == 0) {
             return nullptr;
         }
-        return *(getBE().mHwcLayers[hwcId].layer.get());
-    }
-
-    bool setHwcLayer(int32_t hwcId) {
-        if (getBE().mHwcLayers.count(hwcId) == 0) {
-            return false;
-        }
-        getBE().compositionInfo.hwc.hwcLayer = getBE().mHwcLayers[hwcId].layer;
-        return true;
+        return getBE().mHwcLayers[hwcId].layer;
     }
 
     // -----------------------------------------------------------------------