ProfileStore
@UiThread
public 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 methods |
|
|---|---|
abstract boolean |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Deletes the profile data associated with the name. |
abstract @NonNull List<String> |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns the names of all available profiles. |
default static @NonNull ProfileStore |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns the production instance of ProfileStore. |
abstract @NonNull Profile |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns a profile with the given name, creating if needed. |
abstract @Nullable Profile |
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")Returns a profile with the given name, if it exists. |
Public methods
deleteProfile
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract boolean deleteProfile(@NonNull String name)
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.
| 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")
abstract @NonNull List<String> getAllProfileNames()
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")
default static @NonNull ProfileStore getInstance()
Returns the production instance of ProfileStore.
| Returns | |
|---|---|
@NonNull ProfileStore |
ProfileStore instance to use for managing profiles. |
getOrCreateProfile
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract @NonNull Profile getOrCreateProfile(@NonNull String name)
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.
getProfile
@RequiresFeature(name = WebViewFeature.MULTI_PROFILE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract @Nullable Profile getProfile(@NonNull String name)
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.