Loading src/com/android/bluetooth/opp/BluetoothOppNotification.java +11 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,16 @@ class BluetoothOppNotification { public void btOffNotification() { if (V) Log.v(TAG, "Update Notification while BT is Turning OFF"); synchronized (BluetoothOppNotification.this) { if (mUpdateNotificationThread != null) { try { mUpdateNotificationThread.interrupt(); mUpdateNotificationThread.join(); mUpdateNotificationThread = null; } catch (InterruptedException ie) { Log.e(TAG, "Notification thread join interrupted"); } } updateActiveNotification(); mInboundUpdateCompleteNotification = true; mOutboundUpdateCompleteNotification = true; Loading Loading @@ -205,7 +215,7 @@ class BluetoothOppNotification { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "NotificationThread was interrupted (1), exiting"); if (V) Log.v(TAG, "NotificationThread sleep is interrupted (1), exiting"); return; } Loading src/com/android/bluetooth/opp/BluetoothOppService.java +21 −9 Original line number Diff line number Diff line Loading @@ -416,6 +416,17 @@ public class BluetoothOppService extends Service { break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Receiver DISABLED_ACTION "); if (mUpdateThread != null) { try { mUpdateThread.interrupt(); mUpdateThread.join(); mUpdateThread = null; } catch (InterruptedException ie) { Log.e(TAG, "OPPService Thread join interrupted"); } } mNotifier.btOffNotification(); //FIX: Don't block main thread /* Loading Loading @@ -600,15 +611,6 @@ public class BluetoothOppService extends Service { cursor.close(); cursor = null; try { if (mPowerManager.isScreenOn()) { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "OppService UpdateThread was interrupted (1), exiting"); return; } if (V) { if (mServerSession != null) { Log.v(TAG, "Server Session is active"); Loading @@ -622,6 +624,16 @@ public class BluetoothOppService extends Service { Log.v(TAG, "No active Client Session"); } } try { if (((mServerSession != null) || (mTransfer != null)) && mPowerManager.isScreenOn()) { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "OppService Thread sleep is interrupted (1), exiting"); return; } } while (mPowerManager.isScreenOn() && ((mServerSession != null) || (mTransfer != null))); synchronized (BluetoothOppService.this) { Loading Loading
src/com/android/bluetooth/opp/BluetoothOppNotification.java +11 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,16 @@ class BluetoothOppNotification { public void btOffNotification() { if (V) Log.v(TAG, "Update Notification while BT is Turning OFF"); synchronized (BluetoothOppNotification.this) { if (mUpdateNotificationThread != null) { try { mUpdateNotificationThread.interrupt(); mUpdateNotificationThread.join(); mUpdateNotificationThread = null; } catch (InterruptedException ie) { Log.e(TAG, "Notification thread join interrupted"); } } updateActiveNotification(); mInboundUpdateCompleteNotification = true; mOutboundUpdateCompleteNotification = true; Loading Loading @@ -205,7 +215,7 @@ class BluetoothOppNotification { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "NotificationThread was interrupted (1), exiting"); if (V) Log.v(TAG, "NotificationThread sleep is interrupted (1), exiting"); return; } Loading
src/com/android/bluetooth/opp/BluetoothOppService.java +21 −9 Original line number Diff line number Diff line Loading @@ -416,6 +416,17 @@ public class BluetoothOppService extends Service { break; case BluetoothAdapter.STATE_TURNING_OFF: if (V) Log.v(TAG, "Receiver DISABLED_ACTION "); if (mUpdateThread != null) { try { mUpdateThread.interrupt(); mUpdateThread.join(); mUpdateThread = null; } catch (InterruptedException ie) { Log.e(TAG, "OPPService Thread join interrupted"); } } mNotifier.btOffNotification(); //FIX: Don't block main thread /* Loading Loading @@ -600,15 +611,6 @@ public class BluetoothOppService extends Service { cursor.close(); cursor = null; try { if (mPowerManager.isScreenOn()) { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "OppService UpdateThread was interrupted (1), exiting"); return; } if (V) { if (mServerSession != null) { Log.v(TAG, "Server Session is active"); Loading @@ -622,6 +624,16 @@ public class BluetoothOppService extends Service { Log.v(TAG, "No active Client Session"); } } try { if (((mServerSession != null) || (mTransfer != null)) && mPowerManager.isScreenOn()) { Thread.sleep(BluetoothShare.UI_UPDATE_INTERVAL); } } catch (InterruptedException e) { if (V) Log.v(TAG, "OppService Thread sleep is interrupted (1), exiting"); return; } } while (mPowerManager.isScreenOn() && ((mServerSession != null) || (mTransfer != null))); synchronized (BluetoothOppService.this) { Loading