mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-22 00:44:26 +01:00
#8 fixed again
This commit is contained in:
@@ -278,7 +278,7 @@ public abstract class BleProfileActivity extends AppCompatActivity implements Bl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
mDeviceConnected = false;
|
mDeviceConnected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ public abstract class BleProfileExpandableListActivity extends ExpandableListAct
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
mDeviceConnected = false;
|
mDeviceConnected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal
|
|||||||
|
|
||||||
// Note 2: if BleManager#shouldAutoConnect() for this device returned true, this callback will be
|
// Note 2: if BleManager#shouldAutoConnect() for this device returned true, this callback will be
|
||||||
// invoked ONLY when user requested disconnection (using Disconnect button). If the device
|
// invoked ONLY when user requested disconnection (using Disconnect button). If the device
|
||||||
// disconnects due to a link loss, the onLinklossOccurred(BluetoothDevice) method will be called instead.
|
// disconnects due to a link loss, the onLinkLossOccurred(BluetoothDevice) method will be called instead.
|
||||||
|
|
||||||
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
||||||
broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice);
|
broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice);
|
||||||
@@ -442,7 +442,7 @@ public abstract class BleProfileService extends Service implements BleManagerCal
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
||||||
broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice);
|
broadcast.putExtra(EXTRA_DEVICE, mBluetoothDevice);
|
||||||
broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS);
|
broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS);
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public abstract class BleProfileServiceReadyActivity<E extends BleProfileService
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BleProfileService.STATE_LINK_LOSS: {
|
case BleProfileService.STATE_LINK_LOSS: {
|
||||||
onLinklossOccurred(bluetoothDevice);
|
onLinkLossOccurred(bluetoothDevice);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BleProfileService.STATE_CONNECTING: {
|
case BleProfileService.STATE_CONNECTING: {
|
||||||
@@ -521,7 +521,7 @@ public abstract class BleProfileServiceReadyActivity<E extends BleProfileService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
// empty default implementation
|
// empty default implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ public abstract class BleMulticonnectProfileService extends Service implements B
|
|||||||
public void onDeviceDisconnected(final BluetoothDevice device) {
|
public void onDeviceDisconnected(final BluetoothDevice device) {
|
||||||
// Note: if BleManager#shouldAutoConnect() for this device returned true, this callback will be
|
// Note: if BleManager#shouldAutoConnect() for this device returned true, this callback will be
|
||||||
// invoked ONLY when user requested disconnection (using Disconnect button). If the device
|
// invoked ONLY when user requested disconnection (using Disconnect button). If the device
|
||||||
// disconnects due to a link loss, the onLinklossOccurred(BluetoothDevice) method will be called instead.
|
// disconnects due to a link loss, the onLinkLossOccurred(BluetoothDevice) method will be called instead.
|
||||||
|
|
||||||
// We no longer want to keep the device in the service
|
// We no longer want to keep the device in the service
|
||||||
mManagedDevices.remove(device);
|
mManagedDevices.remove(device);
|
||||||
@@ -455,7 +455,7 @@ public abstract class BleMulticonnectProfileService extends Service implements B
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
final Intent broadcast = new Intent(BROADCAST_CONNECTION_STATE);
|
||||||
broadcast.putExtra(EXTRA_DEVICE, device);
|
broadcast.putExtra(EXTRA_DEVICE, device);
|
||||||
broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS);
|
broadcast.putExtra(EXTRA_CONNECTION_STATE, STATE_LINK_LOSS);
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public abstract class BleMulticonnectProfileServiceReadyActivity<E extends BleMu
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BleMulticonnectProfileService.STATE_LINK_LOSS: {
|
case BleMulticonnectProfileService.STATE_LINK_LOSS: {
|
||||||
onLinklossOccurred(bluetoothDevice);
|
onLinkLossOccurred(bluetoothDevice);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BleMulticonnectProfileService.STATE_CONNECTING: {
|
case BleMulticonnectProfileService.STATE_CONNECTING: {
|
||||||
@@ -415,7 +415,7 @@ public abstract class BleMulticonnectProfileServiceReadyActivity<E extends BleMu
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
// empty default implementation
|
// empty default implementation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class ProximityActivity extends BleMulticonnectProfileServiceReadyActivit
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
if (mAdapter != null)
|
if (mAdapter != null)
|
||||||
mAdapter.onDeviceStateChanged(device);
|
mAdapter.onDeviceStateChanged(device);
|
||||||
|
|
||||||
|
|||||||
@@ -274,10 +274,10 @@ public class ProximityService extends BleMulticonnectProfileService implements P
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
mServerManager.cancelConnection(device);
|
mServerManager.cancelConnection(device);
|
||||||
stopAlarm(device);
|
stopAlarm(device);
|
||||||
super.onLinklossOccurred(device);
|
super.onLinkLossOccurred(device);
|
||||||
|
|
||||||
if (!mBound) {
|
if (!mBound) {
|
||||||
createBackgroundNotification();
|
createBackgroundNotification();
|
||||||
|
|||||||
@@ -156,8 +156,8 @@ public class UARTService extends BleProfileService implements UARTManagerCallbac
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLinklossOccurred(final BluetoothDevice device) {
|
public void onLinkLossOccurred(final BluetoothDevice device) {
|
||||||
super.onLinklossOccurred(device);
|
super.onLinkLossOccurred(device);
|
||||||
sendMessageToWearables(Constants.UART.DEVICE_LINKLOSS, notNull(getDeviceName()));
|
sendMessageToWearables(Constants.UART.DEVICE_LINKLOSS, notNull(getDeviceName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user