createWithSurfaceParent: add logging

There is a bug that we can't replicate in a test environment. These
added logs are to help us identify the root causes of the bug when
it happens in the field.

Test: compiles
Bug: 134888387
Change-Id: I0e9fe317ad8c6e65de30e5d9125252bef687d383
diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp
index 482c723..6bfd302 100644
--- a/services/surfaceflinger/Client.cpp
+++ b/services/surfaceflinger/Client.cpp
@@ -87,11 +87,18 @@
                                          LayerMetadata metadata, sp<IBinder>* handle,
                                          sp<IGraphicBufferProducer>* gbp) {
     if (mFlinger->authenticateSurfaceTexture(parent) == false) {
+        ALOGE("failed to authenticate surface texture");
+        // The extra parent layer check below before returning is to help with debugging
+        // b/134888387. Once the bug is fixed the check can be deleted.
+        if ((static_cast<MonitoredProducer*>(parent.get()))->getLayer() == nullptr) {
+            ALOGE("failed to find parent layer");
+        }
         return BAD_VALUE;
     }
 
     const auto& layer = (static_cast<MonitoredProducer*>(parent.get()))->getLayer();
     if (layer == nullptr) {
+        ALOGE("failed to find parent layer");
         return BAD_VALUE;
     }