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

Commit 20a5888b authored by Daniel Nishi's avatar Daniel Nishi Committed by android-build-merger
Browse files

Merge \\"Give the default storage manager access to the storage...

Merge \\"Give the default storage manager access to the storage permissions.\\" into nyc-mr1-dev am: 0e5ac11d
am: dc327ee1

Change-Id: I764e9138b6517452719a91018f50cccb614e24ac
parents bc47300b dc327ee1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.os.UserHandle;
import android.os.storage.StorageManager;
import android.print.PrintManager;
import android.provider.CalendarContract;
import android.provider.ContactsContract;
@@ -605,6 +606,15 @@ final class DefaultPermissionGrantPolicy {
                grantRuntimePermissionsLPw(nfcTagPkg, CONTACTS_PERMISSIONS, false, userId);
                grantRuntimePermissionsLPw(nfcTagPkg, PHONE_PERMISSIONS, false, userId);
            }

            // Storage Manager
            Intent storageManagerIntent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
            PackageParser.Package storageManagerPckg = getDefaultSystemHandlerActivityPackageLPr(
                    storageManagerIntent, userId);
            if (storageManagerPckg != null
                    && doesPackageSupportRuntimePermissions(storageManagerPckg)) {
                grantRuntimePermissionsLPw(storageManagerPckg, STORAGE_PERMISSIONS, true, userId);
            }
            mService.mSettings.onDefaultRuntimePermissionsGrantedLPr(userId);
        }
    }