Only detach children from a different client than parent.

The purpose of detach is prevent another client from modifying
the layer. Therefore, layers with the same client as their parent
shouldn't be detached because the parent can and should be able
to still modify those layers.

Test: Updated Transaction_test so it has a test when the parent detaches
children with same client and detaches children with different client.

Change-Id: Ieede3c7b472e6eaa567163876b71cc9d7e889daf
diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp
index 8ba6cb9..ea6541a 100644
--- a/services/surfaceflinger/Client.cpp
+++ b/services/surfaceflinger/Client.cpp
@@ -140,7 +140,8 @@
 {
     sp<Layer> parent = nullptr;
     if (parentHandle != nullptr) {
-        parent = getLayerUser(parentHandle);
+        auto layerHandle = reinterpret_cast<Layer::Handle*>(parentHandle.get());
+        parent = layerHandle->owner.promote();
         if (parent == nullptr) {
             return NAME_NOT_FOUND;
         }