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

Commit c3b7d1b2 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Add null checking when deleting hotword detectors" into udc-dev

parents 64941906 dfd9ad4f
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1066,7 +1066,9 @@ public class VoiceInteractionService extends Service {
        synchronized (mLock) {
        synchronized (mLock) {
            mActiveDetectors.forEach(detector -> {
            mActiveDetectors.forEach(detector -> {
                try {
                try {
                    if (detector != mActiveVisualQueryDetector.getInitializationDelegate()
                    // Skip destroying VisualQueryDetector if HotwordDetectors are created
                    if (!(mActiveVisualQueryDetector != null
                            && detector == mActiveVisualQueryDetector.getInitializationDelegate())
                            || shouldShutDownVisualQueryDetector) {
                            || shouldShutDownVisualQueryDetector) {
                        detector.destroy();
                        detector.destroy();
                    }
                    }