/**
   * The main function called when started through the zygote process. This
   * could be unified with main(), if the native code in nativeFinishInit()
   * were rationalized with Zygote startup.<p>
   *
   * Current recognized args:
   * <ul>
   *   <li> <code> [--] &lt;start class name&gt;  &lt;args&gt;
   * </ul>
   *
   * @param targetSdkVersion target SDK version
   * @param argv arg strings
   */
  public static final void zygoteInit(int targetSdkVersion, String[] argv, ClassLoader classLoader)
      throws ZygoteInit.MethodAndArgsCaller {
    if (DEBUG) Slog.d(TAG, "RuntimeInit: Starting application from zygote");

    Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "RuntimeInit");
    redirectLogStreams();

    commonInit();
    nativeZygoteInit();
    applicationInit(targetSdkVersion, argv, classLoader);
  }
  public static final void main(String[] argv) {
    enableDdms();
    if (argv.length == 2 && argv[1].equals("application")) {
      if (DEBUG) Slog.d(TAG, "RuntimeInit: Starting application");
      redirectLogStreams();
    } else {
      if (DEBUG) Slog.d(TAG, "RuntimeInit: Starting tool");
    }

    commonInit();

    /*
     * Now that we're running in interpreted code, call back into native code
     * to run the system.
     */
    nativeFinishInit();

    if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!");
  }