Merge "Revert "Enable VoiceInteractionService on watch." DO NOT MERGE ANYWHERE" into lmp-mr1-modular-dev
This commit is contained in:
@@ -2100,9 +2100,6 @@
|
|||||||
<!-- Keyguard component -->
|
<!-- Keyguard component -->
|
||||||
<string name="config_keyguardComponent" translatable="false">com.android.systemui/com.android.systemui.keyguard.KeyguardService</string>
|
<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>
|
|
||||||
|
|
||||||
<!-- This config is ued to determine whether animations are allowed in low power mode. -->
|
<!-- This config is ued to determine whether animations are allowed in low power mode. -->
|
||||||
<bool name="config_allowAnimationsInLowPowerMode">false</bool>
|
<bool name="config_allowAnimationsInLowPowerMode">false</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -281,7 +281,6 @@
|
|||||||
<java-symbol type="bool" name="config_enableScreenshotChord" />
|
<java-symbol type="bool" name="config_enableScreenshotChord" />
|
||||||
<java-symbol type="bool" name="config_bluetooth_default_profiles" />
|
<java-symbol type="bool" name="config_bluetooth_default_profiles" />
|
||||||
<java-symbol type="bool" name="config_enableWifiDisplay" />
|
<java-symbol type="bool" name="config_enableWifiDisplay" />
|
||||||
<java-symbol type="bool" name="config_forceEnableVoiceInteractionService" />
|
|
||||||
<java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" />
|
<java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" />
|
||||||
<java-symbol type="bool" name="config_useDevInputEventForAudioJack" />
|
<java-symbol type="bool" name="config_useDevInputEventForAudioJack" />
|
||||||
<java-symbol type="bool" name="config_safe_media_volume_enabled" />
|
<java-symbol type="bool" name="config_safe_media_volume_enabled" />
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ import android.content.pm.IPackageManager;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.content.pm.ServiceInfo;
|
import android.content.pm.ServiceInfo;
|
||||||
import android.content.res.Configuration;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.database.ContentObserver;
|
import android.database.ContentObserver;
|
||||||
import android.hardware.soundtrigger.IRecognitionStatusCallback;
|
import android.hardware.soundtrigger.IRecognitionStatusCallback;
|
||||||
import android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel;
|
import android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel;
|
||||||
@@ -81,7 +79,6 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
mResolver = context.getContentResolver();
|
mResolver = context.getContentResolver();
|
||||||
mDbHelper = new DatabaseHelper(context);
|
mDbHelper = new DatabaseHelper(context);
|
||||||
mSoundTriggerHelper = new SoundTriggerHelper(context);
|
mSoundTriggerHelper = new SoundTriggerHelper(context);
|
||||||
mServiceStub = new VoiceInteractionManagerServiceStub();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -107,7 +104,8 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// implementation entry point and binder service
|
// implementation entry point and binder service
|
||||||
private final VoiceInteractionManagerServiceStub mServiceStub;
|
private final VoiceInteractionManagerServiceStub mServiceStub
|
||||||
|
= new VoiceInteractionManagerServiceStub();
|
||||||
|
|
||||||
class VoiceInteractionManagerServiceStub extends IVoiceInteractionManagerService.Stub {
|
class VoiceInteractionManagerServiceStub extends IVoiceInteractionManagerService.Stub {
|
||||||
|
|
||||||
@@ -115,11 +113,6 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
|
|
||||||
private boolean mSafeMode;
|
private boolean mSafeMode;
|
||||||
private int mCurUser;
|
private int mCurUser;
|
||||||
private final boolean mEnableService;
|
|
||||||
|
|
||||||
VoiceInteractionManagerServiceStub() {
|
|
||||||
mEnableService = shouldEnableService(mContext.getResources());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
|
public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
|
||||||
@@ -143,7 +136,8 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
Settings.Secure.VOICE_INTERACTION_SERVICE, userHandle);
|
Settings.Secure.VOICE_INTERACTION_SERVICE, userHandle);
|
||||||
ComponentName curRecognizer = getCurRecognizer(userHandle);
|
ComponentName curRecognizer = getCurRecognizer(userHandle);
|
||||||
VoiceInteractionServiceInfo curInteractorInfo = null;
|
VoiceInteractionServiceInfo curInteractorInfo = null;
|
||||||
if (curInteractorStr == null && curRecognizer != null && mEnableService) {
|
if (curInteractorStr == null && curRecognizer != null
|
||||||
|
&& !ActivityManager.isLowRamDeviceStatic()) {
|
||||||
// If there is no interactor setting, that means we are upgrading
|
// If there is no interactor setting, that means we are upgrading
|
||||||
// from an older platform version. If the current recognizer is not
|
// from an older platform version. If the current recognizer is not
|
||||||
// set or matches the preferred recognizer, then we want to upgrade
|
// set or matches the preferred recognizer, then we want to upgrade
|
||||||
@@ -161,7 +155,7 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
|
|
||||||
// If we are on a svelte device, make sure an interactor is not currently
|
// If we are on a svelte device, make sure an interactor is not currently
|
||||||
// enabled; if it is, turn it off.
|
// enabled; if it is, turn it off.
|
||||||
if (!mEnableService && curInteractorStr != null) {
|
if (ActivityManager.isLowRamDeviceStatic() && curInteractorStr != null) {
|
||||||
if (!TextUtils.isEmpty(curInteractorStr)) {
|
if (!TextUtils.isEmpty(curInteractorStr)) {
|
||||||
setCurInteractor(null, userHandle);
|
setCurInteractor(null, userHandle);
|
||||||
curInteractorStr = "";
|
curInteractorStr = "";
|
||||||
@@ -190,7 +184,7 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initializing settings, look for an interactor first (but only on non-svelte).
|
// Initializing settings, look for an interactor first (but only on non-svelte).
|
||||||
if (curInteractorInfo == null && mEnableService) {
|
if (curInteractorInfo == null && !ActivityManager.isLowRamDeviceStatic()) {
|
||||||
curInteractorInfo = findAvailInteractor(userHandle, null);
|
curInteractorInfo = findAvailInteractor(userHandle, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,12 +210,6 @@ 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) {
|
public void systemRunning(boolean safeMode) {
|
||||||
mSafeMode = safeMode;
|
mSafeMode = safeMode;
|
||||||
|
|
||||||
@@ -671,7 +659,6 @@ public class VoiceInteractionManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
pw.println("VOICE INTERACTION MANAGER (dumpsys voiceinteraction)\n");
|
pw.println("VOICE INTERACTION MANAGER (dumpsys voiceinteraction)\n");
|
||||||
pw.println(" mEnableService: " + mEnableService);
|
|
||||||
if (mImpl == null) {
|
if (mImpl == null) {
|
||||||
pw.println(" (No active implementation)");
|
pw.println(" (No active implementation)");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user