Add device name to About Phone page.

The device name is reflected in three places: A Settings.Global flag
which can be read by third party apps, the Bluetooth device name, and
the Wi-Fi tethering hotspot name.

The Bluetooth and Wi-Fi names can be changed independently of the device
name, but if the user sets the device name, they are all changed in
parallel.

Due to the naming restrictions of Bluetooth devices and SSIDs, the SSID
naming restrictions apply to the device name.

Bug: 63819909
Test: Robotest
Change-Id: I3a81535fc07d183557a6fa5d54baef3c7868499c
This commit is contained in:
Daniel Nishi
2018-01-17 18:05:13 -08:00
parent eb4dceea7f
commit a633b39cfa
10 changed files with 356 additions and 9 deletions

View File

@@ -43,8 +43,6 @@ import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
*/
abstract class BluetoothNameDialogFragment extends InstrumentedDialogFragment
implements TextWatcher {
private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 248;
private AlertDialog mAlertDialog;
private Button mOkButton;
@@ -109,7 +107,7 @@ abstract class BluetoothNameDialogFragment extends InstrumentedDialogFragment
View view = layoutInflater.inflate(R.layout.dialog_edittext, null);
mDeviceNameView = (EditText) view.findViewById(R.id.edittext);
mDeviceNameView.setFilters(new InputFilter[] {
new Utf8ByteLengthFilter(BLUETOOTH_NAME_MAX_LENGTH_BYTES)
new BluetoothLengthDeviceNameFilter()
});
mDeviceNameView.setText(deviceName); // set initial value before adding listener
if (!TextUtils.isEmpty(deviceName)) {