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

This commit is contained in:
TreeHugger Robot
2016-07-14 00:13:46 +00:00
committed by Android (Google) Code Review

View File

@@ -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);
}
}