From 3fa8c4cb0f7da09791c0f929e857b0b7f0404c53 Mon Sep 17 00:00:00 2001 From: Juffin Alex Varghese Date: Sat, 28 Sep 2013 16:07:43 +0530 Subject: Bluetooth: Update notification while BT is turning OFF Change will update notification while BT is turning OFF. Otherwise, when BT is turning OFF if Update notification thread is missed inbound/outbound file transfer status, notification will not properly updated. CRs-Fixed: 550485 Change-Id: I0752bcddcf218726c8564d26da7bc7c86a0005fd (cherry picked from commit 75c26f304d79712f9346e2a1d4dcb694f852a7ea) (cherry picked from commit a6c8f1867c02d0daeabd7c122ffa4ece45a5d748) (cherry picked from commit 1477bde1f1306852870fc02258503722dca945a1) --- src/com/android/bluetooth/opp/BluetoothOppNotification.java | 10 ++++++++++ src/com/android/bluetooth/opp/BluetoothOppService.java | 1 + 2 files changed, 11 insertions(+) (limited to 'src/com/android/bluetooth/opp') diff --git a/src/com/android/bluetooth/opp/BluetoothOppNotification.java b/src/com/android/bluetooth/opp/BluetoothOppNotification.java index 46482d3c2..1b663220c 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppNotification.java +++ b/src/com/android/bluetooth/opp/BluetoothOppNotification.java @@ -154,6 +154,16 @@ class BluetoothOppNotification { } } + public void updateNotifier() { + if (V) Log.v(TAG, "updateNotifier while BT is Turning OFF"); + synchronized (BluetoothOppNotification.this) { + updateActiveNotification(); + mUpdateCompleteNotification = true; + updateCompletedNotification(); + updateIncomingFileConfirmNotification(); + } + } + private static final int NOTIFY = 0; // Use 1 second timer to limit notification frequency. // 1. On the first notification, create the update thread. diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java index e7eb2568a..3a2702ca3 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -367,6 +367,7 @@ public class BluetoothOppService extends Service { break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Receiver DISABLED_ACTION "); + mNotifier.updateNotifier(); //FIX: Don't block main thread /* mSocketListener.stop(); -- cgit v1.2.3