summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth
diff options
context:
space:
mode:
authorSrinu Jella <sjella@codeaurora.org>2014-05-12 19:53:12 +0530
committerAndre Eisenbach <eisenbach@google.com>2015-06-25 02:08:38 +0000
commit1c1320a84d22419efb3bf45d970f80b33658edc2 (patch)
tree6b5b8abe18eca75dd07c80cf34e41557c3db519e /src/com/android/settings/bluetooth
parent1c19cb5edd7a366192f28a0d7eb47e0021e9bbdd (diff)
downloadpackages_apps_Settings-1c1320a84d22419efb3bf45d970f80b33658edc2.zip
packages_apps_Settings-1c1320a84d22419efb3bf45d970f80b33658edc2.tar.gz
packages_apps_Settings-1c1320a84d22419efb3bf45d970f80b33658edc2.tar.bz2
Bluetooth: Fix to avoid taking space as name upon orientation
Use case: Renaming the DUT name on orientation chnage STR: 1) Go for the option of rename phone. 2) give only space characters. 3) The rename option shows disabled. 4) Change the orientation of the phone. 5) Check whether it accepts space as a name. Failure: Renaming a phone with space characters gets accepted during change in orientation.Accepted space as BT name upon changing orientation Root cause: There is no check for validating the input string while renaming the device name on orientation change. Fix: This fix is to avoid taking space character as a name in the BluetoothNameDialogFragment upon orientation change from PORTRAIT mode to LANDSCAPE mode and vice versa. Change-Id: Ia66f27bb9b06739e42d73b15745c12a42512a1fc
Diffstat (limited to 'src/com/android/settings/bluetooth')
-rw-r--r--src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
index 250b326..293a53e 100644
--- a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
@@ -25,6 +25,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.res.Configuration;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
@@ -195,6 +196,13 @@ public final class BluetoothNameDialogFragment extends DialogFragment implements
}
}
+ public void onConfigurationChanged(Configuration newConfig, CharSequence s) {
+ super.onConfigurationChanged(newConfig);
+ if (mOkButton != null) {
+ mOkButton.setEnabled(s.length() != 0 && !(s.toString().trim().isEmpty()));
+ }
+ }
+
/* Not used */
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}