Merge "DefaultPermission: GET_ACCOUNTS is now in CONTACTS" into mnc-dev

This commit is contained in:
Makoto Onuki
2015-07-16 21:01:37 +00:00
committed by Android (Google) Code Review

View File

@@ -72,6 +72,7 @@ final class DefaultPermissionGrantPolicy {
static { static {
CONTACTS_PERMISSIONS.add(Manifest.permission.READ_CONTACTS); CONTACTS_PERMISSIONS.add(Manifest.permission.READ_CONTACTS);
CONTACTS_PERMISSIONS.add(Manifest.permission.WRITE_CONTACTS); CONTACTS_PERMISSIONS.add(Manifest.permission.WRITE_CONTACTS);
CONTACTS_PERMISSIONS.add(Manifest.permission.GET_ACCOUNTS);
} }
private static final Set<String> LOCATION_PERMISSIONS = new ArraySet<>(); private static final Set<String> LOCATION_PERMISSIONS = new ArraySet<>();
@@ -117,11 +118,6 @@ final class DefaultPermissionGrantPolicy {
STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
} }
private static final Set<String> ACCOUNTS_PERMISSIONS = new ArraySet<>();
static {
ACCOUNTS_PERMISSIONS.add(Manifest.permission.GET_ACCOUNTS);
}
private final PackageManagerService mService; private final PackageManagerService mService;
private PackagesProvider mImePackagesProvider; private PackagesProvider mImePackagesProvider;
@@ -352,7 +348,6 @@ final class DefaultPermissionGrantPolicy {
&& doesPackageSupportRuntimePermissions(calendarPackage)) { && doesPackageSupportRuntimePermissions(calendarPackage)) {
grantRuntimePermissionsLPw(calendarPackage, CALENDAR_PERMISSIONS, userId); grantRuntimePermissionsLPw(calendarPackage, CALENDAR_PERMISSIONS, userId);
grantRuntimePermissionsLPw(calendarPackage, CONTACTS_PERMISSIONS, userId); grantRuntimePermissionsLPw(calendarPackage, CONTACTS_PERMISSIONS, userId);
grantRuntimePermissionsLPw(calendarPackage, ACCOUNTS_PERMISSIONS, userId);
} }
// Calendar provider // Calendar provider
@@ -362,7 +357,6 @@ final class DefaultPermissionGrantPolicy {
grantRuntimePermissionsLPw(calendarProviderPackage, CONTACTS_PERMISSIONS, userId); grantRuntimePermissionsLPw(calendarProviderPackage, CONTACTS_PERMISSIONS, userId);
grantRuntimePermissionsLPw(calendarProviderPackage, CALENDAR_PERMISSIONS, grantRuntimePermissionsLPw(calendarProviderPackage, CALENDAR_PERMISSIONS,
true, userId); true, userId);
grantRuntimePermissionsLPw(calendarProviderPackage, ACCOUNTS_PERMISSIONS, userId);
grantRuntimePermissionsLPw(calendarProviderPackage, STORAGE_PERMISSIONS, userId); grantRuntimePermissionsLPw(calendarProviderPackage, STORAGE_PERMISSIONS, userId);
} }
@@ -386,7 +380,6 @@ final class DefaultPermissionGrantPolicy {
&& doesPackageSupportRuntimePermissions(contactsPackage)) { && doesPackageSupportRuntimePermissions(contactsPackage)) {
grantRuntimePermissionsLPw(contactsPackage, CONTACTS_PERMISSIONS, userId); grantRuntimePermissionsLPw(contactsPackage, CONTACTS_PERMISSIONS, userId);
grantRuntimePermissionsLPw(contactsPackage, PHONE_PERMISSIONS, userId); grantRuntimePermissionsLPw(contactsPackage, PHONE_PERMISSIONS, userId);
grantRuntimePermissionsLPw(contactsPackage, ACCOUNTS_PERMISSIONS, userId);
} }
// Contacts provider sync adapters // Contacts provider sync adapters
@@ -408,7 +401,6 @@ final class DefaultPermissionGrantPolicy {
true, userId); true, userId);
grantRuntimePermissionsLPw(contactsProviderPackage, PHONE_PERMISSIONS, grantRuntimePermissionsLPw(contactsProviderPackage, PHONE_PERMISSIONS,
true, userId); true, userId);
grantRuntimePermissionsLPw(contactsProviderPackage, ACCOUNTS_PERMISSIONS, userId);
grantRuntimePermissionsLPw(contactsProviderPackage, STORAGE_PERMISSIONS, userId); grantRuntimePermissionsLPw(contactsProviderPackage, STORAGE_PERMISSIONS, userId);
} }
@@ -419,7 +411,7 @@ final class DefaultPermissionGrantPolicy {
getDefaultSystemHandlerActivityPackageLPr(deviceProvisionIntent, userId); getDefaultSystemHandlerActivityPackageLPr(deviceProvisionIntent, userId);
if (deviceProvisionPackage != null if (deviceProvisionPackage != null
&& doesPackageSupportRuntimePermissions(deviceProvisionPackage)) { && doesPackageSupportRuntimePermissions(deviceProvisionPackage)) {
grantRuntimePermissionsLPw(deviceProvisionPackage, ACCOUNTS_PERMISSIONS, userId); grantRuntimePermissionsLPw(deviceProvisionPackage, CONTACTS_PERMISSIONS, userId);
} }
// Maps // Maps