Add extra resources field for ApplicationInfo
Allow ApplicationInfo to track multiple files it wants to use as
resources by adding a string array to its public definition.
Change-Id: Ieffc4b1755270520b59c4e5a3c084e86aef02346
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 3e8a55f..a7ea507 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -252,12 +252,20 @@
public String sourceDir;
/**
- * Full path to the location of the publicly available parts of this package (i.e. the resources
- * and manifest). For non-forward-locked apps this will be the same as {@link #sourceDir).
+ * Full path to the location of the publicly available parts of this
+ * package (i.e. the primary resource package and manifest). For
+ * non-forward-locked apps this will be the same as {@link #sourceDir).
*/
public String publicSourceDir;
/**
+ * Full paths to the locations of extra resource packages this application
+ * uses. This field is only used if there are extra resource packages,
+ * otherwise it is null.
+ */
+ public String[] resourceDirs;
+
+ /**
* Paths to all shared libraries this application is linked against. This
* field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES
* PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving
@@ -310,6 +318,7 @@
+ " processName=" + processName);
pw.println(prefix + "sourceDir=" + sourceDir);
pw.println(prefix + "publicSourceDir=" + publicSourceDir);
+ pw.println(prefix + "resourceDirs=" + resourceDirs);
pw.println(prefix + "dataDir=" + dataDir);
if (sharedLibraryFiles != null) {
pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
@@ -360,6 +369,7 @@
flags = orig.flags;
sourceDir = orig.sourceDir;
publicSourceDir = orig.publicSourceDir;
+ resourceDirs = orig.resourceDirs;
sharedLibraryFiles = orig.sharedLibraryFiles;
dataDir = orig.dataDir;
uid = orig.uid;
@@ -390,6 +400,7 @@
dest.writeInt(flags);
dest.writeString(sourceDir);
dest.writeString(publicSourceDir);
+ dest.writeStringArray(resourceDirs);
dest.writeStringArray(sharedLibraryFiles);
dest.writeString(dataDir);
dest.writeInt(uid);
@@ -420,6 +431,7 @@
flags = source.readInt();
sourceDir = source.readString();
publicSourceDir = source.readString();
+ resourceDirs = source.readStringArray();
sharedLibraryFiles = source.readStringArray();
dataDir = source.readString();
uid = source.readInt();