Add a re-parent function to re-parent a specific child.
This is similar to reparentChildren, but the reparentChild will
only re-parent a specific child to the new parent and not all
children.
Test: Added test in Transaction_test for reparentChild.
Change-Id: I4275e0d5f1d5601b489956753c78a56d1a5d4c1c
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 58bd273..b9c5ef9 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -191,6 +191,13 @@
return mClient->reparentChildren(mHandle, newParentHandle);
}
+status_t SurfaceControl::reparentChild(const sp<IBinder>& newParentHandle,
+ const sp<IBinder>& childHandle) {
+ status_t err = validate();
+ if (err < 0) return err;
+ return mClient->reparentChild(mHandle, newParentHandle, childHandle);
+}
+
status_t SurfaceControl::detachChildren() {
status_t err = validate();
if (err < 0) return err;