summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-09-20 11:37:52 -0700
committerDianne Hackborn <hackbod@google.com>2010-09-20 16:35:22 -0700
commit3b4bac7a2a940483c81a6bfda21039e02e62157d (patch)
treedfcd7a3d73cadb1451bb2f055061a098f146b0bf /services
parent8544560ccc43de7ff49d91866f461f5572f0b147 (diff)
downloadframeworks_base-3b4bac7a2a940483c81a6bfda21039e02e62157d.zip
frameworks_base-3b4bac7a2a940483c81a6bfda21039e02e62157d.tar.gz
frameworks_base-3b4bac7a2a940483c81a6bfda21039e02e62157d.tar.bz2
In theory the package manager now scans /vendor/app
Not tested. Change-Id: Ib6120d645074c95dd0afd1476f6167aec5d50bb9
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/PackageManagerService.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 72784d5..4c15c94 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -222,6 +222,9 @@ class PackageManagerService extends IPackageManager.Stub {
// This is the object monitoring the system app dir.
final FileObserver mSystemInstallObserver;
+ // This is the object monitoring the system app dir.
+ final FileObserver mVendorInstallObserver;
+
// This is the object monitoring mAppInstallDir.
final FileObserver mAppInstallObserver;
@@ -234,6 +237,7 @@ class PackageManagerService extends IPackageManager.Stub {
final File mFrameworkDir;
final File mSystemAppDir;
+ final File mVendorAppDir;
final File mAppInstallDir;
final File mDalvikCacheDir;
@@ -927,6 +931,14 @@ class PackageManagerService extends IPackageManager.Stub {
scanDirLI(mSystemAppDir, PackageParser.PARSE_IS_SYSTEM
| PackageParser.PARSE_IS_SYSTEM_DIR, scanMode);
+ // Collect all vendor packages.
+ mVendorAppDir = new File("/vendor/app");
+ mVendorInstallObserver = new AppDirObserver(
+ mVendorAppDir.getPath(), OBSERVER_EVENTS, true);
+ mVendorInstallObserver.startWatching();
+ scanDirLI(mVendorAppDir, PackageParser.PARSE_IS_SYSTEM
+ | PackageParser.PARSE_IS_SYSTEM_DIR, scanMode);
+
if (mInstaller != null) {
if (DEBUG_UPGRADE) Log.v(TAG, "Running installd update commands");
mInstaller.moveFiles();
@@ -2493,9 +2505,13 @@ class PackageManagerService extends IPackageManager.Stub {
}
private void scanDirLI(File dir, int flags, int scanMode) {
- Log.d(TAG, "Scanning app dir " + dir);
-
String[] files = dir.list();
+ if (files == null) {
+ Log.d(TAG, "No files in app dir " + dir);
+ return;
+ }
+
+ Log.d(TAG, "Scanning app dir " + dir);
int i;
for (i=0; i<files.length; i++) {