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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java

Issue 2377003002: Format all Java in WebRTC. (Closed)
Patch Set: Manual changes. Created 4 years, 3 months 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: webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
index 7f8daad1386ca80bc48002e5243628a8af3765ed..9606750394c098290465ef37a98306d1668407c6 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java
@@ -23,8 +23,7 @@ import org.webrtc.voiceengine.WebRtcAudioUtils;
/**
* Settings activity for AppRTC.
*/
-public class SettingsActivity extends Activity
- implements OnSharedPreferenceChangeListener{
+public class SettingsActivity extends Activity implements OnSharedPreferenceChangeListener {
private SettingsFragment settingsFragment;
private String keyprefVideoCall;
private String keyprefCamera2;
@@ -85,7 +84,8 @@ public class SettingsActivity extends Activity
// Display the fragment as the main content.
settingsFragment = new SettingsFragment();
- getFragmentManager().beginTransaction()
+ getFragmentManager()
+ .beginTransaction()
.replace(android.R.id.content, settingsFragment)
.commit();
}
@@ -127,8 +127,7 @@ public class SettingsActivity extends Activity
updateSummaryB(sharedPreferences, keyPrefTracing);
if (!Camera2Enumerator.isSupported(this)) {
- Preference camera2Preference =
- settingsFragment.findPreference(keyprefCamera2);
+ Preference camera2Preference = settingsFragment.findPreference(keyprefCamera2);
camera2Preference.setSummary(getString(R.string.pref_camera2_not_supported));
camera2Preference.setEnabled(false);
@@ -173,33 +172,22 @@ public class SettingsActivity extends Activity
}
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
- String key) {
- if (key.equals(keyprefResolution)
- || key.equals(keyprefFps)
- || key.equals(keyprefMaxVideoBitrateType)
- || key.equals(keyPrefVideoCodec)
- || key.equals(keyprefStartAudioBitrateType)
- || key.equals(keyPrefAudioCodec)
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
magjed_webrtc 2016/09/28 13:45:05 revert
+ if (key.equals(keyprefResolution) || key.equals(keyprefFps)
+ || key.equals(keyprefMaxVideoBitrateType) || key.equals(keyPrefVideoCodec)
+ || key.equals(keyprefStartAudioBitrateType) || key.equals(keyPrefAudioCodec)
|| key.equals(keyPrefRoomServerUrl)) {
updateSummary(sharedPreferences, key);
} else if (key.equals(keyprefMaxVideoBitrateValue)
|| key.equals(keyprefStartAudioBitrateValue)) {
updateSummaryBitrate(sharedPreferences, key);
- } else if (key.equals(keyprefVideoCall)
- || key.equals(keyprefCamera2)
- || key.equals(keyPrefTracing)
- || key.equals(keyprefCaptureQualitySlider)
- || key.equals(keyprefHwCodec)
- || key.equals(keyprefCaptureToTexture)
- || key.equals(keyprefNoAudioProcessing)
- || key.equals(keyprefAecDump)
- || key.equals(keyprefOpenSLES)
- || key.equals(keyprefDisableBuiltInAEC)
- || key.equals(keyprefDisableBuiltInAGC)
- || key.equals(keyprefDisableBuiltInNS)
- || key.equals(keyprefEnableLevelControl)
- || key.equals(keyPrefDisplayHud)) {
+ } else if (key.equals(keyprefVideoCall) || key.equals(keyprefCamera2)
+ || key.equals(keyPrefTracing) || key.equals(keyprefCaptureQualitySlider)
+ || key.equals(keyprefHwCodec) || key.equals(keyprefCaptureToTexture)
+ || key.equals(keyprefNoAudioProcessing) || key.equals(keyprefAecDump)
+ || key.equals(keyprefOpenSLES) || key.equals(keyprefDisableBuiltInAEC)
+ || key.equals(keyprefDisableBuiltInAGC) || key.equals(keyprefDisableBuiltInNS)
+ || key.equals(keyprefEnableLevelControl) || key.equals(keyPrefDisplayHud)) {
updateSummaryB(sharedPreferences, key);
} else if (key.equals(keyprefSpeakerphone)) {
updateSummaryList(sharedPreferences, key);
@@ -218,8 +206,7 @@ public class SettingsActivity extends Activity
updatedPref.setSummary(sharedPreferences.getString(key, ""));
}
- private void updateSummaryBitrate(
- SharedPreferences sharedPreferences, String key) {
+ private void updateSummaryBitrate(SharedPreferences sharedPreferences, String key) {
Preference updatedPref = settingsFragment.findPreference(key);
updatedPref.setSummary(sharedPreferences.getString(key, "") + " kbps");
}
@@ -227,8 +214,8 @@ public class SettingsActivity extends Activity
private void updateSummaryB(SharedPreferences sharedPreferences, String key) {
Preference updatedPref = settingsFragment.findPreference(key);
updatedPref.setSummary(sharedPreferences.getBoolean(key, true)
- ? getString(R.string.pref_value_enabled)
- : getString(R.string.pref_value_disabled));
+ ? getString(R.string.pref_value_enabled)
+ : getString(R.string.pref_value_disabled));
}
private void updateSummaryList(SharedPreferences sharedPreferences, String key) {
@@ -240,8 +227,8 @@ public class SettingsActivity extends Activity
Preference bitratePreferenceValue =
settingsFragment.findPreference(keyprefMaxVideoBitrateValue);
String bitrateTypeDefault = getString(R.string.pref_maxvideobitrate_default);
- String bitrateType = sharedPreferences.getString(
- keyprefMaxVideoBitrateType, bitrateTypeDefault);
+ String bitrateType =
+ sharedPreferences.getString(keyprefMaxVideoBitrateType, bitrateTypeDefault);
if (bitrateType.equals(bitrateTypeDefault)) {
bitratePreferenceValue.setEnabled(false);
} else {
@@ -253,8 +240,8 @@ public class SettingsActivity extends Activity
Preference bitratePreferenceValue =
settingsFragment.findPreference(keyprefStartAudioBitrateValue);
String bitrateTypeDefault = getString(R.string.pref_startaudiobitrate_default);
- String bitrateType = sharedPreferences.getString(
- keyprefStartAudioBitrateType, bitrateTypeDefault);
+ String bitrateType =
+ sharedPreferences.getString(keyprefStartAudioBitrateType, bitrateTypeDefault);
if (bitrateType.equals(bitrateTypeDefault)) {
bitratePreferenceValue.setEnabled(false);
} else {

Powered by Google App Engine
This is Rietveld 408576698