다음을 통해 공유


TelephonyCallback.ICarrierNetworkListener.OnCarrierNetworkChange Method

Definition

Callback invoked when telephony has received notice from a carrier app that a network action that could result in connectivity loss has been requested by an app using android.service.carrier.CarrierService#notifyCarrierNetworkChange(boolean)

[Android.Runtime.Register("onCarrierNetworkChange", "(Z)V", "GetOnCarrierNetworkChange_ZHandler:Android.Telephony.TelephonyCallback/ICarrierNetworkListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)]
public void OnCarrierNetworkChange (bool active);
[<Android.Runtime.Register("onCarrierNetworkChange", "(Z)V", "GetOnCarrierNetworkChange_ZHandler:Android.Telephony.TelephonyCallback/ICarrierNetworkListenerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)>]
abstract member OnCarrierNetworkChange : bool -> unit

Parameters

active
Boolean

If the carrier network change is or shortly will be active, true indicate that showing alternative UI, false otherwise.

Attributes

Remarks

Callback invoked when telephony has received notice from a carrier app that a network action that could result in connectivity loss has been requested by an app using android.service.carrier.CarrierService#notifyCarrierNetworkChange(boolean)

This is optional and is only used to allow the system to provide alternative UI while telephony is performing an action that may result in intentional, temporary network lack of connectivity.

Note, this callback is pinned to the registered subscription and will be invoked when the notifying carrier app has carrier privilege rule on the registered subscription. android.telephony.TelephonyManager#hasCarrierPrivileges

Java documentation for android.telephony.TelephonyCallback.CarrierNetworkListener.onCarrierNetworkChange(boolean).

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