From 0617894190ea0c3ee50889bee1d4df0f369b0761 Mon Sep 17 00:00:00 2001 From: chaviw Date: Thu, 27 Jul 2017 10:25:59 -0700 Subject: 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 --- libs/gui/SurfaceControl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/gui/SurfaceControl.cpp') 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& newParentHandle) { return mClient->reparentChildren(mHandle, newParentHandle); } +status_t SurfaceControl::reparentChild(const sp& newParentHandle, + const sp& 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; -- cgit v1.2.3-59-g8ed1b