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

Commit 0d0736c4 authored by Bruno Kremp's avatar Bruno Kremp
Browse files

Add a config to hide "Enable wireless display" menu



Add config_show_wifi_display_enable_menu to control whether to
display "Enable wireless display" menu at Settings->
Connection preference->Cast.

If persist.debug.wfd.enable is 1, "Enable wireless display" menu will be
shown at Settings->Connection preference->Cast. Add a config to hide the
menu when needed.

setHasOptionsMenu is invoked in onActivityCreated of the parent class of
WifiDisplaySettings. No need to invoke it in onCreate.

Co-authored-by: default avatarJingqiu Zhao <jingqiu.zhao@sony.com>

Test: manual test
Bug: 289532978
Change-Id: I146fb8188e783fed98d9fe56050e384bc4cca052
parent a23320ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -726,6 +726,9 @@
        <item></item>
    </string-array>

    <!-- Whether to display the "Enable wireless display" menu -->
    <bool name="config_show_wifi_display_enable_menu">true</bool>

    <!-- List of packages that should be hidden for MVNO. Do not translate -->
    <string-array name="datausage_hiding_carrier_service_package_names" translatable="false"/>

+3 −3
Original line number Diff line number Diff line
@@ -139,7 +139,6 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment implem
        mWifiP2pChannel = mWifiP2pManager.initialize(context, Looper.getMainLooper(), null);

        addPreferencesFromResource(R.xml.wifi_display_settings);
        setHasOptionsMenu(true);
    }

    @Override
@@ -196,7 +195,8 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment implem

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        if (mWifiDisplayStatus != null && mWifiDisplayStatus.getFeatureState()
        if (getResources().getBoolean(R.bool.config_show_wifi_display_enable_menu)
                && mWifiDisplayStatus != null && mWifiDisplayStatus.getFeatureState()
                        != WifiDisplayStatus.FEATURE_STATE_UNAVAILABLE) {
            MenuItem item = menu.add(Menu.NONE, MENU_ID_ENABLE_WIFI_DISPLAY, 0,
                    R.string.wifi_display_enable_menu_item);