[Catalyst] Provide screen key to @ProvidePreferenceScreen

NO_IFTTT=Catalyst only

Bug: 386179791
Flag: com.android.settings.flags.catalyst
Test: manual
Change-Id: Ie8106ec45a32e4a61826512fc62746c9ffc47d9c
This commit is contained in:
Jacky Wang
2024-12-27 08:00:44 +08:00
parent 11a5a8b27a
commit cfcf20c70a
27 changed files with 67 additions and 70 deletions

View File

@@ -20,6 +20,7 @@ import android.content.Context
import android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID
import com.android.settings.R
import com.android.settings.Settings.DataSaverSummaryActivity
import com.android.settings.datausage.DataSaverMainSwitchPreference.Companion.KEY as DATA_SAVER_KEY
import com.android.settings.flags.Flags
import com.android.settings.utils.makeLaunchIntent
import com.android.settingslib.datastore.HandlerExecutor
@@ -32,9 +33,8 @@ import com.android.settingslib.metadata.PreferenceSummaryProvider
import com.android.settingslib.metadata.ProvidePreferenceScreen
import com.android.settingslib.metadata.preferenceHierarchy
import com.android.settingslib.preference.PreferenceScreenCreator
import com.android.settings.datausage.DataSaverMainSwitchPreference.Companion.KEY as DATA_SAVER_KEY
@ProvidePreferenceScreen
@ProvidePreferenceScreen(DataSaverScreen.KEY)
class DataSaverScreen(context: Context) :
PreferenceScreenCreator,
PreferenceAvailabilityProvider,
@@ -75,7 +75,7 @@ class DataSaverScreen(context: Context) :
makeLaunchIntent(context, DataSaverSummaryActivity::class.java, metadata?.key)
override fun getPreferenceHierarchy(context: Context) =
preferenceHierarchy(this) { +DataSaverMainSwitchPreference() }
preferenceHierarchy(context, this) { +DataSaverMainSwitchPreference() }
override fun hasCompleteHierarchy() = false