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

Commit 0e5ac11d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Give the default storage manager access to the storage permissions." into nyc-mr1-dev

parents a7a34274 8d9d0fec
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);
        }
    }