Allow native shared libraries in ASEC containers

This change moves the native library handling earlier in the package
installation process so that it may be inserted into ASEC containers
before they are finalized in the DefaultContainerService.

Note that native libraries on SD card requires that vold mount ASEC
containers without the "noexec" flag on the mount point.

Change-Id: Ib34b1886bf6f94b99bb7b3781db6e9b5a58807ba
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index c812f36..ae6a311 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -291,14 +291,6 @@
     public static final int FLAG_FORWARD_LOCK = 1<<29;
 
     /**
-     * Value for {@link #flags}: Set to true if the application is
-     * native-debuggable, i.e. embeds a gdbserver binary in its .apk
-     *
-     * {@hide}
-     */
-    public static final int FLAG_NATIVE_DEBUGGABLE = 1<<28;
-
-    /**
      * Value for {@link #flags}: set to <code>true</code> if the application
      * has reported that it is heavy-weight, and thus can not participate in
      * the normal application lifecycle.
@@ -359,7 +351,14 @@
      * data.
      */
     public String dataDir;
-    
+
+    /**
+     * Full path to the directory where native JNI libraries are stored.
+     * 
+     * {@hide}
+     */
+    public String nativeLibraryDir;
+
     /**
      * The kernel user-ID that has been assigned to this application;
      * currently this is not a unique ID (multiple applications can have
@@ -452,6 +451,7 @@
         flags = orig.flags;
         sourceDir = orig.sourceDir;
         publicSourceDir = orig.publicSourceDir;
+        nativeLibraryDir = orig.nativeLibraryDir;
         resourceDirs = orig.resourceDirs;
         sharedLibraryFiles = orig.sharedLibraryFiles;
         dataDir = orig.dataDir;
@@ -483,6 +483,7 @@
         dest.writeInt(flags);
         dest.writeString(sourceDir);
         dest.writeString(publicSourceDir);
+        dest.writeString(nativeLibraryDir);
         dest.writeStringArray(resourceDirs);
         dest.writeStringArray(sharedLibraryFiles);
         dest.writeString(dataDir);
@@ -514,6 +515,7 @@
         flags = source.readInt();
         sourceDir = source.readString();
         publicSourceDir = source.readString();
+        nativeLibraryDir = source.readString();
         resourceDirs = source.readStringArray();
         sharedLibraryFiles = source.readStringArray();
         dataDir = source.readString();