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

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

[Catalyst] Update PreferenceLifecycleContext.notifyPreferenceChange

Change the signature from metadata to preference key, so that the API
could be used to notify other preferences on the same screen.

Bug: 332201912
Flag: com.android.settings.flags.catalyst
Test: atest
Change-Id: I1cfa35077551cb614b9892c7433f6e733bc55d0e
parent a1c29b99
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ interface PreferenceLifecycleProvider {
 */
abstract class PreferenceLifecycleContext(context: Context) : ContextWrapper(context) {

    /** Notifies that preference state is changed and update preference widget UI. */
    abstract fun notifyPreferenceChange(preference: PreferenceMetadata)
    /** Notifies that preference state of given key is changed and updates preference widget UI. */
    abstract fun notifyPreferenceChange(key: String)

    /**
     * Starts activity for result, see [android.app.Activity.startActivityForResult].
+2 −2
Original line number Diff line number Diff line
@@ -57,8 +57,8 @@ class PreferenceScreenBindingHelper(

    private val preferenceLifecycleContext =
        object : PreferenceLifecycleContext(context) {
            override fun notifyPreferenceChange(preference: PreferenceMetadata) =
                notifyChange(preference.key, CHANGE_REASON_STATE)
            override fun notifyPreferenceChange(key: String) =
                notifyChange(key, CHANGE_REASON_STATE)

            @Suppress("DEPRECATION")
            override fun startActivityForResult(