# FakeSplitInstallManager

Summary:[Constants](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager#constants)\|[Ctors](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager#pubctors)\|[Methods](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager#inhmethods)  

# FakeSplitInstallManager

`
public


class
FakeSplitInstallManager
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


implements

`[SplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html)`


`

|---|---------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | com.google.android.play.core.splitinstall.testing.FakeSplitInstallManager |

<br />

*** ** * ** ***

A fake implementation of the[SplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html). See[FakeSplitInstallManagerFactory](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManagerFactory.html).

Installed splits are not persisted across application sessions: if you close and reopen an app using[FakeSplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html), you need to request the splits again.

## Summary

|                                                                                                   ### Constants                                                                                                   ||
|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String.html) | [TAG](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#TAG) <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[FakeSplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#FakeSplitInstallManager(android.content.Context,%20java.io.File))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[File](https://developer.android.com/reference/java/io/File.html)` splitsDir) ` *This constructor is deprecated. Please use[FakeSplitInstallManagerFactory.createNewInstance(Context, File)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManagerFactory.html#createNewInstance(android.content.Context,%20java.io.File))instead. The returned manager might not work as expected unless SplitCompat is priorly initiated using[SplitCompat.install(Context)](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html#install(android.content.Context)).* |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[cancelInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#cancelInstall(int))`(int sessionId) ` Starts a request to cancel a pending split install.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#deferredInstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Not implemented.                                                                                                                                                                                                                                                                                                                                                               |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#deferredLanguageInstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Not implemented.                                                                                                                                                                                                                                                                                                                                                 |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#deferredLanguageUninstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Not implemented.                                                                                                                                                                                                                                                                                                                                             |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#deferredUninstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Not implemented.                                                                                                                                                                                                                                                                                                                                                           |
| ` `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledLanguages](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#getInstalledLanguages())`() ` Returns the languages that are currently installed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledModules](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#getInstalledModules())`() ` Returns the modules that are currently installed (excluding the base module).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>`                                                                        | ` `[getSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#getSessionState(int))`(int sessionId) ` Returns the current state of a split install session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[List](https://developer.android.com/reference/java/util/List.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>>` | ` `[getSessionStates](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#getSessionStates())`() ` This fake implementation just support one session state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[registerListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Registers a listener for your app that is alerted of state changes for module install requests.                                                                                                                                                                                                                          |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[setShouldNetworkError](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#setShouldNetworkError(boolean))`(boolean shouldNetworkError) ` Sets whether the next split install should terminate in a network error.                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20com.google.android.play.core.common.IntentSenderForResultStarter,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, IntentSenderForResultStarter starter, int requestCode) ` Not implemented.                                                                                                                                                           |
| ` boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20androidx.activity.result.ActivityResultLauncher<androidx.activity.result.IntentSenderRequest>))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, ActivityResultLauncher<IntentSenderRequest> activityResultLauncher) ` Not implemented.                                                                                                                        |
| ` boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20android.app.Activity,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, `[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, int requestCode) ` Not implemented.                                                                                                                                                   |
| ` `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>`                                                                                                                                          | ` `[startInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#startInstall(com.google.android.play.core.splitinstall.SplitInstallRequest))`(`[SplitInstallRequest](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallRequest.html)` request) ` Initiates a request to download and install split APKs for additional features or language resources.                                                                                                                                                                                                                                                                    |
| ` void`                                                                                                                                                                                                                                                                                                                  | ` `[unregisterListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManager.html#unregisterListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Unregisters a listener you previously registered using[registerListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener)). |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||
| From interface` `[com.google.android.play.core.splitinstall.SplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html)` ` |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[cancelInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#cancelInstall(int))`(int sessionId) ` Starts a request to cancel a pending split install.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredInstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Defers installation of given`moduleNames`.                                                                                                                                                                                                                                                                                                                                                                                               | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredLanguageInstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Defers installation of given`languages`.                                                                                                                                                                                                                                                                                                                                                                                   | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredLanguageUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredLanguageUninstall(java.util.List<java.util.Locale>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[Locale](https://developer.android.com/reference/java/util/Locale.html)`> languages) ` Defers uninstallation of given`languages`.                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>`                                                                                                                                                | ` `[deferredUninstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#deferredUninstall(java.util.List<java.lang.String>))`(`[List](https://developer.android.com/reference/java/util/List.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`> moduleNames) ` Defers uninstallation of given`moduleNames`.                                                                                                                                                                                                                                                                                                                                                                                         | | ` abstract `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledLanguages](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledLanguages())`() ` Returns the languages that are currently installed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>`                                                                                                                                                                        | ` `[getInstalledModules](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledModules())`() ` Returns the modules that are currently installed (excluding the base module).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>`                                                                        | ` `[getSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getSessionState(int))`(int sessionId) ` Returns the current state of a split install session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[List](https://developer.android.com/reference/java/util/List.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>>` | ` `[getSessionStates](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getSessionStates())`() ` Returns the state for all active sessions belonging to the app.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` abstract void`                                                                                                                                                                                                                                                                                                                  | ` `[registerListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Registers a listener for your app that is alerted of state changes for module install requests.                                                                                                                                                                                                                                                                                    | | ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20com.google.android.play.core.common.IntentSenderForResultStarter,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, IntentSenderForResultStarter starter, int requestCode) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).                                    | | ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20androidx.activity.result.ActivityResultLauncher<androidx.activity.result.IntentSenderRequest>))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, ActivityResultLauncher<IntentSenderRequest> activityResultLauncher) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html). | | ` abstract boolean`                                                                                                                                                                                                                                                                                                               | ` `[startConfirmationDialogForResult](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startConfirmationDialogForResult(com.google.android.play.core.splitinstall.SplitInstallSessionState,%20android.app.Activity,%20int))`(`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)` sessionState, `[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, int requestCode) ` Starts the user confirmation dialog from the provided[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html).                            | | ` abstract `[Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>`                                                                                                                                          | ` `[startInstall](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#startInstall(com.google.android.play.core.splitinstall.SplitInstallRequest))`(`[SplitInstallRequest](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallRequest.html)` request) ` Initiates a request to download and install split APKs for additional features or language resources.                                                                                                                                                                                                                                                                                                                              | | ` abstract void`                                                                                                                                                                                                                                                                                                                  | ` `[unregisterListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#unregisterListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))`(`[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)` listener) ` Unregisters a listener you previously registered using[registerListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener)).                                                           | ||

## Constants

### TAG

```
public static final String TAG
```

<br />

<br />

Constant Value: "FakeSplitInstallManager"

## Public constructors

### FakeSplitInstallManager

```
public FakeSplitInstallManager (Context context, 
                File splitsDir)
```

<br />

**This constructor is deprecated.**   
Please use[FakeSplitInstallManagerFactory.createNewInstance(Context, File)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManagerFactory.html#createNewInstance(android.content.Context,%20java.io.File))instead. The returned manager might not work as expected unless SplitCompat is priorly initiated using[SplitCompat.install(Context)](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html#install(android.content.Context)).

Creates a fake instance of[SplitInstallManager](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html)which can be used for testing.

<br />

|          Parameters           ||
|-------------|------------------|
| `context`   | `Context` <br /> |
| `splitsDir` | `File` <br />    |

**See also:**

- [FakeSplitInstallManagerFactory](https://developer.android.com/reference/com/google/android/play/core/splitinstall/testing/FakeSplitInstallManagerFactory.html)

## Public methods

### cancelInstall

```
public Task<Void> cancelInstall (int sessionId)
```

Starts a request to cancel a pending split install.

[Cancelling requests](https://d.android.com/guide/playcore/dynamic-delivery#cancel_request)are best-effort. You can[monitor the request state](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests)to listening for the[SplitInstallSessionStatus.CANCELED](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#CANCELED)state.

<br />

|                                    Parameters                                    ||
|-------------|---------------------------------------------------------------------|
| `sessionId` | `int`: the sessionId of the request you would like to cancel <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredInstall

```
public Task<Void> deferredInstall (List<String> moduleNames)
```

Not implemented.

<br />

|                                          Parameters                                          ||
|---------------|-------------------------------------------------------------------------------|
| `moduleNames` | `List`: the names of the modules you want to install in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredLanguageInstall

```
public Task<Void> deferredLanguageInstall (List<Locale> languages)
```

Not implemented.

<br />

|                                   Parameters                                    ||
|-------------|--------------------------------------------------------------------|
| `languages` | `List`: the languages you want to install in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredLanguageUninstall

```
public Task<Void> deferredLanguageUninstall (List<Locale> languages)
```

Not implemented.

<br />

|                                    Parameters                                     ||
|-------------|----------------------------------------------------------------------|
| `languages` | `List`: the languages you want to uninstall in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### deferredUninstall

```
public Task<Void> deferredUninstall (List<String> moduleNames)
```

Not implemented.

<br />

|                                           Parameters                                           ||
|---------------|---------------------------------------------------------------------------------|
| `moduleNames` | `List`: the names of the modules you want to uninstall in the background <br /> |

|                                                                                    Returns                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`>` | <br /> |

### getInstalledLanguages

```
public Set<String> getInstalledLanguages ()
```

Returns the languages that are currently installed.

The app's default language is not included in the returned set.

Returns an empty set if an error occurs.

For Instant Apps, this API is not supported and the return value is undefined.

**Note:** Languages are considered installed even when they are emulated by[SplitCompat](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html)because they are accessible to the app.

**Note:** This method does NOT work if you are deploying your bundle onto your device from Android Studio via \`Run...\` or if you test it via Gradle's \`assemble\[Debug\|Release\|...\]\` or \`install\[Debug\|Release\|...\]\`. In such situation, this method always returns an empty list. The recommended way to test this method is by uploading your bundle to[Internal App Sharing](https://support.google.com/googleplay/android-developer/answer/9303479).

<br />

|                                                                                              Returns                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>` | the languages that are currently installed <br /> |

### getInstalledModules

```
public Set<String> getInstalledModules ()
```

Returns the modules that are currently installed (excluding the base module).

To learn more, read[Manage installed modules](https://d.android.com/guide/playcore/dynamic-delivery#manage_installed_modules).

**Note:** Modules are considered installed even when they are emulated by[SplitCompat](https://developer.android.com/reference/com/google/android/play/core/splitcompat/SplitCompat.html)because they are accessible to the app.

<br />

|                                                                        Returns                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Set](https://developer.android.com/reference/java/util/Set.html)`<`[String](https://developer.android.com/reference/java/lang/String.html)`>` | <br /> |

### getSessionState

```
public Task<SplitInstallSessionState> getSessionState (int sessionId)
```

Returns the current state of a split install session.

You should not use the session state to[determine whether a module is installed](https://d.android.com/guide/playcore/dynamic-delivery#manage_installed_modules). Instead, please use[getInstalledModules()](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#getInstalledModules()).

To learn more, read[Monitor the request state](https://developer.android.com/guide/playcore/dynamic-delivery#monitor_requests).

<br />

|                                Parameters                                ||
|-------------|-------------------------------------------------------------|
| `sessionId` | `int`: the Id for the session you want to status for <br /> |

|                                                                                                                        Returns                                                                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>` | <br /> |

### getSessionStates

```
public Task<List<SplitInstallSessionState>> getSessionStates ()
```

This fake implementation just support one session state.

<br />

|                                                                                                                                                            Returns                                                                                                                                                            ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[List](https://developer.android.com/reference/java/util/List.html)`<`[SplitInstallSessionState](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallSessionState.html)`>>` | <br /> |

### registerListener

```
public void registerListener (SplitInstallStateUpdatedListener listener)
```

Registers a listener for your app that is alerted of state changes for module install requests.

You should unregister the listener using[unregisterListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#unregisterListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener))when the request is resolved. To learn more, read[Monitor the request state](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests).

<br />

|                                                                                                                       Parameters                                                                                                                       ||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `listener` | `SplitInstallStateUpdatedListener`: the[SplitInstallStateUpdatedListener](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallStateUpdatedListener.html)you want to register for your app <br /> |

### setShouldNetworkError

```
public void setShouldNetworkError (boolean shouldNetworkError)
```

Sets whether the next split install should terminate in a network error.

<br />

|               Parameters               ||
|----------------------|------------------|
| `shouldNetworkError` | `boolean` <br /> |

### startConfirmationDialogForResult

```
public boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                IntentSenderForResultStarter starter, 
                int requestCode)
```

Not implemented.

<br />

|                                                                                                                                             Parameters                                                                                                                                             ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState` | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `starter`      | `IntentSenderForResultStarter`: the intent[IntentSenderForResultStarter](https://developer.android.com/reference/com/google/android/play/core/common/IntentSenderForResultStarter.html) <br />                                                                                     |
| `requestCode`  | `int`: the request code that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                            |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

|                                                                Throws                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) |   |

### startConfirmationDialogForResult

```
public boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                ActivityResultLauncher<IntentSenderRequest> activityResultLauncher)
```

Not implemented.

<br />

|                                                                                                                                                  Parameters                                                                                                                                                  ||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState`           | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `activityResultLauncher` | `ActivityResultLauncher`: an ActivityResultLauncher to launch the confirmation dialog. <br />                                                                                                                                                                                      |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

### startConfirmationDialogForResult

```
public boolean startConfirmationDialogForResult (SplitInstallSessionState sessionState, 
                Activity activity, 
                int requestCode)
```

Not implemented.

<br />

|                                                                                                                                             Parameters                                                                                                                                             ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `sessionState` | `SplitInstallSessionState`: a SplitInstallSessionState with status[SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/com/google/android/play/core/splitinstall/model/SplitInstallSessionStatus.html#REQUIRES_USER_CONFIRMATION) <br /> |
| `activity`     | `Activity`: the Activity that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                           |
| `requestCode`  | `int`: the request code that will be used for[ERROR(/Activity#onActivityResult)](https://developer.android.com/) <br />                                                                                                                                                            |

|                                        Returns                                         ||
|-----------|-----------------------------------------------------------------------------|
| `boolean` | whether the session state is a valid and the dialog has been started <br /> |

|                                                                Throws                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [IntentSender.SendIntentException](https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html) |   |

### startInstall

```
public Task<Integer> startInstall (SplitInstallRequest request)
```

Initiates a request to download and install split APKs for additional features or language resources.

To learn more, read[Request an on demand module](https://d.android.com/guide/playcore/dynamic-delivery#monitor_requests)or[Download additional language resources](https://d.android.com/guide/playcore/dynamic-delivery#lang_resources).

<br />

|                                                                                                   Parameters                                                                                                   ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `request` | `SplitInstallRequest`: the[SplitInstallRequest](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallRequest.html)you built for the install request <br /> |

|                                                                                                                                                                                          Returns                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Task](https://developer.google.com/android/reference/com/google/android/gms/tasks/Task.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>` | session id, which can be used to subsequently interact with the session after it is created. A session id of 0 indicates that the splits are already installed; in this case no session is generated. <br /> |

### unregisterListener

```
public void unregisterListener (SplitInstallStateUpdatedListener listener)
```

Unregisters a listener you previously registered using[registerListener(SplitInstallStateUpdatedListener)](https://developer.android.com/reference/com/google/android/play/core/splitinstall/SplitInstallManager.html#registerListener(com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener)).

<br />

|                      Parameters                       ||
|------------|-------------------------------------------|
| `listener` | `SplitInstallStateUpdatedListener` <br /> |