diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-07-22 11:11:46 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-07-22 11:11:50 -0700 |
commit | 85ced632680642fce680d141ddd10299ff849233 (patch) | |
tree | 31f3658bafa45232a76cb99d520a6fbccf6e04d1 /services | |
parent | 54d42be6eb149b3e43115e810e4a1b92e9865d05 (diff) | |
download | frameworks_base-85ced632680642fce680d141ddd10299ff849233.zip frameworks_base-85ced632680642fce680d141ddd10299ff849233.tar.gz frameworks_base-85ced632680642fce680d141ddd10299ff849233.tar.bz2 |
More info to support CTS, fix reconcile bug.
Surface more details and commands for storage volumes to support
CTS testing. Fix user reconciliation bug that skipped user setup on
empty volumes.
Bug: 22658804, 22633097
Change-Id: I4221312d1cce24d1f5a2c108095cf3cf471598ed
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerService.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index c139389..9e7e5ec 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -15600,12 +15600,8 @@ public class PackageManagerService extends IPackageManager.Stub { * recycled. */ private void reconcileUsers(String volumeUuid) { - final File[] files = Environment.getDataUserDirectory(volumeUuid).listFiles(); - if (ArrayUtils.isEmpty(files)) { - Slog.d(TAG, "No users found on " + volumeUuid); - return; - } - + final File[] files = FileUtils + .listFilesOrEmpty(Environment.getDataUserDirectory(volumeUuid)); for (File file : files) { if (!file.isDirectory()) continue; @@ -15661,12 +15657,8 @@ public class PackageManagerService extends IPackageManager.Stub { * another volume. */ private void reconcileApps(String volumeUuid) { - final File[] files = Environment.getDataAppDirectory(volumeUuid).listFiles(); - if (ArrayUtils.isEmpty(files)) { - Slog.d(TAG, "No apps found on " + volumeUuid); - return; - } - + final File[] files = FileUtils + .listFilesOrEmpty(Environment.getDataAppDirectory(volumeUuid)); for (File file : files) { final boolean isPackage = (isApkFile(file) || file.isDirectory()) && !PackageInstallerService.isStageName(file.getName()); @@ -15797,7 +15789,12 @@ public class PackageManagerService extends IPackageManager.Stub { } // Now that we're guarded by frozen state, kill app during move - killApplication(packageName, appId, "move pkg"); + final long token = Binder.clearCallingIdentity(); + try { + killApplication(packageName, appId, "move pkg"); + } finally { + Binder.restoreCallingIdentity(token); + } final Bundle extras = new Bundle(); extras.putString(Intent.EXTRA_PACKAGE_NAME, packageName); |