Merge "Grant permissions for EmergencyInfo app" into nyc-dev

This commit is contained in:
Maria Garcia Puyol
2016-02-24 23:44:04 +00:00
committed by Android (Google) Code Review

View File

@@ -35,6 +35,7 @@ import android.provider.CalendarContract;
import android.provider.ContactsContract;
import android.provider.MediaStore;
import android.provider.Telephony.Sms.Intents;
import android.telephony.TelephonyManager;
import android.security.Credentials;
import android.util.ArraySet;
import android.util.Log;
@@ -584,6 +585,16 @@ final class DefaultPermissionGrantPolicy {
grantRuntimePermissionsLPw(printSpoolerPackage, LOCATION_PERMISSIONS, true, userId);
}
// EmergencyInfo
Intent emergencyInfoIntent = new Intent(TelephonyManager.ACTION_EMERGENCY_ASSISTANCE);
PackageParser.Package emergencyInfoPckg = getDefaultSystemHandlerActivityPackageLPr(
emergencyInfoIntent, userId);
if (emergencyInfoPckg != null
&& doesPackageSupportRuntimePermissions(emergencyInfoPckg)) {
grantRuntimePermissionsLPw(emergencyInfoPckg, CONTACTS_PERMISSIONS, true, userId);
grantRuntimePermissionsLPw(emergencyInfoPckg, PHONE_PERMISSIONS, true, userId);
}
mService.mSettings.onDefaultRuntimePermissionsGrantedLPr(userId);
}
}