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

am: 0e5ac11d30

Change-Id: I15b7c3b9b2a2c4d4f62480effafd063d79a92dd2
This commit is contained in:
Daniel Nishi
2016-07-14 00:20:25 +00:00
committed by android-build-merger

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