HoldingConnectionClient
open class HoldingConnectionClient
kotlin.Any | |
↳ | androidx.ads.identifier.internal.HoldingConnectionClient |
A client which keeps the ServiceConnection to the IAdvertisingIdService
.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
open Long |
Gets a connection ID before using this client which prevents race condition with the auto disconnection task. |
open IAdvertisingIdService |
Gets the connected |
open String |
Gets the connected service's package name. |
open Boolean |
Gets whether the client is connected to the |
open Boolean |
Tries to close the connection to the Advertising ID Provider Service if no one is using the client. |
Public constructors
<init>
HoldingConnectionClient(@NonNull context: Context)
Public methods
askConnectionId
open fun askConnectionId(): Long
Gets a connection ID before using this client which prevents race condition with the auto disconnection task.
Return | |
---|---|
Long |
connection ID, >= 0 indicates this client is connected, otherwise this client has already been disconnected. |
getIdService
@NonNull open fun getIdService(): IAdvertisingIdService
Gets the connected IAdvertisingIdService
.
getPackageName
@NonNull open fun getPackageName(): String
Gets the connected service's package name.
isConnected
open fun isConnected(): Boolean
Gets whether the client is connected to the IAdvertisingIdService
.