Fix JNI invocation of constructors.

The code that "virtualizes" method invocations was attempting to
virtualize a call to a constructor.  Constructors are direct methods,
so this resulted in a spurious CloneNotSupportedException.

Bug 3354578

(cherry-pick from dalvik-dev)

Change-Id: Ib158ab7fc6b2874eba1fc2afa45fd5436c1f2a8a
diff --git a/vm/oo/Object.c b/vm/oo/Object.c
index e99f690..cca6806 100644
--- a/vm/oo/Object.c
+++ b/vm/oo/Object.c
@@ -664,6 +664,9 @@
  * from the class' vtable.  If "clazz" is an interface, we have to do a
  * little more digging.
  *
+ * For "direct" methods (private / constructor), we just return the
+ * original Method.
+ *
  * (This is used for reflection and JNI "call method" calls.)
  */
 const Method* dvmGetVirtualizedMethod(const ClassObject* clazz,
@@ -672,10 +675,11 @@
     Method* actualMeth;
     int methodIndex;
 
-    assert(!dvmIsStaticMethod(meth));
-
-    if (dvmIsPrivateMethod(meth))   // no vtable entry for these
+    if (dvmIsDirectMethod(meth)) {
+        /* no vtable entry for these */
+        assert(!dvmIsStaticMethod(meth));
         return meth;
+    }
 
     /*
      * If the method was declared in an interface, we need to scan through