summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceControl.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2017-07-27 10:25:59 -0700
committer chaviw <chaviw@google.com> 2017-08-23 11:28:02 -0700
commit0617894190ea0c3ee50889bee1d4df0f369b0761 (patch)
tree77cd6f74a747fa53216f7b55899030a45c35910a /libs/gui/SurfaceControl.cpp
parent4908fe5617855aace933ad25b1071170e2606688 (diff)
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
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r--libs/gui/SurfaceControl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp
index 58bd273de6..b9c5ef9580 100644
--- a/libs/gui/SurfaceControl.cpp
+++ b/libs/gui/SurfaceControl.cpp
@@ -191,6 +191,13 @@ status_t SurfaceControl::reparentChildren(const sp<IBinder>& newParentHandle) {
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;