Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baee28f4 authored by Ahaan Ugale's avatar Ahaan Ugale Committed by Android (Google) Code Review
Browse files

Merge changes from topics "default-reco", "default-reco-config" into sc-dev

* changes:
  VIMS: Use the new recognizer config resource for init.
  Introduce a default speech recognizer.
parents fb19bcc0 3a1cef2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ package android {
    field public static final int config_systemContacts = 17039403; // 0x104002b
    field public static final int config_systemGallery = 17039399; // 0x1040027
    field public static final int config_systemShell = 17039402; // 0x104002a
    field public static final int config_systemSpeechRecognizer = 17039406; // 0x104002e
  }
  public static final class R.style {
+2 −0
Original line number Diff line number Diff line
@@ -1953,6 +1953,8 @@
    <string name="config_systemShell" translatable="false">com.android.shell</string>
    <!-- The name of the package that will hold the system contacts role. -->
    <string name="config_systemContacts" translatable="false">com.android.contacts</string>
    <!-- The name of the package that will hold the speech recognizer role by default. -->
    <string name="config_systemSpeechRecognizer" translatable="false"></string>

    <!-- The name of the package that will be allowed to change its components' label/icon. -->
    <string name="config_overrideComponentUiPackage" translatable="false"></string>
+2 −0
Original line number Diff line number Diff line
@@ -3166,6 +3166,8 @@
    <public name="config_customMediaKeyDispatcher" />
    <!-- @hide @SystemApi -->
    <public name="config_customMediaSessionPolicyProvider" />
    <!-- @hide @SystemApi -->
    <public name="config_systemSpeechRecognizer" />
  </public-group>

  <public-group type="id" first-id="0x01020055">
+11 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ import android.util.ArraySet;
import android.util.Log;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IHotwordRecognitionStatusCallback;
import com.android.internal.app.IVoiceActionCheckCallback;
@@ -643,6 +644,10 @@ public class VoiceInteractionManagerService extends SystemService {
        }

        ComponentName findAvailRecognizer(String prefPackage, int userHandle) {
            if (prefPackage == null) {
                prefPackage = getDefaultRecognizer();
            }

            List<ResolveInfo> available =
                    mContext.getPackageManager().queryIntentServicesAsUser(
                            new Intent(RecognitionService.SERVICE_INTERFACE),
@@ -670,6 +675,12 @@ public class VoiceInteractionManagerService extends SystemService {
            }
        }

        @Nullable
        public String getDefaultRecognizer() {
            String recognizer = mContext.getString(R.string.config_systemSpeechRecognizer);
            return TextUtils.isEmpty(recognizer) ? null : recognizer;
        }

        ComponentName getCurRecognizer(int userHandle) {
            String curRecognizer = Settings.Secure.getStringForUser(
                    mContext.getContentResolver(),