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: Jingqiu Zhao <jingqiu.zhao@sony.com> Test: manual test Bug: 289532978 Change-Id: I146fb8188e783fed98d9fe56050e384bc4cca052
This commit is contained in:
@@ -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"/>
|
||||
|
||||
|
@@ -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,8 +195,9 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment implem
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
if (mWifiDisplayStatus != null && mWifiDisplayStatus.getFeatureState()
|
||||
!= WifiDisplayStatus.FEATURE_STATE_UNAVAILABLE) {
|
||||
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);
|
||||
item.setCheckable(true);
|
||||
|
Reference in New Issue
Block a user