diff options
author | Jack He <siyuanh@google.com> | 2017-08-22 21:21:23 -0700 |
---|---|---|
committer | Jack He <siyuanh@google.com> | 2017-08-24 19:09:58 +0000 |
commit | 9e045d26d0128826b40520f523307d8d16473779 (patch) | |
tree | 8299c300f3b4dbc2a5360c3319ac41bf1b389e55 /framework/java/android/bluetooth/BluetoothCodecConfig.java | |
parent | 910201beb0bde1dcf6b33e4ec5d1eb60042419d8 (diff) |
Fix checkstyle errors (2/2)
* Manual style corrections with IDE assistance
* Variable name refactors are done through IDE
* Corrected general style errors such as:
- "final private var" -> "private final var"
- "&&", "+", "||" should not be at the end of line
- Non-static private variable should be like "mVar"
- Private static variable should be like "sVar"
- Code file should always end with newline
- Inherited methods should be annotated with @Override
and no @hide tags
- Public methods should always have a JavaDoc entry
- "int[] array" is preferred over "int array[]"
- private methods should be accessed without "this."
when there is no name collisions.
- "boolean ? true : false" -> boolean
- "boolean ? false : true" -> !boolean
- "boolean == true" OR "boolean != false" -> boolean
- "boolean != true" OR "boolean == false" -> !boolean
Bug: 63596319
Test: make checkbuild, no functional changes
Change-Id: Iabdc2be912a32dd63a53213d175cf1bfef268ccd
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothCodecConfig.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothCodecConfig.java | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/framework/java/android/bluetooth/BluetoothCodecConfig.java b/framework/java/android/bluetooth/BluetoothCodecConfig.java index 1e463f7baf..e3a6e06472 100644 --- a/framework/java/android/bluetooth/BluetoothCodecConfig.java +++ b/framework/java/android/bluetooth/BluetoothCodecConfig.java @@ -92,15 +92,15 @@ public final class BluetoothCodecConfig implements Parcelable { public boolean equals(Object o) { if (o instanceof BluetoothCodecConfig) { BluetoothCodecConfig other = (BluetoothCodecConfig) o; - return (other.mCodecType == mCodecType && - other.mCodecPriority == mCodecPriority && - other.mSampleRate == mSampleRate && - other.mBitsPerSample == mBitsPerSample && - other.mChannelMode == mChannelMode && - other.mCodecSpecific1 == mCodecSpecific1 && - other.mCodecSpecific2 == mCodecSpecific2 && - other.mCodecSpecific3 == mCodecSpecific3 && - other.mCodecSpecific4 == mCodecSpecific4); + return (other.mCodecType == mCodecType + && other.mCodecPriority == mCodecPriority + && other.mSampleRate == mSampleRate + && other.mBitsPerSample == mBitsPerSample + && other.mChannelMode == mChannelMode + && other.mCodecSpecific1 == mCodecSpecific1 + && other.mCodecSpecific2 == mCodecSpecific2 + && other.mCodecSpecific3 == mCodecSpecific3 + && other.mCodecSpecific4 == mCodecSpecific4); } return false; } @@ -118,9 +118,9 @@ public final class BluetoothCodecConfig implements Parcelable { * @return true if the object contains valid codec configuration, otherwise false. */ public boolean isValid() { - return (mSampleRate != SAMPLE_RATE_NONE) && - (mBitsPerSample != BITS_PER_SAMPLE_NONE) && - (mChannelMode != CHANNEL_MODE_NONE); + return (mSampleRate != SAMPLE_RATE_NONE) + && (mBitsPerSample != BITS_PER_SAMPLE_NONE) + && (mChannelMode != CHANNEL_MODE_NONE); } /** @@ -188,21 +188,22 @@ public final class BluetoothCodecConfig implements Parcelable { channelModeStr = appendCapabilityToString(channelModeStr, "STEREO"); } - return "{codecName:" + getCodecName() + - ",mCodecType:" + mCodecType + - ",mCodecPriority:" + mCodecPriority + - ",mSampleRate:" + String.format("0x%x", mSampleRate) + - "(" + sampleRateStr + ")" + - ",mBitsPerSample:" + String.format("0x%x", mBitsPerSample) + - "(" + bitsPerSampleStr + ")" + - ",mChannelMode:" + String.format("0x%x", mChannelMode) + - "(" + channelModeStr + ")" + - ",mCodecSpecific1:" + mCodecSpecific1 + - ",mCodecSpecific2:" + mCodecSpecific2 + - ",mCodecSpecific3:" + mCodecSpecific3 + - ",mCodecSpecific4:" + mCodecSpecific4 + "}"; + return "{codecName:" + getCodecName() + + ",mCodecType:" + mCodecType + + ",mCodecPriority:" + mCodecPriority + + ",mSampleRate:" + String.format("0x%x", mSampleRate) + + "(" + sampleRateStr + ")" + + ",mBitsPerSample:" + String.format("0x%x", mBitsPerSample) + + "(" + bitsPerSampleStr + ")" + + ",mChannelMode:" + String.format("0x%x", mChannelMode) + + "(" + channelModeStr + ")" + + ",mCodecSpecific1:" + mCodecSpecific1 + + ",mCodecSpecific2:" + mCodecSpecific2 + + ",mCodecSpecific3:" + mCodecSpecific3 + + ",mCodecSpecific4:" + mCodecSpecific4 + "}"; } + @Override public int describeContents() { return 0; } @@ -231,6 +232,7 @@ public final class BluetoothCodecConfig implements Parcelable { } }; + @Override public void writeToParcel(Parcel out, int flags) { out.writeInt(mCodecType); out.writeInt(mCodecPriority); @@ -396,8 +398,8 @@ public final class BluetoothCodecConfig implements Parcelable { * @return true if the audio feeding parameters are same, otherwise false */ public boolean sameAudioFeedingParameters(BluetoothCodecConfig other) { - return (other != null && other.mSampleRate == mSampleRate && - other.mBitsPerSample == mBitsPerSample && - other.mChannelMode == mChannelMode); + return (other != null && other.mSampleRate == mSampleRate + && other.mBitsPerSample == mBitsPerSample + && other.mChannelMode == mChannelMode); } } |