summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Les Lee <lesl@google.com> 2024-12-27 20:54:58 +0000
committer Les Lee <lesl@google.com> 2025-02-19 18:55:34 +0000
commit9e8107b9933dc17a5594437f3a762e98c5f88ee5 (patch)
tree1c81854927bb7067cd839428afa1b50dcc18d912
parent793efd4661246e475ee6494591d0b892e9be266c (diff)
wifi: Checks telephony flag & overlay when enabling wifi voip detection
To prevent crashes in the telephony system, Wi-Fi's VoIP detection now checks a telephony flag. This ensures the module only activates when the 'pass_copied_call_state_list' flag is enabled, which addresses the original crash issue. To prevent OEMs don't take telephony fix, add a new overlay configuration with default disbled. Flag: com.android.internal.telephony.flags.pass_copied_call_state_list Bug: 379126049 Test: Build pass Change-Id: Icbccfef2368182296360e26f367bda9f0f53b1e5
-rw-r--r--framework/jarjar-rules.txt4
-rw-r--r--service/Android.bp1
-rw-r--r--service/ServiceWifiResources/res/values/config.xml4
-rw-r--r--service/ServiceWifiResources/res/values/overlayable.xml1
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java5
5 files changed, 14 insertions, 1 deletions
diff --git a/framework/jarjar-rules.txt b/framework/jarjar-rules.txt
index dbd5811d7d..c842b0bb26 100644
--- a/framework/jarjar-rules.txt
+++ b/framework/jarjar-rules.txt
@@ -104,6 +104,10 @@ rule android.security.*FeatureFlags* com.android.wifi.x.@0
rule android.security.FeatureFlags* com.android.wifi.x.@0
rule android.security.Flags com.android.wifi.x.@0
+rule com.android.internal.telephony.flags.*FeatureFlags* com.android.wifi.x.@0
+rule com.android.internal.telephony.flags.FeatureFlags* com.android.wifi.x.@0
+rule com.android.internal.telephony.flags.Flags com.android.wifi.x.@0
+
# Use our statically linked bouncy castle library
rule org.bouncycastle.** com.android.wifi.x.@0
# Use our statically linked protobuf library
diff --git a/service/Android.bp b/service/Android.bp
index b3f5ca1a50..520ef7b230 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -126,6 +126,7 @@ java_library {
"com.android.net.flags-aconfig-java-export",
"android.net.wifi.flags-aconfig-java",
"android.security.flags-aconfig-java-export",
+ "telephony_flags_core_java_exported_lib",
"net-utils-service-wifi",
],
apex_available: ["com.android.wifi"],
diff --git a/service/ServiceWifiResources/res/values/config.xml b/service/ServiceWifiResources/res/values/config.xml
index 5390b48e86..dff9afe1fb 100644
--- a/service/ServiceWifiResources/res/values/config.xml
+++ b/service/ServiceWifiResources/res/values/config.xml
@@ -1415,4 +1415,8 @@
<!-- Boolean indicating whether to use the common nl80211 implementation of the WiFi Hal. This
will be used instead of the AIDL or HIDL implementation if enabled. -->
<bool translatable="false" name="config_wifiNl80211HalEnabled">false</bool>
+
+ <!-- Boolean indicating whether to use wifi VoIP detection module to detect VoIP over Wi-FI to
+ ehance Wi-Fi VoIP quality -->
+ <bool translatable="false" name="config_wifiVoipDetectionEnabled">false</bool>
</resources>
diff --git a/service/ServiceWifiResources/res/values/overlayable.xml b/service/ServiceWifiResources/res/values/overlayable.xml
index 7a94faa9b4..83967ed4c2 100644
--- a/service/ServiceWifiResources/res/values/overlayable.xml
+++ b/service/ServiceWifiResources/res/values/overlayable.xml
@@ -356,6 +356,7 @@
<item type="bool" name="config_wifiRsnOverridingEnabled" />
<item type="bool" name="config_wifi_subsystem_restart_bugreport_enabled" />
<item type="bool" name="config_wifiNl80211HalEnabled" />
+ <item type="bool" name="config_wifiVoipDetectionEnabled" />
<!-- Params from config.xml that can be overlayed -->
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index 801b52cebe..7cb4948bbd 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -54,6 +54,7 @@ import android.util.Log;
import androidx.annotation.Keep;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.telephony.flags.Flags;
import com.android.modules.utils.BackgroundThread;
import com.android.modules.utils.build.SdkLevel;
import com.android.server.wifi.aware.WifiAwareMetrics;
@@ -631,7 +632,9 @@ public class WifiInjector {
mTwtManager = new TwtManager(this, mCmiMonitor, mWifiNative, mWifiHandler, mClock,
WifiTwtSession.MAX_TWT_SESSIONS, 1);
mBackupRestoreController = new BackupRestoreController(mWifiSettingsBackupRestore, mClock);
- if (mFeatureFlags.voipDetectionBugfix() && SdkLevel.isAtLeastV()) {
+ if (mFeatureFlags.voipDetectionBugfix() && SdkLevel.isAtLeastV()
+ && Flags.passCopiedCallStateList() && mContext.getResources().getBoolean(
+ R.bool.config_wifiVoipDetectionEnabled)) {
mWifiVoipDetector = new WifiVoipDetector(mContext, mWifiHandler, this,
mWifiCarrierInfoManager);
} else {