OSDN Git Service

Don't allow a zero-length device name to work.
authorDaniel Nishi <dhnishi@google.com>
Mon, 12 Mar 2018 23:44:27 +0000 (16:44 -0700)
committerDaniel Nishi <dhnishi@google.com>
Mon, 12 Mar 2018 23:44:27 +0000 (16:44 -0700)
commitb2165509445c0c63b1813132d8b92b119bd44d57
tree2c945cf512547b05f951b311db75f0f7d9930602
parent6d3511c9b3d839352b58a7509a2ce6828683df75
Don't allow a zero-length device name to work.

Technically, if a device has a zero-length device name, the bug will
resurface. The EditText validator doesn't trigger on opening -- only
when the text is edited. A zero-length device name is flagged as being
invalid, but that fails if the text box starts empty.

By pre-filling it with the previous device name, we can ensure that, as
long as a zero-length device name is never set, it can never be set.

Change-Id: I0d28aaae09f99b7d697b753835ba39c0c06644a1
Fixes: 73127912
Test: Robotest
src/com/android/settings/deviceinfo/DeviceNamePreferenceController.java
tests/robotests/src/com/android/settings/deviceinfo/DeviceNamePreferenceControllerTest.java