Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5c65163 authored by Jacky Wang's avatar Jacky Wang
Browse files

[Catalyst] Add more docs for some API

Bug: 332201912
Flag: DOCS_ONLY
Test: N/A
Change-Id: Ic03eca00af776b91b2ee1b0f2749162a61882217
parent 983bc5f9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -141,7 +141,14 @@ interface PreferenceMetadata {
     */
    fun isEnabled(context: Context): Boolean = true

    /** Returns the keys of depended preferences. */
    /**
     * Returns the keys of depended preferences.
     *
     * Keep in mind that the dependency is effective only on the same screen. For cross screen
     * dependency, especially for preference screen entry point, add observer (e.g. on the depended
     * preference's data store) explicitly to update the preference with
     * [PreferenceLifecycleProvider].
     */
    fun dependencies(context: Context): Array<String> = arrayOf()

    /** Returns if the preference is persistent in datastore. */
+4 −2
Original line number Diff line number Diff line
@@ -84,9 +84,11 @@ interface PreferenceRestrictionProvider {
}

/**
 * Preference lifecycle to deal with preference state.
 * Preference lifecycle to deal with preference UI state.
 *
 * Implement this interface when preference depends on runtime conditions.
 * Implement this interface when preference depends on runtime conditions for UI update. Note that
 * [PreferenceMetadata] could be created for UI (shown in UI widget) or background (e.g. external
 * Get/Set), callbacks in this interface will ONLY be invoked when it is for UI.
 */
interface PreferenceLifecycleProvider {