# HsdpDeepLinkService

*** ** * ** ***


```
public interface HsdpDeepLinkService
```

<br />

*** ** * ** ***

The interface to start the Google Play inline install flow with persistent affordance.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.AffordanceListener` Listener for handling events when to stop the Google Play inline install affordance. |
| `public interface https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener` Listener for handling events during the Google Play inline install flow. |
| `public interface https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpPrewarmListener` Listener for handling events during the Google Play inline install prewarm flow. |

| ### Constants |
|---|---|
| `default static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#SDK_VERSION() = "2.2.0"` The version of the Google Play inline install SDK. |

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#detach()()` Detaches the service client. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#dismiss(java.lang.String)(https://developer.android.com/reference/java/lang/String.html targetAppPackageName)` Dismisses the Google Play inline install (HSDP) UI. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#endSession(java.lang.String)(https://developer.android.com/reference/java/lang/String.html targetAppPackageName)` Ends the Google Play inline install (HSDP) session. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#open(java.lang.String,java.lang.String,com.google.android.play.core.hsdp.service.HsdpDeepLinkService.HsdpDeepLinkServiceListener)( https://developer.android.com/reference/java/lang/String.html targetAppPackageName, https://developer.android.com/reference/java/lang/String.html referrer, https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener )` Opens the Google Play inline install flow. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#open(java.lang.String,java.lang.String,com.google.android.play.core.hsdp.service.HsdpDeepLinkService.HsdpDeepLinkServiceListener,java.util.Map<java.lang.String,java.lang.String>)( https://developer.android.com/reference/java/lang/String.html targetAppPackageName, https://developer.android.com/reference/java/lang/String.html referrer, https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html> extraQueryParams )` Opens the Google Play inline install flow with extra query parameters. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#open(java.lang.String,java.lang.String,com.google.android.play.core.hsdp.service.HsdpDeepLinkService.HsdpDeepLinkServiceListener,java.util.Map<java.lang.String,java.lang.String>,boolean)( https://developer.android.com/reference/java/lang/String.html targetAppPackageName, https://developer.android.com/reference/java/lang/String.html referrer, https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener, @https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html> extraQueryParams, boolean autoTrigger )` Opens the Google Play inline install flow with extra query parameters and auto trigger. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#prewarm(java.util.List<com.google.android.play.core.hsdp.service.HsdpPrewarmRequest>,com.google.android.play.core.hsdp.service.HsdpDeepLinkService.HsdpPrewarmListener)( https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpPrewarmRequest> requests, https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpPrewarmListener listener )` Prewarms the Google Play inline install flow. |
| `abstract void` | `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService#stopAffordance(java.lang.String,com.google.android.play.core.hsdp.service.HsdpDeepLinkService.AffordanceListener)( https://developer.android.com/reference/java/lang/String.html targetAppPackageName, https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.AffordanceListener listener )` Stops and dismisses the affordance tracking for the Google Play inline install flow. |

## Constants

### SDK_VERSION

```
default static final String SDK_VERSION = "2.2.0"
```

The version of the Google Play inline install SDK.

## Public methods

### detach

```
abstract void detach()
```

Detaches the service client. This will disconnect the bound service connections immediately. Callers should call this when they are done with the service.

### dismiss

```
abstract void dismiss(String targetAppPackageName)
```

Dismisses the Google Play inline install (HSDP) UI. Need to call open() first to show the HSDP UI.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |

### endSession

```
abstract void endSession(String targetAppPackageName)
```

Ends the Google Play inline install (HSDP) session. Need to call open() first to show the HSDP UI.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |

### open

```
abstract void open(
    String targetAppPackageName,
    String referrer,
    HsdpDeepLinkService.HsdpDeepLinkServiceListener listener
)
```

Opens the Google Play inline install flow.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |
| `https://developer.android.com/reference/java/lang/String.html referrer` | The referrer tracking string. |
| `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener` | The listener for the HSDP/HPOA deep link flow. |

### open

```
abstract void open(
    String targetAppPackageName,
    String referrer,
    HsdpDeepLinkService.HsdpDeepLinkServiceListener listener,
    @Nullable Map<String, String> extraQueryParams
)
```

Opens the Google Play inline install flow with extra query parameters.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |
| `https://developer.android.com/reference/java/lang/String.html referrer` | The referrer tracking string. |
| `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener` | The listener for the inline install flow. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html> extraQueryParams` | The extra query params to append on the deep link URL. |

### open

```
abstract void open(
    String targetAppPackageName,
    String referrer,
    HsdpDeepLinkService.HsdpDeepLinkServiceListener listener,
    @Nullable Map<String, String> extraQueryParams,
    boolean autoTrigger
)
```

Opens the Google Play inline install flow with extra query parameters and auto trigger.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |
| `https://developer.android.com/reference/java/lang/String.html referrer` | The referrer tracking string. |
| `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpDeepLinkServiceListener listener` | The listener for the inline install flow. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html> extraQueryParams` | The extra query params to append on the deep link URL. |
| `boolean autoTrigger` | Whether the HSDP is triggered automatically (as opposed to being triggered manually by user action). |

### prewarm

```
abstract void prewarm(
    List<HsdpPrewarmRequest> requests,
    HsdpDeepLinkService.HsdpPrewarmListener listener
)
```

Prewarms the Google Play inline install flow. This method would be optionally called before calling show() to prewarm the Google Play inline install (HSDP) UI. All prewarm operations are best-effort. There is no guarantee that a prewarm request will be carried out.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpPrewarmRequest> requests` | The list of prewarm requests. |
| `https://developer.android.com/reference/com/google/android/play/core/hsdp/service/HsdpDeepLinkService.HsdpPrewarmListener listener` | The listener for the prewarm flow. |

### stopAffordance

```
abstract void stopAffordance(
    String targetAppPackageName,
    HsdpDeepLinkService.AffordanceListener listener
)
```

Stops and dismisses the affordance tracking for the Google Play inline install flow.

This method should be called when the caller app is no longer interested in tracking the installation state of the app via the affordance.

This method will not dismiss the Google Play inline install (HSDP) pop-up which can only be dismissed by the user.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html targetAppPackageName` | The package name of the app to install. |