Loading core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -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(); core/java/android/permission/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -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" } telephony/java/android/telephony/TelephonyManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -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. * Loading
core/api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -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();
core/java/android/permission/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -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" }
telephony/java/android/telephony/TelephonyManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -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. *