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 bb959ed67a4cb54d58ae272958ababdf0eb6bbea..26ce40755a0ec6d6f639aa39c5beec66294a1360 100644 |
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java |
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java |
@@ -14,8 +14,10 @@ import android.app.Activity; |
import android.content.SharedPreferences; |
import android.content.SharedPreferences.OnSharedPreferenceChangeListener; |
import android.os.Bundle; |
+import android.preference.ListPreference; |
import android.preference.Preference; |
+import org.webrtc.Camera2Enumerator; |
import org.webrtc.voiceengine.WebRtcAudioUtils; |
/** |
@@ -25,6 +27,7 @@ public class SettingsActivity extends Activity |
implements OnSharedPreferenceChangeListener{ |
private SettingsFragment settingsFragment; |
private String keyprefVideoCall; |
+ private String keyprefCamera2; |
private String keyprefResolution; |
private String keyprefFps; |
private String keyprefCaptureQualitySlider; |
@@ -50,6 +53,7 @@ public class SettingsActivity extends Activity |
protected void onCreate(Bundle savedInstanceState) { |
super.onCreate(savedInstanceState); |
keyprefVideoCall = getString(R.string.pref_videocall_key); |
+ keyprefCamera2 = getString(R.string.pref_camera2_key); |
keyprefResolution = getString(R.string.pref_resolution_key); |
keyprefFps = getString(R.string.pref_fps_key); |
keyprefCaptureQualitySlider = getString(R.string.pref_capturequalityslider_key); |
@@ -86,6 +90,7 @@ public class SettingsActivity extends Activity |
settingsFragment.getPreferenceScreen().getSharedPreferences(); |
sharedPreferences.registerOnSharedPreferenceChangeListener(this); |
updateSummaryB(sharedPreferences, keyprefVideoCall); |
+ updateSummaryB(sharedPreferences, keyprefCamera2); |
updateSummary(sharedPreferences, keyprefResolution); |
updateSummary(sharedPreferences, keyprefFps); |
updateSummaryB(sharedPreferences, keyprefCaptureQualitySlider); |
@@ -109,6 +114,14 @@ public class SettingsActivity extends Activity |
updateSummaryB(sharedPreferences, keyPrefDisplayHud); |
updateSummaryB(sharedPreferences, keyPrefTracing); |
+ if (!Camera2Enumerator.isSupported()) { |
+ Preference camera2Preference = |
+ settingsFragment.findPreference(keyprefCamera2); |
+ |
+ camera2Preference.setSummary(getString(R.string.pref_camera2_not_supported)); |
+ camera2Preference.setEnabled(false); |
+ } |
+ |
// Disable forcing WebRTC based AEC so it won't affect our value. |
// Otherwise, if it was enabled, isAcousticEchoCancelerSupported would always return false. |
WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(false); |
@@ -116,7 +129,6 @@ public class SettingsActivity extends Activity |
Preference disableBuiltInAECPreference = |
settingsFragment.findPreference(keyprefDisableBuiltInAEC); |
- |
disableBuiltInAECPreference.setSummary(getString(R.string.pref_built_in_aec_not_available)); |
disableBuiltInAECPreference.setEnabled(false); |
} |
@@ -145,6 +157,7 @@ public class SettingsActivity extends Activity |
|| key.equals(keyprefStartAudioBitrateValue)) { |
updateSummaryBitrate(sharedPreferences, key); |
} else if (key.equals(keyprefVideoCall) |
+ || key.equals(keyprefCamera2) |
|| key.equals(keyPrefTracing) |
|| key.equals(keyprefCaptureQualitySlider) |
|| key.equals(keyprefHwCodec) |