summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-07-22 11:11:46 -0700
committerJeff Sharkey <jsharkey@android.com>2015-07-22 11:11:50 -0700
commit85ced632680642fce680d141ddd10299ff849233 (patch)
tree31f3658bafa45232a76cb99d520a6fbccf6e04d1 /services
parent54d42be6eb149b3e43115e810e4a1b92e9865d05 (diff)
downloadframeworks_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.java23
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);