Merge "Grant permissions for EmergencyInfo app" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
84a698934b
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user