Check whether VD tree is still valid before calling native setter

VD tree is ref-counted in both Java and native. VD's child nodes are
entirely owned by the native tree, as VD nodes in native should outlive
its Java counterparts, with one exception: when there's an infinite UI
animator running on VD, the animator may have weak reference to a few
child nodes. In the case of hidden animator running infinitely, the child
nodes would keep getting the animation pulse while the rest of the tree
would have been destroyed. To prevent the setters triggered by animation
from calling into native, we need to check whether the tree is still
valid before going down into JNI.

Bug: 28104172
Change-Id: Ie9d4bf3898c0c23e620a4747624d24b8ab779743
diff --git a/core/jni/android_graphics_drawable_VectorDrawable.cpp b/core/jni/android_graphics_drawable_VectorDrawable.cpp
index b04293e..0c6118b 100644
--- a/core/jni/android_graphics_drawable_VectorDrawable.cpp
+++ b/core/jni/android_graphics_drawable_VectorDrawable.cpp
@@ -340,7 +340,7 @@
 }
 
 static const JNINativeMethod gMethods[] = {
-        {"nCreateRenderer", "!(J)J", (void*)createTree},
+        {"nCreateTree", "!(J)J", (void*)createTree},
         {"nSetRendererViewportSize", "!(JFF)V", (void*)setTreeViewportSize},
         {"nSetRootAlpha", "!(JF)Z", (void*)setRootAlpha},
         {"nGetRootAlpha", "!(J)F", (void*)getRootAlpha},