Add a boolean flag to show or hide the device name in About device.

The following boolean flag is added:
config_show_device_name

When set to false, the device name will not be shown in System > About
Device.

Bug: 111653180
Test: Updated robotests
Change-Id: Id9610e2009604c9d9693428adff01adc7d606565
This commit is contained in:
Prabir Pradhan
2018-07-25 13:55:56 -07:00
parent f24b749ec0
commit 7758fcc6dd
4 changed files with 22 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ import android.text.SpannedString;
import com.android.settings.bluetooth.BluetoothLengthDeviceNameFilter;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.R;
import com.android.settings.widget.ValidatedEditTextPreference;
import com.android.settings.wifi.tether.WifiDeviceNameTextValidator;
import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
@@ -90,7 +91,9 @@ public class DeviceNamePreferenceController extends BasePreferenceController
@Override
public int getAvailabilityStatus() {
return AVAILABLE;
return mContext.getResources().getBoolean(R.bool.config_show_device_name)
? AVAILABLE
: UNSUPPORTED_ON_DEVICE;
}
@Override