Compartilhar via


TelephonyManager.GetEmergencyNumberList(Int32) Method

Definition

Get the per-category emergency number list based on current locale, sim, default, modem and network.

[Android.Runtime.Register("getEmergencyNumberList", "(I)Ljava/util/Map;", "GetGetEmergencyNumberList_IHandler", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")]
public virtual System.Collections.Generic.IDictionary<Java.Lang.Integer,System.Collections.Generic.IList<Android.Telephony.Emergency.EmergencyNumber>> GetEmergencyNumberList (int categories);
[<Android.Runtime.Register("getEmergencyNumberList", "(I)Ljava/util/Map;", "GetGetEmergencyNumberList_IHandler", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")>]
abstract member GetEmergencyNumberList : int -> System.Collections.Generic.IDictionary<Java.Lang.Integer, System.Collections.Generic.IList<Android.Telephony.Emergency.EmergencyNumber>>
override this.GetEmergencyNumberList : int -> System.Collections.Generic.IDictionary<Java.Lang.Integer, System.Collections.Generic.IList<Android.Telephony.Emergency.EmergencyNumber>>

Parameters

categories
Int32

the emergency service categories which are the bitwise-OR combination of the following constants: <ol> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_POLICE</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AMBULANCE</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_MIEC</li> <li>EmergencyNumber#EMERGENCY_SERVICE_CATEGORY_AIEC</li> </ol>

Returns

Map including the keys as the active subscription IDs (Note: if there is no active subscription, the key is SubscriptionManager#getDefaultSubscriptionId) and the value as the list of EmergencyNumber; empty Map if this information is not available; or throw a SecurityException if the caller does not have the permission.

Attributes

Remarks

Get the per-category emergency number list based on current locale, sim, default, modem and network.

In each returned list, the emergency number EmergencyNumber coming from higher priority sources will be located at the smaller index; the priority order of sources are: EmergencyNumber#EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING > EmergencyNumber#EMERGENCY_NUMBER_SOURCE_SIM > EmergencyNumber#EMERGENCY_NUMBER_SOURCE_DATABASE > EmergencyNumber#EMERGENCY_NUMBER_SOURCE_DEFAULT > EmergencyNumber#EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG

The subscriptions which the returned list would be based on, are all the active subscriptions, no matter which subscription could be used to create TelephonyManager.

Requires permission android.Manifest.permission#READ_PHONE_STATE or the calling app has carrier privileges (see #hasCarrierPrivileges).

Java documentation for android.telephony.TelephonyManager.getEmergencyNumberList(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to