Don't override the hash code for the channel.
Each channel is uniquely represented by the object itself, so use the hash code to identify it. Using channelPath in the calculation will mess up things - since in Connecting state the channel path is null and when its connected, we will get a different hash code. Change-Id: I6af6c783e18fddbd38344432b8156e000baafb15
This commit is contained in:
@@ -77,16 +77,6 @@ final class BluetoothHealthProfileHandler {
|
||||
mConfig = config;
|
||||
mState = BluetoothHealth.STATE_CHANNEL_DISCONNECTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = 17;
|
||||
result = 31 * result + (mChannelPath == null ? 0 : mChannelPath.hashCode());
|
||||
result = 31 * result + mDevice.hashCode();
|
||||
result = 31 * result + mConfig.hashCode();
|
||||
result = 31 * result + mChannelType;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private final Handler mHandler = new Handler() {
|
||||
|
||||
Reference in New Issue
Block a user