Check null pointer before using pkgDataInfoMap
Otherwise, app process may crash during first run in first boot
When pkgDataInfoMap is null, we should let it being remounted
after storage is unlocked.
Fix: 154312199
Test: Wipe and boot device, without any exception
Change-Id: Iadf92c9b3996242296883c6bff81a08b24bce42c
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index cce749d..e28464a 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -2240,10 +2240,11 @@
if (mVoldAppDataIsolationEnabled && UserHandle.isApp(app.uid)
&& !storageManagerInternal.isExternalStorageService(uid)) {
bindMountAppStorageDirs = true;
- if (!storageManagerInternal.prepareStorageDirs(userId, pkgDataInfoMap.keySet(),
+ if (pkgDataInfoMap == null ||
+ !storageManagerInternal.prepareStorageDirs(userId, pkgDataInfoMap.keySet(),
app.processName)) {
- // Cannot prepare Android/app and Android/obb directory,
- // so we won't mount it in zygote.
+ // Cannot prepare Android/app and Android/obb directory or inode == 0,
+ // so we won't mount it in zygote, but resume the mount after unlocking device.
app.bindMountPending = true;
bindMountAppStorageDirs = false;
}