TelephonyManager.UpdateAvailableNetworks 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.
Update availability of a list of networks in the current location.
[Android.Runtime.Register("updateAvailableNetworks", "(Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "GetUpdateAvailableNetworks_Ljava_util_List_Ljava_util_concurrent_Executor_Ljava_util_function_Consumer_Handler", ApiSince=29)]
public virtual void UpdateAvailableNetworks (System.Collections.Generic.IList<Android.Telephony.AvailableNetworkInfo> availableNetworks, Java.Util.Concurrent.IExecutor? executor, Java.Util.Functions.IConsumer? callback);
[<Android.Runtime.Register("updateAvailableNetworks", "(Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "GetUpdateAvailableNetworks_Ljava_util_List_Ljava_util_concurrent_Executor_Ljava_util_function_Consumer_Handler", ApiSince=29)>]
abstract member UpdateAvailableNetworks : System.Collections.Generic.IList<Android.Telephony.AvailableNetworkInfo> * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit
override this.UpdateAvailableNetworks : System.Collections.Generic.IList<Android.Telephony.AvailableNetworkInfo> * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit
Parameters
- availableNetworks
- IList<AvailableNetworkInfo>
is a list of available network information.
- executor
- IExecutor
The executor of where the callback will execute.
- callback
- IConsumer
Callback will be triggered once it succeeds or failed.
- Attributes
Remarks
Update availability of a list of networks in the current location.
This api should be called to inform OpportunisticNetwork Service about the availability of a network at the current location. This information will be used by OpportunisticNetwork service to enable modem stack and to attach to the network. If an empty list is passed, it is assumed that no network is available and will result in disabling the modem stack to save power. This api do not switch internet data once network attach is completed. Use TelephonyManager#setPreferredOpportunisticDataSubscription
to switch internet data after network attach is complete. Requires that the calling app has carrier privileges on both primary and secondary subscriptions (see #hasCarrierPrivileges
), or has permission android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE
.
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.