OSDN Git Service

Destroy both CE and DE data when corrupted.
authorJeff Sharkey <jsharkey@android.com>
Mon, 25 Apr 2016 19:23:30 +0000 (13:23 -0600)
committerJeff Sharkey <jsharkey@android.com>
Mon, 25 Apr 2016 19:23:32 +0000 (13:23 -0600)
When we find either a CE or DE data directory that has been corrupted,
destroy both CE and DE data together, since internal services like
AccountManager get confused if they find DE data without matching CE
data.

Bug: 28346537
Change-Id: Iaf3694c20e4664536af25a2afeb45fe8a90d8171

services/core/java/com/android/server/pm/PackageManagerService.java

index f21966d..547379d 100644 (file)
@@ -18819,7 +18819,8 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
         } catch (Exception e) {
             logCriticalInfo(Log.WARN, "Destroying user " + userId + " on volume " + volumeUuid
                     + " because we failed to prepare: " + e);
-            destroyUserDataLI(volumeUuid, userId, flags);
+            destroyUserDataLI(volumeUuid, userId,
+                    StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
 
             if (allowRecover) {
                 // Try one last time; if we fail again we're really in trouble