diff options
author | Juffin Alex Varghese <jalex@codeaurora.org> | 2014-02-07 18:44:12 +0530 |
---|---|---|
committer | Juffin Alex Varghese <jalex@codeaurora.org> | 2014-02-10 16:57:07 +0530 |
commit | 30ede28d688343ded902c062414522f08dd20930 (patch) | |
tree | a8b05d0cf36d256ee37e0c9206af980ec41f725b | |
parent | 479e909ca89712685ce55a68edc22d748d4777f4 (diff) | |
download | android_packages_apps_Bluetooth-30ede28d688343ded902c062414522f08dd20930.tar.gz android_packages_apps_Bluetooth-30ede28d688343ded902c062414522f08dd20930.tar.bz2 android_packages_apps_Bluetooth-30ede28d688343ded902c062414522f08dd20930.zip |
Bluetooth-OPP: Avoid displaying two pop-ups in Tranfer History
This change will ensure that if context menu is created then no
need to execute onclick keyevent automatically. Otherwise, if user
selects options from context menu crash is observed in Bluetooth
app.
CRs-Fixed: 611782
Change-Id: I8328f87f9c4bc007cd46a5567268621499e35343
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java b/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java index abe343f95..037c67c1d 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java +++ b/src/com/android/bluetooth/opp/BluetoothOppTransferHistory.java @@ -76,6 +76,8 @@ public class BluetoothOppTransferHistory extends Activity implements private boolean mShowAllIncoming; + private boolean mContextMenu = false; + /** Class to handle Notification Manager updates */ private BluetoothOppNotification mNotifier; @@ -182,12 +184,14 @@ public class BluetoothOppTransferHistory extends Activity implements updateNotificationWhenBtDisabled(); return true; } + mContextMenu = false; return false; } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { if (mTransferCursor != null) { + mContextMenu = true; AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo; mTransferCursor.moveToPosition(info.position); mContextMenuPosition = info.position; @@ -263,9 +267,13 @@ public class BluetoothOppTransferHistory extends Activity implements */ public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Open the selected item - mTransferCursor.moveToPosition(position); - openCompleteTransfer(); - updateNotificationWhenBtDisabled(); + if (V) Log.v(TAG, "onItemClick: ContextMenu = " + mContextMenu); + if (!mContextMenu) { + mTransferCursor.moveToPosition(position); + openCompleteTransfer(); + updateNotificationWhenBtDisabled(); + } + mContextMenu = false; } /** |