Enable logwrapper functionality on user builds

When an app is debuggable, check whether a script called "wrap.sh" exists
in the app's native library directory. If so, start the app using the
invoke-with functionality over the script. Weaken the invoke-with check
on the zygote side to allow the functionality for debuggable apps.

The goal of the functionality is to make malloc debug, strace and other
similar tools available for NDK based application developers.

Bug: 33668201
Test: manual - debug malloc can be enabled using the new feature
Change-Id: Ia4bec0854cf4dc08446f1671494200f54ef366ee
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index cd8163c..5ac33a1 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -171,7 +171,8 @@
      * <var>processClass</var> to start them.
      *
      * When invokeWith is not null, the process will be started as a fresh app
-     * and not a zygote fork. Note that this is only allowed for uid 0.
+     * and not a zygote fork. Note that this is only allowed for uid 0 or when
+     * debugFlags contains DEBUG_ENABLE_DEBUGGER.
      *
      * @param processClass The class to use as the process's main entry
      *                     point.