Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84425314 authored by Benjamin Löhner's avatar Benjamin Löhner
Browse files

Add voiceCapable condition to getEmergencyAssistancePackage.

This follows EmergencyRoleBehavior.java, which indicates that voiceCapable is a condition for holding the emergency role.

Bug: 325931354
Test: presubmit
Change-Id: I1bc7e1a93886f57c48e21a0aadb51ad5ada97df1
parent 7e118827
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -15014,7 +15014,8 @@ public class TelephonyManager {
     * Get the emergency assistance package name.
     *
     * @return the package name of the emergency assistance app.
     * @throws IllegalStateException if emergency assistance is not enabled.
     * @throws IllegalStateException if emergency assistance is not enabled or the device is
     * not voice capable.
     *
     * @hide
     */
@@ -15023,8 +15024,9 @@ public class TelephonyManager {
    @NonNull
    @SystemApi
    public String getEmergencyAssistancePackage() {
        if (!isEmergencyAssistanceEnabled()) {
            throw new IllegalStateException("isEmergencyAssistanceEnabled() is false.");
        if (!isEmergencyAssistanceEnabled() || !isVoiceCapable()) {
            throw new IllegalStateException("isEmergencyAssistanceEnabled() is false or device"
                + " not voice capable.");
        }
        String emergencyRole = mContext.getSystemService(RoleManager.class)
                .getEmergencyRoleHolder(mContext.getUserId());