Check if storage app data and obb directories exist in vold

As storage is not mounted in system server, we use vold
to check if storage app data and obb directories exist instead.

Bug: 160336374
Test: Data and obb directories are created when a new app is started
Change-Id: Id2e8e753a1546f87ddf99762aab8f8738e328cd3
This commit is contained in:
Ricky Wai
2020-12-03 15:31:23 +00:00
parent b8fca94cfe
commit 44a81b582d

View File

@@ -4612,14 +4612,7 @@ class StorageManagerService extends IStorageManager.Stub
// Create package obb and data dir if it doesn't exist.
int appUid = UserHandle.getUid(userId, mPmInternal.getPackage(pkg).getUid());
File file = new File(packageObbDir);
if (!file.exists()) {
vold.setupAppDir(packageObbDir, appUid);
}
file = new File(packageDataDir);
if (!file.exists()) {
vold.setupAppDir(packageDataDir, appUid);
}
vold.ensureAppDirsCreated(new String[] {packageObbDir, packageDataDir}, appUid);
}
} catch (ServiceManager.ServiceNotFoundException | RemoteException e) {
Slog.e(TAG, "Unable to create obb and data directories for " + processName,e);