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

Commit 7312defa authored by Edgar Wang's avatar Edgar Wang
Browse files

Fix Wifi & Bluetooth slice can't show on search result

root cause: we remove wifi & bluetooth preference screen key from search
indexing, this cause these 2 special slices can't map to correct key

solution: rename preference key for mapping

Bug: 149366072
Test: robotest & manual
Change-Id: Id424e63c4f97ccd6f58a80aaa414807774159512
parent 8163bc56
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@

    <Preference
        android:fragment="com.android.settings.connecteddevice.BluetoothDashboardFragment"
        android:key="bluetooth_settings"
        android:key="bluetooth_switchbar_screen"
        android:title="@string/bluetooth_settings_title"
        android:icon="@*android:drawable/ic_settings_bluetooth"
        android:order="-9"/>
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@

    <com.android.settings.widget.MasterSwitchPreference
        android:fragment="com.android.settings.wifi.WifiSettings"
        android:key="toggle_wifi"
        android:key="main_toggle_wifi"
        android:title="@string/wifi_settings"
        android:summary="@string/summary_placeholder"
        android:icon="@drawable/ic_settings_wireless"
+0 −8
Original line number Diff line number Diff line
@@ -150,13 +150,5 @@ public class NetworkDashboardFragment extends DashboardFragment implements
                            null /* metricsFeatureProvider */, null /* fragment */,
                            null /* mobilePlanHost */);
                }

                @Override
                public List<String> getNonIndexableKeys(Context context) {
                    List<String> keys = super.getNonIndexableKeys(context);
                    // Remove master switch as a result
                    keys.add(WifiMasterSwitchPreferenceController.KEY_TOGGLE_WIFI);
                    return keys;
                }
            };
}
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public class WifiMasterSwitchPreferenceController extends AbstractPreferenceCont
        implements PreferenceControllerMixin, SummaryUpdater.OnSummaryChangeListener,
        LifecycleObserver, OnResume, OnPause, OnStart, OnStop {

    public static final String KEY_TOGGLE_WIFI = "toggle_wifi";
    public static final String KEY_TOGGLE_WIFI = "main_toggle_wifi";

    private MasterSwitchPreference mWifiPreference;
    private WifiEnabler mWifiEnabler;