ConnectivityManager.GetConnectionOwnerUid 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.
Returns the uid
of the owner of a network connection.
[Android.Runtime.Register("getConnectionOwnerUid", "(ILjava/net/InetSocketAddress;Ljava/net/InetSocketAddress;)I", "GetGetConnectionOwnerUid_ILjava_net_InetSocketAddress_Ljava_net_InetSocketAddress_Handler", ApiSince=29)]
public virtual int GetConnectionOwnerUid (int protocol, Java.Net.InetSocketAddress local, Java.Net.InetSocketAddress remote);
[<Android.Runtime.Register("getConnectionOwnerUid", "(ILjava/net/InetSocketAddress;Ljava/net/InetSocketAddress;)I", "GetGetConnectionOwnerUid_ILjava_net_InetSocketAddress_Ljava_net_InetSocketAddress_Handler", ApiSince=29)>]
abstract member GetConnectionOwnerUid : int * Java.Net.InetSocketAddress * Java.Net.InetSocketAddress -> int
override this.GetConnectionOwnerUid : int * Java.Net.InetSocketAddress * Java.Net.InetSocketAddress -> int
Parameters
- protocol
- Int32
The protocol of the connection. Only IPPROTO_TCP
and IPPROTO_UDP
currently supported.
- local
- InetSocketAddress
The local InetSocketAddress
of a connection.
- remote
- InetSocketAddress
The remote InetSocketAddress
of a connection.
Returns
uid
if the connection is found and the app has permission to observe it
(e.g., if it is associated with the calling VPN app's VpnService tunnel) or android.os.Process#INVALID_UID
if the connection is not found.
- Attributes
Remarks
Returns the uid
of the owner of a network connection.
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.