Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java +6 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ public class BluetoothPbapReceiver extends BroadcastReceiver { || (state == BluetoothAdapter.STATE_TURNING_OFF)) { startService = false; } } else { // Don't forward intent unless device has bluetooth and bluetooth is enabled. BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); if (adapter == null || !adapter.isEnabled()) { startService = false; } } if (startService) { context.startService(in); Loading android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +8 −1 Original line number Diff line number Diff line Loading @@ -245,10 +245,17 @@ public class BluetoothPbapService extends Service { int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); boolean removeTimeoutMsg = true; if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { removeTimeoutMsg = false; if (state == BluetoothAdapter.STATE_OFF) { // Send any pending timeout now, as this service will be destroyed. if (mSessionStatusHandler.hasMessages(USER_TIMEOUT)) { Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); sendBroadcast(timeoutIntent); removePbapNotification(NOTIFICATION_ID_ACCESS); } // Release all resources closeService(); } else { removeTimeoutMsg = false; } } else if (action.equals(ACCESS_ALLOWED_ACTION)) { if (intent.getBooleanExtra(EXTRA_ALWAYS_ALLOWED, false)) { Loading Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapReceiver.java +6 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,12 @@ public class BluetoothPbapReceiver extends BroadcastReceiver { || (state == BluetoothAdapter.STATE_TURNING_OFF)) { startService = false; } } else { // Don't forward intent unless device has bluetooth and bluetooth is enabled. BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); if (adapter == null || !adapter.isEnabled()) { startService = false; } } if (startService) { context.startService(in); Loading
android/app/src/com/android/bluetooth/pbap/BluetoothPbapService.java +8 −1 Original line number Diff line number Diff line Loading @@ -245,10 +245,17 @@ public class BluetoothPbapService extends Service { int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR); boolean removeTimeoutMsg = true; if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) { removeTimeoutMsg = false; if (state == BluetoothAdapter.STATE_OFF) { // Send any pending timeout now, as this service will be destroyed. if (mSessionStatusHandler.hasMessages(USER_TIMEOUT)) { Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION); sendBroadcast(timeoutIntent); removePbapNotification(NOTIFICATION_ID_ACCESS); } // Release all resources closeService(); } else { removeTimeoutMsg = false; } } else if (action.equals(ACCESS_ALLOWED_ACTION)) { if (intent.getBooleanExtra(EXTRA_ALWAYS_ALLOWED, false)) { Loading