Fix for wrong ringtone when using VoWiFi
If operator goes into flight mode and tries to make call via WiFi, then
property "gsm.operator.iso-country" is read as empty string and in
consequence mRegion is set as CEPT instead of specific country-area
name (e.g. instead of UNITED_KINGDOM).
We may check additional property that does not depend on network
operator: "gsm.sim.operator.iso-country" so that we could set mRegion
properly.
Bug: 29494265
Change-Id: Ia374f73159e005431fb0ad9bf8b5dbb3d9a3e294
diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp
index 8791a45..34445e0 100644
--- a/media/libmedia/ToneGenerator.cpp
+++ b/media/libmedia/ToneGenerator.cpp
@@ -831,7 +831,9 @@
mProcessSize = (mSamplingRate * 20) / 1000;
char value[PROPERTY_VALUE_MAX];
- property_get("gsm.operator.iso-country", value, "");
+ if (property_get("gsm.operator.iso-country", value, "") == 0) {
+ property_get("gsm.sim.operator.iso-country", value, "");
+ }
if (strstr(value, "us") != NULL ||
strstr(value, "ca") != NULL) {
mRegion = ANSI;