SystemServer: Support deviceSpecificAudioService for ARC
Load device specific audio service for needed devices.
Bug: 119241152
Test: Apply full topic to test Arc audio functionality
Change-Id: Ibc1a7844faf5a6e54acc3342cf603023ada74b92
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 43190ac4..698623b 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -816,6 +816,9 @@
boolean isWatch = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WATCH);
+ boolean isArc = context.getPackageManager().hasSystemFeature(
+ "org.chromium.arc");
+
boolean enableVrService = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE);
@@ -1338,7 +1341,17 @@
}
traceBeginAndSlog("StartAudioService");
- mSystemServiceManager.startService(AudioService.Lifecycle.class);
+ if (!isArc) {
+ mSystemServiceManager.startService(AudioService.Lifecycle.class);
+ } else {
+ String className = context.getResources()
+ .getString(R.string.config_deviceSpecificAudioService);
+ try {
+ mSystemServiceManager.startService(className + "$Lifecycle");
+ } catch (Throwable e) {
+ reportWtf("starting " + className, e);
+ }
+ }
traceEnd();
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_BROADCAST_RADIO)) {