Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2099,4 +2099,7 @@ <!-- Keyguard component --> <string name="config_keyguardComponent" translatable="false">com.android.systemui/com.android.systemui.keyguard.KeyguardService</string> <!-- This config is used to force VoiceInteractionService to start on certain low ram devices. --> <bool name="config_forceEnableVoiceInteractionService">false</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ <java-symbol type="bool" name="config_enableScreenshotChord" /> <java-symbol type="bool" name="config_bluetooth_default_profiles" /> <java-symbol type="bool" name="config_enableWifiDisplay" /> <java-symbol type="bool" name="config_forceEnableVoiceInteractionService" /> <java-symbol type="bool" name="config_useDevInputEventForAudioJack" /> <java-symbol type="bool" name="config_safe_media_volume_enabled" /> <java-symbol type="bool" name="config_camera_sound_forced" /> Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +19 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.hardware.soundtrigger.IRecognitionStatusCallback; import android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel; Loading Loading @@ -79,6 +81,7 @@ public class VoiceInteractionManagerService extends SystemService { mResolver = context.getContentResolver(); mDbHelper = new DatabaseHelper(context); mSoundTriggerHelper = new SoundTriggerHelper(context); mServiceStub = new VoiceInteractionManagerServiceStub(); } @Override Loading @@ -104,8 +107,7 @@ public class VoiceInteractionManagerService extends SystemService { } // implementation entry point and binder service private final VoiceInteractionManagerServiceStub mServiceStub = new VoiceInteractionManagerServiceStub(); private final VoiceInteractionManagerServiceStub mServiceStub; class VoiceInteractionManagerServiceStub extends IVoiceInteractionManagerService.Stub { Loading @@ -113,6 +115,11 @@ public class VoiceInteractionManagerService extends SystemService { private boolean mSafeMode; private int mCurUser; private final boolean mEnableService; VoiceInteractionManagerServiceStub() { mEnableService = shouldEnableService(mContext.getResources()); } @Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) Loading @@ -136,8 +143,7 @@ public class VoiceInteractionManagerService extends SystemService { Settings.Secure.VOICE_INTERACTION_SERVICE, userHandle); ComponentName curRecognizer = getCurRecognizer(userHandle); VoiceInteractionServiceInfo curInteractorInfo = null; if (curInteractorStr == null && curRecognizer != null && !ActivityManager.isLowRamDeviceStatic()) { if (curInteractorStr == null && curRecognizer != null && mEnableService) { // If there is no interactor setting, that means we are upgrading // from an older platform version. If the current recognizer is not // set or matches the preferred recognizer, then we want to upgrade Loading @@ -155,7 +161,7 @@ public class VoiceInteractionManagerService extends SystemService { // If we are on a svelte device, make sure an interactor is not currently // enabled; if it is, turn it off. if (ActivityManager.isLowRamDeviceStatic() && curInteractorStr != null) { if (!mEnableService && curInteractorStr != null) { if (!TextUtils.isEmpty(curInteractorStr)) { setCurInteractor(null, userHandle); curInteractorStr = ""; Loading Loading @@ -184,7 +190,7 @@ public class VoiceInteractionManagerService extends SystemService { } // Initializing settings, look for an interactor first (but only on non-svelte). if (curInteractorInfo == null && !ActivityManager.isLowRamDeviceStatic()) { if (curInteractorInfo == null && mEnableService) { curInteractorInfo = findAvailInteractor(userHandle, null); } Loading @@ -210,6 +216,12 @@ public class VoiceInteractionManagerService extends SystemService { } } private boolean shouldEnableService(Resources res) { // VoiceInteractionService should not be enabled on low ram devices unless it has the config flag. return !ActivityManager.isLowRamDeviceStatic() || res.getBoolean(com.android.internal.R.bool.config_forceEnableVoiceInteractionService); } public void systemRunning(boolean safeMode) { mSafeMode = safeMode; Loading Loading @@ -659,6 +671,7 @@ public class VoiceInteractionManagerService extends SystemService { } synchronized (this) { pw.println("VOICE INTERACTION MANAGER (dumpsys voiceinteraction)\n"); pw.println(" mEnableService: " + mEnableService); if (mImpl == null) { pw.println(" (No active implementation)"); return; Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -2099,4 +2099,7 @@ <!-- Keyguard component --> <string name="config_keyguardComponent" translatable="false">com.android.systemui/com.android.systemui.keyguard.KeyguardService</string> <!-- This config is used to force VoiceInteractionService to start on certain low ram devices. --> <bool name="config_forceEnableVoiceInteractionService">false</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ <java-symbol type="bool" name="config_enableScreenshotChord" /> <java-symbol type="bool" name="config_bluetooth_default_profiles" /> <java-symbol type="bool" name="config_enableWifiDisplay" /> <java-symbol type="bool" name="config_forceEnableVoiceInteractionService" /> <java-symbol type="bool" name="config_useDevInputEventForAudioJack" /> <java-symbol type="bool" name="config_safe_media_volume_enabled" /> <java-symbol type="bool" name="config_camera_sound_forced" /> Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +19 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.hardware.soundtrigger.IRecognitionStatusCallback; import android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel; Loading Loading @@ -79,6 +81,7 @@ public class VoiceInteractionManagerService extends SystemService { mResolver = context.getContentResolver(); mDbHelper = new DatabaseHelper(context); mSoundTriggerHelper = new SoundTriggerHelper(context); mServiceStub = new VoiceInteractionManagerServiceStub(); } @Override Loading @@ -104,8 +107,7 @@ public class VoiceInteractionManagerService extends SystemService { } // implementation entry point and binder service private final VoiceInteractionManagerServiceStub mServiceStub = new VoiceInteractionManagerServiceStub(); private final VoiceInteractionManagerServiceStub mServiceStub; class VoiceInteractionManagerServiceStub extends IVoiceInteractionManagerService.Stub { Loading @@ -113,6 +115,11 @@ public class VoiceInteractionManagerService extends SystemService { private boolean mSafeMode; private int mCurUser; private final boolean mEnableService; VoiceInteractionManagerServiceStub() { mEnableService = shouldEnableService(mContext.getResources()); } @Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) Loading @@ -136,8 +143,7 @@ public class VoiceInteractionManagerService extends SystemService { Settings.Secure.VOICE_INTERACTION_SERVICE, userHandle); ComponentName curRecognizer = getCurRecognizer(userHandle); VoiceInteractionServiceInfo curInteractorInfo = null; if (curInteractorStr == null && curRecognizer != null && !ActivityManager.isLowRamDeviceStatic()) { if (curInteractorStr == null && curRecognizer != null && mEnableService) { // If there is no interactor setting, that means we are upgrading // from an older platform version. If the current recognizer is not // set or matches the preferred recognizer, then we want to upgrade Loading @@ -155,7 +161,7 @@ public class VoiceInteractionManagerService extends SystemService { // If we are on a svelte device, make sure an interactor is not currently // enabled; if it is, turn it off. if (ActivityManager.isLowRamDeviceStatic() && curInteractorStr != null) { if (!mEnableService && curInteractorStr != null) { if (!TextUtils.isEmpty(curInteractorStr)) { setCurInteractor(null, userHandle); curInteractorStr = ""; Loading Loading @@ -184,7 +190,7 @@ public class VoiceInteractionManagerService extends SystemService { } // Initializing settings, look for an interactor first (but only on non-svelte). if (curInteractorInfo == null && !ActivityManager.isLowRamDeviceStatic()) { if (curInteractorInfo == null && mEnableService) { curInteractorInfo = findAvailInteractor(userHandle, null); } Loading @@ -210,6 +216,12 @@ public class VoiceInteractionManagerService extends SystemService { } } private boolean shouldEnableService(Resources res) { // VoiceInteractionService should not be enabled on low ram devices unless it has the config flag. return !ActivityManager.isLowRamDeviceStatic() || res.getBoolean(com.android.internal.R.bool.config_forceEnableVoiceInteractionService); } public void systemRunning(boolean safeMode) { mSafeMode = safeMode; Loading Loading @@ -659,6 +671,7 @@ public class VoiceInteractionManagerService extends SystemService { } synchronized (this) { pw.println("VOICE INTERACTION MANAGER (dumpsys voiceinteraction)\n"); pw.println(" mEnableService: " + mEnableService); if (mImpl == null) { pw.println(" (No active implementation)"); return; Loading