Merge "Grant NFC tag app default permissions." into nyc-dev

This commit is contained in:
Martijn Coenen
2016-04-04 08:05:14 +00:00
committed by Android (Google) Code Review

View File

@@ -595,6 +595,16 @@ final class DefaultPermissionGrantPolicy {
grantRuntimePermissionsLPw(emergencyInfoPckg, PHONE_PERMISSIONS, true, userId);
}
// NFC Tag viewer
Intent nfcTagIntent = new Intent(Intent.ACTION_VIEW);
nfcTagIntent.setType("vnd.android.cursor.item/ndef_msg");
PackageParser.Package nfcTagPkg = getDefaultSystemHandlerActivityPackageLPr(
nfcTagIntent, userId);
if (nfcTagPkg != null
&& doesPackageSupportRuntimePermissions(nfcTagPkg)) {
grantRuntimePermissionsLPw(nfcTagPkg, CONTACTS_PERMISSIONS, false, userId);
grantRuntimePermissionsLPw(nfcTagPkg, PHONE_PERMISSIONS, false, userId);
}
mService.mSettings.onDefaultRuntimePermissionsGrantedLPr(userId);
}
}