[Catalyst] Update DataChangeReason usages to PreferenceChangeReason

Bug: 388677104
Test: atest and manual
Flag: EXEMPT refactor
NO_IFTTT=refactor
Change-Id: I3c1aae3dc10a1c78e1b2b0ead8ffc83da933e174
This commit is contained in:
Fan Wu
2025-01-09 16:16:25 +08:00
parent f48f0573e1
commit 4ca85b1e5c
10 changed files with 33 additions and 25 deletions

View File

@@ -24,6 +24,7 @@ import android.os.UserManager
import com.android.settingslib.datastore.AbstractKeyedDataObservable
import com.android.settingslib.datastore.DataChangeReason
import com.android.settingslib.datastore.KeyedObserver
import com.android.settingslib.metadata.PreferenceChangeReason
import java.util.concurrent.Executor
/** Helper class to monitor user restriction changes. */
@@ -46,7 +47,7 @@ class UserRestrictions private constructor(private val applicationContext: Conte
object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// there is no way to get the changed keys, just notify all observers
observable.notifyChange(DataChangeReason.UPDATE)
observable.notifyChange(PreferenceChangeReason.STATE)
}
}