Fix string that will not make field trial parser crash (in debug)

Ironic :( The "field trial guy" constructing a invalid string,
if only there would have been a builder instead...

I tested the code several times...but not with debug build...

Bug: webrtc:13741
Change-Id: If3caad0f5533fc150ffd6a34a89ab84f3f0264aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256979
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36370}
This commit is contained in:
Jonas Oreland
2022-03-29 14:13:06 +02:00
committed by WebRTC LUCI CQ
parent 17481fd031
commit ea0f9a0a19
2 changed files with 8 additions and 7 deletions

View File

@ -193,9 +193,9 @@ public class NetworkMonitorAutoDetect extends BroadcastReceiver implements Netwo
}
private static boolean checkFieldTrial(String fieldTrials, String key, boolean defaultValue) {
if (fieldTrials.contains(key + "/Enabled")) {
if (fieldTrials.contains(key + ":true")) {
return true;
} else if (fieldTrials.contains(key + "/Disabled")) {
} else if (fieldTrials.contains(key + ":false")) {
return false;
}
return defaultValue;