From cbcf45885f3e6848acef2b76c395455775e6874c Mon Sep 17 00:00:00 2001 From: linus_lee Date: Wed, 21 Jan 2015 12:39:24 -0800 Subject: Settings: Also disallow profile names with spaces Change-Id: Ie7d79518b0a0e28a929b7bdad3e41319e485af33 --- src/com/android/settings/profiles/SetupActionsFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/com/android/settings/profiles') diff --git a/src/com/android/settings/profiles/SetupActionsFragment.java b/src/com/android/settings/profiles/SetupActionsFragment.java index 7203b48..28ca71f 100644 --- a/src/com/android/settings/profiles/SetupActionsFragment.java +++ b/src/com/android/settings/profiles/SetupActionsFragment.java @@ -734,7 +734,9 @@ public class SetupActionsFragment extends SettingsPreferenceFragment @Override public void afterTextChanged(Editable s) { - final boolean empty = TextUtils.isEmpty(s.toString()); + final String str = s.toString(); + final boolean empty = TextUtils.isEmpty(str) + || TextUtils.getTrimmedLength(str) == 0; alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(!empty); } }); -- cgit v1.1