TelephonyCallback.IServiceStateListener.OnServiceStateChanged Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Callback invoked when device service state changes on the registered subscription.
[Android.Runtime.Register("onServiceStateChanged", "(Landroid/telephony/ServiceState;)V", "GetOnServiceStateChanged_Landroid_telephony_ServiceState_Handler:Android.Telephony.TelephonyCallback/IServiceStateListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)]
public void OnServiceStateChanged (Android.Telephony.ServiceState serviceState);
[<Android.Runtime.Register("onServiceStateChanged", "(Landroid/telephony/ServiceState;)V", "GetOnServiceStateChanged_Landroid_telephony_ServiceState_Handler:Android.Telephony.TelephonyCallback/IServiceStateListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)>]
abstract member OnServiceStateChanged : Android.Telephony.ServiceState -> unit
Parameters
- serviceState
- ServiceState
- Attributes
Remarks
Callback invoked when device service state changes on the registered subscription. Note, the registration subscription ID comes from TelephonyManager
object which registers TelephonyCallback by TelephonyManager#registerTelephonyCallback(Executor, TelephonyCallback)
. If this TelephonyManager object was created with TelephonyManager#createForSubscriptionId(int)
, then the callback applies to the subscription ID. Otherwise, this callback applies to SubscriptionManager#getDefaultSubscriptionId()
.
The instance of ServiceState
passed as an argument here will have various levels of location information stripped from it depending on the location permissions that your app holds. Only apps holding the Manifest.permission#ACCESS_FINE_LOCATION
permission will receive all the information in ServiceState
, otherwise the cellIdentity will be null if apps only holding the Manifest.permission#ACCESS_COARSE_LOCATION
permission. Network operator name in long/short alphanumeric format and numeric id will be null if apps holding neither android.Manifest.permission#ACCESS_FINE_LOCATION
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.