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

Commit 7190f853 authored by Ben Lin's avatar Ben Lin
Browse files

Add ability to show/hide different device information.

This introduces 3 boolean flags:

config_show_device_model
config_show_wifi_ip_address
config_show_wifi_mac_address

Which when set to false will hide their individual panes from "About
Phone" page.

Bug: 62414913
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.deviceinfo
Change-Id: Iaaf91ef41c9ec7b5bf233344e6a48d4b87fad291
parent 7245bbb3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -158,4 +158,13 @@

    <!-- Whether system_update_settings should be shown or not. -->
    <bool name="config_show_system_update_settings">true</bool>

    <!-- Whether device_model should be shown or not. -->
    <bool name="config_show_device_model">true</bool>

    <!-- Whether wifi_ip_address should be shown or not. -->
    <bool name="config_show_wifi_ip_address">true</bool>

    <!-- Whether wifi_mac_address should be shown or not. -->
    <bool name="config_show_wifi_mac_address">true</bool>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public class DeviceModelPreferenceController extends AbstractPreferenceControlle

    @Override
    public boolean isAvailable() {
        return true;
        return mContext.getResources().getBoolean(R.bool.config_show_device_model);
    }

    @Override
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package com.android.settings.deviceinfo;
import android.content.Context;

import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.R;

import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.deviceinfo.AbstractIpAddressPreferenceController;

@@ -31,5 +33,10 @@ public class IpAddressPreferenceController extends AbstractIpAddressPreferenceCo
        super(context, lifecycle);
    }

    @Override
    public boolean isAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_show_wifi_ip_address);
    }

    // This space intentionally left blank
}
+6 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.deviceinfo;
import android.content.Context;

import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.R;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.deviceinfo.AbstractWifiMacAddressPreferenceController;

@@ -31,5 +32,10 @@ public class WifiMacAddressPreferenceController extends AbstractWifiMacAddressPr
        super(context, lifecycle);
    }

    @Override
    public boolean isAvailable() {
        return mContext.getResources().getBoolean(R.bool.config_show_wifi_mac_address);
    }

    // This space intentionally left blank
}
+3 −0
Original line number Diff line number Diff line
@@ -57,4 +57,7 @@
    <bool name="config_show_color_inversion_preference">false</bool>
    <bool name="config_show_system_update_settings">false</bool>
    <bool name="config_wifi_support_connected_mac_randomization">false</bool>
    <bool name="config_show_device_model">false</bool>
    <bool name="config_show_wifi_ip_address">false</bool>
    <bool name="config_show_wifi_mac_address">false</bool>
</resources>
Loading