AppRTCDemoActivity: Add a config CheckBox for enabling/disabling CPU overuse adaptation. (re-land)

This CL was incorrectly reverted in r7647 by the libjingle sync bot.

TBR=kjellander@webrtc.org
BUG=

Review URL: https://webrtc-codereview.appspot.com/32489004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7717 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrika@webrtc.org
2014-11-18 13:22:28 +00:00
parent c56814fb2d
commit 2176db343c
5 changed files with 37 additions and 8 deletions

View File

@@ -73,6 +73,7 @@ public class ConnectActivity extends Activity {
private String keyprefUrl;
private String keyprefResolution;
private String keyprefFps;
private String keyprefCpuUsageDetection;
private String keyprefRoom;
private String keyprefRoomList;
private ArrayList<String> roomList;
@@ -88,6 +89,7 @@ public class ConnectActivity extends Activity {
keyprefUrl = getString(R.string.pref_url_key);
keyprefResolution = getString(R.string.pref_resolution_key);
keyprefFps = getString(R.string.pref_fps_key);
keyprefCpuUsageDetection = getString(R.string.pref_cpu_usage_detection_key);
keyprefRoom = getString(R.string.pref_room_key);
keyprefRoomList = getString(R.string.pref_room_list_key);
@@ -252,6 +254,14 @@ public class ConnectActivity extends Activity {
url += "&hd=true";
}
}
// Test if CpuOveruseDetection should be disabled. By default is on.
boolean cpuOveruseDetection = sharedPref.getBoolean(
keyprefCpuUsageDetection,
Boolean.valueOf(
getString(R.string.pref_cpu_usage_detection_default)));
if (!cpuOveruseDetection) {
url += "&googCpuOveruseDetection=false";
}
// TODO(kjellander): Add support for custom parameters to the URL.
connectToRoom(url);
}