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

Commit 75a349c1 authored by Stanley Wang's avatar Stanley Wang
Browse files

Add the title of the SettingsMainSwitchPreference in the

mobile_network_settings.xml to avoid the preference can not
be indexed.

Fix: 222021677
Test: manually test and review the UI
Change-Id: I53b1637e845489bc1df2e7b4216c56400fd28659
parent 8bd66478
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@


    <com.android.settings.widget.SettingsMainSwitchPreference
    <com.android.settings.widget.SettingsMainSwitchPreference
        android:key="use_sim_switch"
        android:key="use_sim_switch"
        android:title="@string/mobile_network_use_sim_on"
        settings:controller="com.android.settings.network.telephony.MobileNetworkSwitchController"/>
        settings:controller="com.android.settings.network.telephony.MobileNetworkSwitchController"/>


    <PreferenceCategory
    <PreferenceCategory
+0 −2
Original line number Original line Diff line number Diff line
@@ -28,7 +28,6 @@ import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceScreen;


import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.network.SubscriptionUtil;
import com.android.settings.network.SubscriptionUtil;
import com.android.settings.network.SubscriptionsChangeListener;
import com.android.settings.network.SubscriptionsChangeListener;
@@ -70,7 +69,6 @@ public class MobileNetworkSwitchController extends BasePreferenceController impl
    public void displayPreference(PreferenceScreen screen) {
    public void displayPreference(PreferenceScreen screen) {
        super.displayPreference(screen);
        super.displayPreference(screen);
        mSwitchBar = (SettingsMainSwitchPreference) screen.findPreference(mPreferenceKey);
        mSwitchBar = (SettingsMainSwitchPreference) screen.findPreference(mPreferenceKey);
        mSwitchBar.setTitle(mContext.getString(R.string.mobile_network_use_sim_on));


        mSwitchBar.setOnBeforeCheckedChangeListener((toggleSwitch, isChecked) -> {
        mSwitchBar.setOnBeforeCheckedChangeListener((toggleSwitch, isChecked) -> {
            // TODO b/135222940: re-evaluate whether to use
            // TODO b/135222940: re-evaluate whether to use