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

Commit 0dc6180a authored by Jacky Wang's avatar Jacky Wang Committed by Android Build Coastguard Worker
Browse files

[Catalyst] Fix enable state for Wi-Fi hotspot

NO_IFTTT=Catalyst only

Bug: 383232049
Flag: com.android.settings.flags.catalyst_tether_settings
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3d595b169d61b1d0fac08165b822aeedd0d4e3ee)
Merged-In: I067e97820a19822eaad2e93e30d42f7f767bf855
Change-Id: I067e97820a19822eaad2e93e30d42f7f767bf855
parent d458d4a6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ class WifiHotspotSwitchPreference(context: Context, dataSaverStore: KeyValueStor
            .toIntent()

    override fun isEnabled(context: Context) =
        wifiHotspotStore.dataSaverStore.getBoolean(DATA_SAVER_KEY) == true &&
        wifiHotspotStore.dataSaverStore.getBoolean(DATA_SAVER_KEY) != true &&
            super<PreferenceRestrictionMixin>.isEnabled(context)

    override val restrictionKeys
@@ -193,6 +193,7 @@ class WifiHotspotSwitchPreference(context: Context, dataSaverStore: KeyValueStor
        super.bind(preference, metadata)
        (preference as PrimarySwitchPreference).apply {
            isChecked = preferenceDataStore!!.getBoolean(key, false)
            isSwitchEnabled = isEnabled
        }
    }