summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Aitharaju <saia@codeaurora.org>2014-10-13 15:25:42 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:21:09 -0600
commitdf5408f3c0c7132645c3cfe1e04776d808b35ddb (patch)
tree31face05497fbe76240ea8703696aef41389a8fb
parentc76d11dd90e028216d76a0211e3db7260b6f197c (diff)
downloadpackages_apps_Settings-df5408f3c0c7132645c3cfe1e04776d808b35ddb.zip
packages_apps_Settings-df5408f3c0c7132645c3cfe1e04776d808b35ddb.tar.gz
packages_apps_Settings-df5408f3c0c7132645c3cfe1e04776d808b35ddb.tar.bz2
Bluetooth: Ignore the second button if one already pressed
Ignore the second buton if already one button is pressed, this case comes when user is trying to press the both cancel and ok for the pairing dialog Change-Id: I77516ec59a972b4451bb8cff69645f7b9089497f CRs-Fixed: 624285 Bluetooth: disable scan icon when BT state is off Usually onScanningStateChanged function should take care of disabling the scan icon when the scan is completed. But When the BT scan is going on and try to switch of the BT, as onScanningStateChanged function doesn't have the reference for scan icon it will not disable it, so disabling is taken care in BluetoothSettings on receiving BT Off state. On receiving BT Off state, disable the scan progress icon only when available device category is present. Change-Id: Ib827903d4f5c80eeb6ac8a06fb1a945140dd20c9 CRs-Fixed: 543777,596214 Change-Id: Ia9c936fc53b099c18e0f5eadfb293eec028077a5
-rwxr-xr-xsrc/com/android/settings/bluetooth/BluetoothPairingDialog.java10
-rw-r--r--src/com/android/settings/bluetooth/BluetoothSettings.java4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index bd35bd7..cb06d5d 100755
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -66,6 +66,7 @@ public final class BluetoothPairingDialog extends AlertActivity implements
private String mPairingKey;
private EditText mPairingView;
private Button mOkButton;
+ private boolean mIsButtonPressed;
/**
* Dismiss the dialog if the bond state changes to bonded or none,
@@ -95,6 +96,8 @@ public final class BluetoothPairingDialog extends AlertActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ mIsButtonPressed = false;
+
Intent intent = getIntent();
if (!intent.getAction().equals(BluetoothDevice.ACTION_PAIRING_REQUEST))
{
@@ -425,6 +428,11 @@ public final class BluetoothPairingDialog extends AlertActivity implements
}
public void onClick(DialogInterface dialog, int which) {
+ if(mIsButtonPressed)
+ {
+ Log.e(TAG, "button already pressed");
+ return;
+ }
switch (which) {
case BUTTON_POSITIVE:
if (mPairingView != null) {
@@ -432,9 +440,11 @@ public final class BluetoothPairingDialog extends AlertActivity implements
} else {
onPair(null);
}
+ mIsButtonPressed = true;
break;
case BUTTON_NEGATIVE:
+ mIsButtonPressed = true;
default:
onCancel();
break;
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index 4c48981..631f2fd 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -357,6 +357,10 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
case BluetoothAdapter.STATE_OFF:
setOffMessage();
+ /* reset the progress icon only when available device category present */
+ if(mAvailableDevicesCategoryIsPresent) {
+ ((BluetoothProgressCategory)mAvailableDevicesCategory).setProgress(false);
+ }
if (isUiRestricted()) {
messageId = R.string.bluetooth_empty_list_user_restricted;
}