ProfileStore


@UiThread
interface ProfileStore


Manages any creation, deletion for Profile.

Example usage:

   ProfileStore profileStore = ProfileStore.getInstance();

   // Use this store instance to manage Profiles.
   Profile createdProfile = profileStore.getOrCreateProfile("test_profile");
   createdProfile.getGeolocationPermissions().clear("example");
   //...
   profileStore.deleteProfile("profile_test");

Summary

Public functions

Boolean
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
deleteProfile(name: String)

Deletes the profile data associated with the name.

(Mutable)List<String!>
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getAllProfileNames()

Returns the names of all available profiles.

java-static ProfileStore
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getInstance()

Returns the production instance of ProfileStore.

Profile
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getOrCreateProfile(name: String)

Returns a profile with the given name, creating if needed.

Profile?
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getProfile(name: String)

Returns a profile with the given name, if it exists.

Public functions

deleteProfile

Added in 1.9.0
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun deleteProfile(name: String): Boolean

Deletes the profile data associated with the name.

If this method returns true, the Profile object associated with the name will no longer be usable by the application. Returning false means that this profile doesn't exist.

Some data may be deleted async and is not guaranteed to be cleared from disk by the time this method returns.

Parameters
name: String

the profile name to be deleted.

Returns
Boolean

true if profile exists and its data is to be deleted, otherwise false.

Throws
java.lang.IllegalStateException

if there are living WebViews associated with that profile.

java.lang.IllegalStateException

if you are trying to delete a Profile that was loaded in the memory using getOrCreateProfile} or getProfile.

java.lang.IllegalArgumentException

if you are trying to delete the default Profile.

getAllProfileNames

Added in 1.9.0
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getAllProfileNames(): (Mutable)List<String!>

Returns the names of all available profiles.

Default profile name will be included in this list.

Returns
(Mutable)List<String!>

profile names as a list.

getInstance

Added in 1.9.0
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
java-static fun getInstance(): ProfileStore

Returns the production instance of ProfileStore.

Returns
ProfileStore

ProfileStore instance to use for managing profiles.

getOrCreateProfile

Added in 1.9.0
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getOrCreateProfile(name: String): Profile

Returns a profile with the given name, creating if needed.

Returns the associated Profile with this name, if there's no match with this name it will create a new Profile instance.

Parameters
name: String

name of the profile to retrieve.

Returns
Profile

instance of Profile matching this name.

getProfile

Added in 1.9.0
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
fun getProfile(name: String): Profile?

Returns a profile with the given name, if it exists.

Returns the associated Profile with this name, if there's no Profile with this name or the Profile was deleted by deleteProfile it will return null.

Parameters
name: String

the name of the profile to retrieve.

Returns
Profile?

instance of Profile matching this name, null otherwise if there's no match.