From 9d7731e717925cdea2a3a634a4b030cbe990287b Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:04:07 +0200 Subject: [PATCH] Update StorageStrategy KDoc comments --- .../plugin/config/StorageStrategy.kt | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/shared/src/main/java/de/mm20/launcher2/plugin/config/StorageStrategy.kt b/core/shared/src/main/java/de/mm20/launcher2/plugin/config/StorageStrategy.kt index b4ae67a8..7a18a001 100644 --- a/core/shared/src/main/java/de/mm20/launcher2/plugin/config/StorageStrategy.kt +++ b/core/shared/src/main/java/de/mm20/launcher2/plugin/config/StorageStrategy.kt @@ -10,21 +10,23 @@ import kotlinx.serialization.Serializable @Serializable enum class StorageStrategy { /** - * The launcher only stores the ID and the plugin provider for the search result. To restore the - * search result, the launcher will query the plugin provider again. This strategy allows the - * plugin provider to update a search result at a later point in time. However, plugins that use - * this strategy must guarantee that a search result can be restored in a timely manner. In - * particular, the plugin provider must be able to restore a search result without any network - * requests. + * The launcher only stores the ID of the search result, and the plugin that created it. To + * restore a result, the plugin is queried again. This allows the plugin to update key fields + * (i.e. the label) immediately. However, plugins that use this strategy must guarantee, that + * they can restore a search result at any time, in a timely manner. In particular, the plugin + * must be able to restore a search result without any network requests. This strategy is best + * suited for on-device search plugins. */ @SerialName("ref") StoreReference, /** - * The launcher stores all relevant information in its own internal database. This strategy - * is easier to implement, but search results cannot be updated at a later point in time. - * Use this strategy if your plugin needs to perform network requests to retrieve search - * results and if you don't want to implement a cache for search results. + * The launcher stores all relevant information about this search result in its own internal + * database. The result can be restored without querying the plugin again. The launcher will try + * refresh the search result at its own discretion (e.g. when a user long-presses a restored + * search result to view its details). This strategy is the default and should be used whenever + * the plugin can't restore a search result immediately. It is best suited for online search + * plugins. */ @SerialName("copy") StoreCopy,