Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java

Issue 744453002: Fix a bunch of Java Checkstyle issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NeedsBraces to info Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
diff --git a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
index da436624e8707edf023300a9ad21be36bb5b60e5..4a6f4ad30eaaf1ac8c45b09fbe4b0bfd7dc75041 100644
--- a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
+++ b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
@@ -310,8 +310,8 @@ class AudioManagerAndroid {
// The MODIFY_AUDIO_SETTINGS permission is required to allow an
// application to modify global audio settings.
if (!mHasModifyAudioSettingsPermission) {
- Log.w(TAG, "MODIFY_AUDIO_SETTINGS is missing => client will run " +
- "with reduced functionality");
+ Log.w(TAG, "MODIFY_AUDIO_SETTINGS is missing => client will run "
+ + "with reduced functionality");
return;
}
@@ -460,8 +460,8 @@ class AudioManagerAndroid {
if (runningOnJellyBeanMR1OrHigher()) {
String sampleRateString = mAudioManager.getProperty(
AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
- return (sampleRateString == null ?
- DEFAULT_SAMPLING_RATE : Integer.parseInt(sampleRateString));
+ return sampleRateString == null
+ ? DEFAULT_SAMPLING_RATE : Integer.parseInt(sampleRateString);
} else {
return DEFAULT_SAMPLING_RATE;
}
@@ -517,8 +517,8 @@ class AudioManagerAndroid {
private int getAudioLowLatencyOutputFrameSize() {
String framesPerBuffer =
mAudioManager.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);
- return (framesPerBuffer == null ?
- DEFAULT_FRAME_PER_BUFFER : Integer.parseInt(framesPerBuffer));
+ return framesPerBuffer == null
+ ? DEFAULT_FRAME_PER_BUFFER : Integer.parseInt(framesPerBuffer);
}
@CalledByNative
@@ -680,8 +680,8 @@ class AudioManagerAndroid {
// headset and handsfree profile is connected.
// TODO(henrika): it is possible that btAdapter.isEnabled() is
// redundant. It might be sufficient to only check the profile state.
- return btAdapter.isEnabled() && profileConnectionState ==
- android.bluetooth.BluetoothProfile.STATE_CONNECTED;
+ return btAdapter.isEnabled()
+ && profileConnectionState == android.bluetooth.BluetoothProfile.STATE_CONNECTED;
}
/**
@@ -705,11 +705,11 @@ class AudioManagerAndroid {
if (DEBUG) {
int microphone = intent.getIntExtra("microphone", HAS_NO_MIC);
String name = intent.getStringExtra("name");
- logd("BroadcastReceiver.onReceive: a=" + intent.getAction() +
- ", s=" + state +
- ", m=" + microphone +
- ", n=" + name +
- ", sb=" + isInitialStickyBroadcast());
+ logd("BroadcastReceiver.onReceive: a=" + intent.getAction()
+ + ", s=" + state
+ + ", m=" + microphone
+ + ", n=" + name
+ + ", sb=" + isInitialStickyBroadcast());
}
switch (state) {
case STATE_UNPLUGGED:
@@ -776,9 +776,9 @@ class AudioManagerAndroid {
android.bluetooth.BluetoothHeadset.EXTRA_STATE,
android.bluetooth.BluetoothHeadset.STATE_DISCONNECTED);
if (DEBUG) {
- logd("BroadcastReceiver.onReceive: a=" + intent.getAction() +
- ", s=" + profileState +
- ", sb=" + isInitialStickyBroadcast());
+ logd("BroadcastReceiver.onReceive: a=" + intent.getAction()
+ + ", s=" + profileState
+ + ", sb=" + isInitialStickyBroadcast());
}
switch (profileState) {
@@ -842,9 +842,9 @@ class AudioManagerAndroid {
AudioManager.EXTRA_SCO_AUDIO_STATE,
AudioManager.SCO_AUDIO_STATE_DISCONNECTED);
if (DEBUG) {
- logd("BroadcastReceiver.onReceive: a=" + intent.getAction() +
- ", s=" + state +
- ", sb=" + isInitialStickyBroadcast());
+ logd("BroadcastReceiver.onReceive: a=" + intent.getAction()
+ + ", s=" + state
+ + ", sb=" + isInitialStickyBroadcast());
}
switch (state) {
@@ -879,8 +879,8 @@ class AudioManagerAndroid {
if (!mHasBluetoothPermission) {
return;
}
- if (mBluetoothScoState == STATE_BLUETOOTH_SCO_ON ||
- mBluetoothScoState == STATE_BLUETOOTH_SCO_TURNING_ON) {
+ if (mBluetoothScoState == STATE_BLUETOOTH_SCO_ON
+ || mBluetoothScoState == STATE_BLUETOOTH_SCO_TURNING_ON) {
// Unable to turn on BT in this state.
return;
}
@@ -902,8 +902,8 @@ class AudioManagerAndroid {
if (!mHasBluetoothPermission) {
return;
}
- if (mBluetoothScoState != STATE_BLUETOOTH_SCO_ON &&
- mBluetoothScoState != STATE_BLUETOOTH_SCO_TURNING_ON) {
+ if (mBluetoothScoState != STATE_BLUETOOTH_SCO_ON
+ && mBluetoothScoState != STATE_BLUETOOTH_SCO_TURNING_ON) {
// No need to turn off BT in this state.
return;
}
@@ -1010,8 +1010,7 @@ class AudioManagerAndroid {
private static int getNumOfAudioDevices(boolean[] devices) {
int count = 0;
for (int i = 0; i < DEVICE_COUNT; ++i) {
- if (devices[i])
- ++count;
+ if (devices[i]) ++count;
}
return count;
}
@@ -1030,24 +1029,24 @@ class AudioManagerAndroid {
devices.add(DEVICE_NAMES[i]);
}
if (DEBUG) {
- logd("reportUpdate: requested=" + mRequestedAudioDevice +
- ", btSco=" + mBluetoothScoState +
- ", devices=" + devices);
+ logd("reportUpdate: requested=" + mRequestedAudioDevice
+ + ", btSco=" + mBluetoothScoState
+ + ", devices=" + devices);
}
}
}
/** Information about the current build, taken from system properties. */
private void logDeviceInfo() {
- logd("Android SDK: " + Build.VERSION.SDK_INT + ", " +
- "Release: " + Build.VERSION.RELEASE + ", " +
- "Brand: " + Build.BRAND + ", " +
- "Device: " + Build.DEVICE + ", " +
- "Id: " + Build.ID + ", " +
- "Hardware: " + Build.HARDWARE + ", " +
- "Manufacturer: " + Build.MANUFACTURER + ", " +
- "Model: " + Build.MODEL + ", " +
- "Product: " + Build.PRODUCT);
+ logd("Android SDK: " + Build.VERSION.SDK_INT + ", "
+ + "Release: " + Build.VERSION.RELEASE + ", "
+ + "Brand: " + Build.BRAND + ", "
+ + "Device: " + Build.DEVICE + ", "
+ + "Id: " + Build.ID + ", "
+ + "Hardware: " + Build.HARDWARE + ", "
+ + "Manufacturer: " + Build.MANUFACTURER + ", "
+ + "Model: " + Build.MODEL + ", "
+ + "Product: " + Build.PRODUCT);
}
/** Trivial helper method for debug logging */

Powered by Google App Engine
This is Rietveld 408576698