Loading android/app/src/com/android/bluetooth/hid/HidHostService.java +1 −21 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ public class HidHostService extends ProfileService { private final HidHostNativeInterface mNativeInterface; private boolean mNativeAvailable; private BluetoothDevice mTargetDevice = null; private static final int MESSAGE_CONNECT = 1; private static final int MESSAGE_DISCONNECT = 2; Loading Loading @@ -698,7 +697,6 @@ public class HidHostService extends ProfileService { if (Flags.allowSwitchingHidAndHogp() || connectionAllowed) { updateConnectionState(device, transport, reportedState); } updateQuietMode(device, reportedState); } private void handleMessageDisconnect(Message msg) { Loading Loading @@ -781,23 +779,6 @@ public class HidHostService extends ProfileService { return true; } /** * Disables the quiet mode if target device gets connected * * @param device remote device * @param state connection state */ private void updateQuietMode(BluetoothDevice device, int state) { if (state == BluetoothProfile.STATE_CONNECTED && mTargetDevice != null && mTargetDevice.equals(device)) { // Locally initiated connection, move out of quiet mode Log.i(TAG, "updateQuietMode: Move out of quiet mode. device=" + device); mTargetDevice = null; mAdapterService.enable(false); } } @VisibleForTesting static class BluetoothHidHostBinder extends IBluetoothHidHost.Stub implements IProfileServiceBinder { Loading Loading @@ -1482,7 +1463,7 @@ public class HidHostService extends ProfileService { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public boolean okToConnect(BluetoothDevice device) { // Check if this is an incoming connection in Quiet mode. if (mAdapterService.isQuietModeEnabled() && mTargetDevice == null) { if (mAdapterService.isQuietModeEnabled()) { Log.w(TAG, "okToConnect: return false because of quiet mode enabled. device=" + device); return false; } Loading Loading @@ -1510,7 +1491,6 @@ public class HidHostService extends ProfileService { @Override public void dump(StringBuilder sb) { super.dump(sb); println(sb, "mTargetDevice: " + mTargetDevice); println(sb, "mInputDevices:"); mInputDevices.forEach( (k, v) -> sb.append(" ").append(k).append(" : ").append(v).append("\n")); Loading Loading
android/app/src/com/android/bluetooth/hid/HidHostService.java +1 −21 Original line number Diff line number Diff line Loading @@ -109,7 +109,6 @@ public class HidHostService extends ProfileService { private final HidHostNativeInterface mNativeInterface; private boolean mNativeAvailable; private BluetoothDevice mTargetDevice = null; private static final int MESSAGE_CONNECT = 1; private static final int MESSAGE_DISCONNECT = 2; Loading Loading @@ -698,7 +697,6 @@ public class HidHostService extends ProfileService { if (Flags.allowSwitchingHidAndHogp() || connectionAllowed) { updateConnectionState(device, transport, reportedState); } updateQuietMode(device, reportedState); } private void handleMessageDisconnect(Message msg) { Loading Loading @@ -781,23 +779,6 @@ public class HidHostService extends ProfileService { return true; } /** * Disables the quiet mode if target device gets connected * * @param device remote device * @param state connection state */ private void updateQuietMode(BluetoothDevice device, int state) { if (state == BluetoothProfile.STATE_CONNECTED && mTargetDevice != null && mTargetDevice.equals(device)) { // Locally initiated connection, move out of quiet mode Log.i(TAG, "updateQuietMode: Move out of quiet mode. device=" + device); mTargetDevice = null; mAdapterService.enable(false); } } @VisibleForTesting static class BluetoothHidHostBinder extends IBluetoothHidHost.Stub implements IProfileServiceBinder { Loading Loading @@ -1482,7 +1463,7 @@ public class HidHostService extends ProfileService { @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) public boolean okToConnect(BluetoothDevice device) { // Check if this is an incoming connection in Quiet mode. if (mAdapterService.isQuietModeEnabled() && mTargetDevice == null) { if (mAdapterService.isQuietModeEnabled()) { Log.w(TAG, "okToConnect: return false because of quiet mode enabled. device=" + device); return false; } Loading Loading @@ -1510,7 +1491,6 @@ public class HidHostService extends ProfileService { @Override public void dump(StringBuilder sb) { super.dump(sb); println(sb, "mTargetDevice: " + mTargetDevice); println(sb, "mInputDevices:"); mInputDevices.forEach( (k, v) -> sb.append(" ").append(k).append(" : ").append(v).append("\n")); Loading