disable SoundTriggerService in safe mode

Bug: 150569186
Test: confirm `dumpsys voiceinteraction` shows no active service
&& confirm `dumpsys soundtrigger_middleware` shows no API calls.

Change-Id: I6b5879c662826e86a6f41f3c3aea444f0674f24c
This commit is contained in:
Nicholas Ambur
2020-03-23 15:42:21 -07:00
parent 1e03bc0539
commit 78a22682fb

View File

@@ -207,7 +207,13 @@ public class SoundTriggerService extends SystemService {
@Override
public void onBootPhase(int phase) {
if (PHASE_SYSTEM_SERVICES_READY == phase) {
Slog.d(TAG, "onBootPhase: " + phase + " : " + isSafeMode());
if (PHASE_DEVICE_SPECIFIC_SERVICES_READY == phase) {
if (isSafeMode()) {
Slog.w(TAG, "not enabling SoundTriggerService in safe mode");
return;
}
initSoundTriggerHelper();
mLocalSoundTriggerService.setSoundTriggerHelper(mSoundTriggerHelper);
} else if (PHASE_THIRD_PARTY_APPS_CAN_START == phase) {