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

Commit 322aa576 authored by Ytai Ben-tsvi's avatar Ytai Ben-tsvi Committed by Android (Google) Code Review
Browse files

Merge "Reduce severity of SoundTriggerService error messages" into sc-dev

parents bbb17ae4 60a49f1b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -470,7 +470,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener {


            ModelData modelData = getKeyphraseModelDataLocked(keyphraseId);
            ModelData modelData = getKeyphraseModelDataLocked(keyphraseId);
            if (modelData == null || !modelData.isKeyphraseModel()) {
            if (modelData == null || !modelData.isKeyphraseModel()) {
                Slog.e(TAG, "No model exists for given keyphrase Id " + keyphraseId);
                Slog.w(TAG, "No model exists for given keyphrase Id " + keyphraseId);
                return STATUS_ERROR;
                return STATUS_ERROR;
            }
            }


+16 −16
Original line number Original line Diff line number Diff line
@@ -142,7 +142,7 @@ public class SoundTriggerService extends SystemService {
            }
            }


            if (stat.mIsStarted) {
            if (stat.mIsStarted) {
                Slog.e(TAG, "error onStart(): Model " + id + " already started");
                Slog.w(TAG, "error onStart(): Model " + id + " already started");
                return;
                return;
            }
            }


@@ -154,12 +154,12 @@ public class SoundTriggerService extends SystemService {
        public synchronized void onStop(UUID id) {
        public synchronized void onStop(UUID id) {
            SoundModelStat stat = mModelStats.get(id);
            SoundModelStat stat = mModelStats.get(id);
            if (stat == null) {
            if (stat == null) {
                Slog.e(TAG, "error onStop(): Model " + id + " has no stats available");
                Slog.w(TAG, "error onStop(): Model " + id + " has no stats available");
                return;
                return;
            }
            }


            if (!stat.mIsStarted) {
            if (!stat.mIsStarted) {
                Slog.e(TAG, "error onStop(): Model " + id + " already stopped");
                Slog.w(TAG, "error onStop(): Model " + id + " already stopped");
                return;
                return;
            }
            }


@@ -314,7 +314,7 @@ public class SoundTriggerService extends SystemService {


                GenericSoundModel model = getSoundModel(parcelUuid);
                GenericSoundModel model = getSoundModel(parcelUuid);
                if (model == null) {
                if (model == null) {
                    Slog.e(TAG, "Null model in database for id: " + parcelUuid);
                    Slog.w(TAG, "Null model in database for id: " + parcelUuid);


                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                            "startRecognition(): Null model in database for id: " + parcelUuid));
                            "startRecognition(): Null model in database for id: " + parcelUuid));
@@ -409,7 +409,7 @@ public class SoundTriggerService extends SystemService {
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
                enforceCallingPermission(Manifest.permission.MANAGE_SOUND_TRIGGER);
                enforceCallingPermission(Manifest.permission.MANAGE_SOUND_TRIGGER);
                if (soundModel == null || soundModel.getUuid() == null) {
                if (soundModel == null || soundModel.getUuid() == null) {
                    Slog.e(TAG, "Invalid sound model");
                    Slog.w(TAG, "Invalid sound model");


                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                            "loadGenericSoundModel(): Invalid sound model"));
                            "loadGenericSoundModel(): Invalid sound model"));
@@ -445,7 +445,7 @@ public class SoundTriggerService extends SystemService {
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
                enforceCallingPermission(Manifest.permission.MANAGE_SOUND_TRIGGER);
                enforceCallingPermission(Manifest.permission.MANAGE_SOUND_TRIGGER);
                if (soundModel == null || soundModel.getUuid() == null) {
                if (soundModel == null || soundModel.getUuid() == null) {
                    Slog.e(TAG, "Invalid sound model");
                    Slog.w(TAG, "Invalid sound model");


                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                            "loadKeyphraseSoundModel(): Invalid sound model"));
                            "loadKeyphraseSoundModel(): Invalid sound model"));
@@ -453,7 +453,7 @@ public class SoundTriggerService extends SystemService {
                    return STATUS_ERROR;
                    return STATUS_ERROR;
                }
                }
                if (soundModel.getKeyphrases() == null || soundModel.getKeyphrases().length != 1) {
                if (soundModel.getKeyphrases() == null || soundModel.getKeyphrases().length != 1) {
                    Slog.e(TAG, "Only one keyphrase per model is currently supported.");
                    Slog.w(TAG, "Only one keyphrase per model is currently supported.");


                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                    sEventLogger.log(new SoundTriggerLogger.StringEvent(
                            "loadKeyphraseSoundModel(): Only one keyphrase per model"
                            "loadKeyphraseSoundModel(): Only one keyphrase per model"
@@ -513,7 +513,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                    Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "startRecognitionForService():" + soundModelId + " is not loaded"));
                                "startRecognitionForService():" + soundModelId + " is not loaded"));
@@ -525,7 +525,7 @@ public class SoundTriggerService extends SystemService {
                        existingCallback = mCallbacks.get(soundModelId.getUuid());
                        existingCallback = mCallbacks.get(soundModelId.getUuid());
                    }
                    }
                    if (existingCallback != null) {
                    if (existingCallback != null) {
                        Slog.e(TAG, soundModelId + " is already running");
                        Slog.w(TAG, soundModelId + " is already running");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "startRecognitionForService():"
                                "startRecognitionForService():"
@@ -580,7 +580,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "stopRecognitionForService(): " + soundModelId
                                "stopRecognitionForService(): " + soundModelId
@@ -593,7 +593,7 @@ public class SoundTriggerService extends SystemService {
                        callback = mCallbacks.get(soundModelId.getUuid());
                        callback = mCallbacks.get(soundModelId.getUuid());
                    }
                    }
                    if (callback == null) {
                    if (callback == null) {
                        Slog.e(TAG, soundModelId + " is not running");
                        Slog.w(TAG, soundModelId + " is not running");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "stopRecognitionForService(): " + soundModelId
                                "stopRecognitionForService(): " + soundModelId
@@ -648,7 +648,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "unloadSoundModel(): " + soundModelId + " is not loaded"));
                                "unloadSoundModel(): " + soundModelId + " is not loaded"));
@@ -715,7 +715,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent("getModelState(): "
                        sEventLogger.log(new SoundTriggerLogger.StringEvent("getModelState(): "
                                + soundModelId + " is not loaded"));
                                + soundModelId + " is not loaded"));
@@ -777,7 +777,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded. Loaded models: "
                        Slog.w(TAG, soundModelId + " is not loaded. Loaded models: "
                                + mLoadedModels.toString());
                                + mLoadedModels.toString());


                        sEventLogger.log(new SoundTriggerLogger.StringEvent("setParameter(): "
                        sEventLogger.log(new SoundTriggerLogger.StringEvent("setParameter(): "
@@ -810,7 +810,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent("getParameter(): "
                        sEventLogger.log(new SoundTriggerLogger.StringEvent("getParameter(): "
                                + soundModelId + " is not loaded"));
                                + soundModelId + " is not loaded"));
@@ -841,7 +841,7 @@ public class SoundTriggerService extends SystemService {
                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    if (soundModel == null) {
                    if (soundModel == null) {
                        Slog.e(TAG, soundModelId + " is not loaded");
                        Slog.w(TAG, soundModelId + " is not loaded");


                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                        sEventLogger.log(new SoundTriggerLogger.StringEvent(
                                "queryParameter(): "
                                "queryParameter(): "