Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 719b3d3c authored by Farid Zare Seisan's avatar Farid Zare Seisan Committed by android-build-merger
Browse files

Merge "Ignore mkdirs requests if CE storage not available." into pi-dev

am: 29f6a3fe

Change-Id: Ie1330b037a37a39f748820ab9f038ed77397dd6c
parents 9b6a3de3 29f6a3fe
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2667,9 +2667,17 @@ class StorageManagerService extends IStorageManager.Stub
    public void mkdirs(String callingPkg, String appPath) {
        final int userId = UserHandle.getUserId(Binder.getCallingUid());
        final UserEnvironment userEnv = new UserEnvironment(userId);
        final String propertyName = "sys.user." + userId + ".ce_available";

        // Ignore requests to create directories while storage is locked
        if (!isUserKeyUnlocked(userId)) return;
        if (!isUserKeyUnlocked(userId)) {
            throw new IllegalStateException("Failed to prepare " + appPath);
        }

        // Ignore requests to create directories if CE storage is not available
        if (!SystemProperties.getBoolean(propertyName, false)) {
            throw new IllegalStateException("Failed to prepare " + appPath);
        }

        // Validate that reported package name belongs to caller
        final AppOpsManager appOps = (AppOpsManager) mContext.getSystemService(