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

Commit 88ff404c authored by Samiul Islam's avatar Samiul Islam Committed by Automerger Merge Worker
Browse files

Merge "Don't create external storage dirs for apps with...

Merge "Don't create external storage dirs for apps with PROPERTY_NO_APP_DATA_STORAGE" into tm-dev am: 674eca9e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17712583



Change-Id: I4dfd0f8f8f00aa5c89b7282623d8df533338b198
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9b03025e 674eca9e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -3742,6 +3742,16 @@ class StorageManagerService extends IStorageManager.Stub
                Context.APP_OPS_SERVICE);
        appOps.checkPackage(callingUid, callingPkg);

        try {
            final PackageManager.Property noAppStorageProp = mContext.getPackageManager()
                    .getProperty(PackageManager.PROPERTY_NO_APP_DATA_STORAGE, callingPkg);
            if (noAppStorageProp != null && noAppStorageProp.getBoolean()) {
                throw new SecurityException(callingPkg + " should not have " + appPath);
            }
        } catch (PackageManager.NameNotFoundException ignore) {
            // Property not found
        }

        File appFile = null;
        try {
            appFile = new File(appPath).getCanonicalFile();