Add manifest attribute for multiArch apps.

bug: 16013931
Change-Id: Ie8b01d364eed0846deeddf11e0d6e4cc1fba3e61
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 514b26e..1e93d92 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -334,22 +334,11 @@
     public static final int FLAG_FULL_BACKUP_ONLY = 1<<26;
 
     /**
-     * Value for {@link #flags}: set to {@code true} if the application
-     * is permitted to hold privileged permissions.
-     *
+     * Value for {@link #flags}: true if the application is blocked via restrictions and for
+     * most purposes is considered as not installed.
      * {@hide}
      */
-    public static final int FLAG_PRIVILEGED = 1<<30;
-
-    /**
-     * Value for {@link #flags}: Set to true if the application has been
-     * installed using the forward lock option.
-     *
-     * NOTE: DO NOT CHANGE THIS VALUE!  It is saved in packages.xml.
-     * 
-     * {@hide}
-     */
-    public static final int FLAG_FORWARD_LOCK = 1<<29;
+    public static final int FLAG_BLOCKED = 1<<27;
 
     /**
      * Value for {@link #flags}: set to <code>true</code> if the application
@@ -365,11 +354,35 @@
     public static final int FLAG_CANT_SAVE_STATE = 1<<28;
 
     /**
-     * Value for {@link #flags}: true if the application is blocked via restrictions and for
-     * most purposes is considered as not installed.
+     * Value for {@link #flags}: Set to true if the application has been
+     * installed using the forward lock option.
+     *
+     * NOTE: DO NOT CHANGE THIS VALUE!  It is saved in packages.xml.
+     * 
      * {@hide}
      */
-    public static final int FLAG_BLOCKED = 1<<27;
+    public static final int FLAG_FORWARD_LOCK = 1<<29;
+
+    /**
+     * Value for {@link #flags}: set to {@code true} if the application
+     * is permitted to hold privileged permissions.
+     *
+     * {@hide}
+     */
+    public static final int FLAG_PRIVILEGED = 1<<30;
+
+    /**
+     * Value for {@link #flags}: true if code from this application will need to be
+     * loaded into other applications' processes. On devices that support multiple
+     * instruction sets, this implies the code might be loaded into a process that's
+     * using any of the devices supported instruction sets.
+     *
+     * <p> The system might treat such applications specially, for eg., by
+     * extracting the application's native libraries for all supported instruction
+     * sets or by compiling the application's dex code for all supported instruction
+     * sets.
+     */
+    public static final int FLAG_MULTIARCH  = 1 << 31;
 
     /**
      * Flags associated with the application.  Any combination of
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 7651aef..3b118c0 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -2305,6 +2305,12 @@
             ai.flags |= ApplicationInfo.FLAG_SUPPORTS_RTL;
         }
 
+        if (sa.getBoolean(
+                com.android.internal.R.styleable.AndroidManifestApplication_multiArch,
+                false)) {
+            ai.flags |= ApplicationInfo.FLAG_MULTIARCH;
+        }
+
         String str;
         str = sa.getNonConfigurationString(
                 com.android.internal.R.styleable.AndroidManifestApplication_permission, 0);
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index afaf2e9..9789eee 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -387,6 +387,17 @@
          with that application.  The activity is re-parented to the task
          with the same {@link android.R.attr#taskAffinity} as it has. -->
     <attr name="allowTaskReparenting" format="boolean" />
+
+    <!-- Declare that code from this application will need to be loaded into other
+         applications' processes. On devices that support multiple instruction sets,
+         this implies the code might be loaded into a process that's using any of the devices
+         supported instruction sets.
+         
+         <p> The system might treat such applications specially, for eg., by
+         extracting the application's native libraries for all supported instruction
+         sets or by compiling the application's dex code for all supported instruction
+         sets. -->
+    <attr name="multiArch" format ="boolean" />
     
     <!-- Specify whether a component is allowed to have multiple instances
          of itself running in different processes.  Use with the activity
@@ -1114,6 +1125,7 @@
              "com.google". -->
         <attr name="requiredAccountType" format="string"/>
         <attr name="isGame" />
+        <attr name="multiArch" />
     </declare-styleable>
     
     <!-- The <code>permission</code> tag declares a security permission that can be
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 99c3450..1eb8946 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2507,4 +2507,5 @@
   <!-- A transition that moves views in or out of the scene to or from the left edge when
        a view visibility changes. -->
   <public type="transition" name="slide_left"/>
+  <public type="attr" name="multiArch" />
 </resources>