Language

WifiNetworkSuggestion.Builder.SetSubscriptionId(Int32) Method

Definition

Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method.

[Android.Runtime.Register("setSubscriptionId", "(I)Landroid/net/wifi/WifiNetworkSuggestion$Builder;", "", ApiSince=31)]
public Android.Net.Wifi.WifiNetworkSuggestion.Builder SetSubscriptionId(int subscriptionId);
[<Android.Runtime.Register("setSubscriptionId", "(I)Landroid/net/wifi/WifiNetworkSuggestion$Builder;", "", ApiSince=31)>]
member this.SetSubscriptionId : int -> Android.Net.Wifi.WifiNetworkSuggestion.Builder

Parameters

subscriptionId
Int32

subscription ID see SubscriptionInfo.getSubscriptionId()

Returns

Instance of Builder to enable chaining of the builder method. This value cannot be null.

Attributes

Remarks

Configure the suggestion to only be used with the SIM identified by the subscription ID specified in this method. The suggested network will only be used by that SIM and no other SIM - even from the same carrier.

The caller must be a carrier provisioning app holding android.permission.NETWORK_CARRIER_PROVISIONING or a carrier-privileged app. A carrier-privileged app may only specify a subscription belonging to the same carrier that signed the app; see TelephonyManager.hasCarrierPrivileges().

Specifying a subscription ID that does not match these restrictions causes the suggestion to be rejected with WifiManager.STATUS_NETWORK_SUGGESTIONS_ERROR_ADD_NOT_ALLOWED.

Only one of setSubscriptionGroup(ParcelUuid) and setSubscriptionId(int) should be called for a suggestion.

Android reference for android.net.wifi.WifiNetworkSuggestion.Builder.setSubscriptionId.

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