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

Commit 13f9d65c authored by Benjamin Löhner's avatar Benjamin Löhner Committed by Android (Google) Code Review
Browse files

Merge "Add getEmergencyAssistancePackageName API to TelephonyManager." into main

parents b7d18815 53b95297
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15136,6 +15136,7 @@ package android.telephony {
    method @Deprecated public boolean getDataEnabled(int);
    method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getDefaultRespondViaMessageApplication();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceSoftwareVersion(int);
    method @FlaggedApi("android.permission.flags.get_emergency_role_holder_api_enabled") @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getEmergencyAssistancePackage();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode();
    method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion();
    method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain();
+8 −0
Original line number Diff line number Diff line
@@ -111,3 +111,11 @@ flag {
    description: "When the flag is off no permissions can be device aware"
    bug: "274852670"
}

flag {
     name: "get_emergency_role_holder_api_enabled"
     is_fixed_read_only: true
     namespace: "permissions"
     description: "Enables the getEmergencyRoleHolder API."
     bug: "323157319"
}
+21 −0
Original line number Diff line number Diff line
@@ -15010,6 +15010,27 @@ public class TelephonyManager {
        return EMERGENCY_ASSISTANCE_ENABLED;
    }
    /**
     * Get the emergency assistance package name.
     *
     * @return the package name of the emergency assistance app.
     * @throws IllegalStateException if emergency assistance is not enabled.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
    @FlaggedApi(android.permission.flags.Flags.FLAG_GET_EMERGENCY_ROLE_HOLDER_API_ENABLED)
    @NonNull
    @SystemApi
    public String getEmergencyAssistancePackage() {
        if (!isEmergencyAssistanceEnabled()) {
            throw new IllegalStateException("isEmergencyAssistanceEnabled() is false.");
        }
        String emergencyRole = mContext.getSystemService(RoleManager.class)
                .getEmergencyRoleHolder(mContext.getUserId());
        return Objects.requireNonNull(emergencyRole, "Emergency role holder must not be null");
    }
    /**
     * Get the emergency number list based on current locale, sim, default, modem and network.
     *