Loading android/app/src/com/android/bluetooth/bas/BatteryStateMachine.java +2 −12 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class BatteryStateMachine extends StateMachine { } synchronized boolean isConnected() { return getCurrentState() == mConnected; return mLastConnectionState == BluetoothProfile.STATE_CONNECTED; } private static String messageWhatToString(int what) { Loading Loading @@ -153,17 +153,7 @@ public class BatteryStateMachine extends StateMachine { @BluetoothProfile.BtProfileState int getConnectionState() { String currentState = getCurrentState().getName(); return switch (currentState) { case "Disconnected" -> BluetoothProfile.STATE_DISCONNECTED; case "Connecting" -> BluetoothProfile.STATE_CONNECTING; case "Connected" -> BluetoothProfile.STATE_CONNECTED; case "Disconnecting" -> BluetoothProfile.STATE_DISCONNECTING; default -> { Log.e(TAG, "Bad currentState: " + currentState); yield BluetoothProfile.STATE_DISCONNECTED; } }; return mLastConnectionState; } void dispatchConnectionStateChanged(int toState) { Loading Loading
android/app/src/com/android/bluetooth/bas/BatteryStateMachine.java +2 −12 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class BatteryStateMachine extends StateMachine { } synchronized boolean isConnected() { return getCurrentState() == mConnected; return mLastConnectionState == BluetoothProfile.STATE_CONNECTED; } private static String messageWhatToString(int what) { Loading Loading @@ -153,17 +153,7 @@ public class BatteryStateMachine extends StateMachine { @BluetoothProfile.BtProfileState int getConnectionState() { String currentState = getCurrentState().getName(); return switch (currentState) { case "Disconnected" -> BluetoothProfile.STATE_DISCONNECTED; case "Connecting" -> BluetoothProfile.STATE_CONNECTING; case "Connected" -> BluetoothProfile.STATE_CONNECTED; case "Disconnecting" -> BluetoothProfile.STATE_DISCONNECTING; default -> { Log.e(TAG, "Bad currentState: " + currentState); yield BluetoothProfile.STATE_DISCONNECTED; } }; return mLastConnectionState; } void dispatchConnectionStateChanged(int toState) { Loading