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")Deletes the profile data associated with the name. |
(Mutable)List<String!> |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns the names of all available profiles. |
java-static ProfileStore |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns the production instance of ProfileStore. |
Profile |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns a profile with the given name, creating if needed. |
Profile? |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns a profile with the given name, if it exists. |
Public functions
deleteProfile
@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 |
|
| 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 |
java.lang.IllegalArgumentException |
if you are trying to delete the default Profile. |
getAllProfileNames
@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.
getInstance
@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
@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. |
getProfile
@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. |