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

Commit b11ee0b2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Limit HotwordDetection process number to 10" into tm-dev am: fc014eab

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17105443

Change-Id: I6e2d2f847f7d59550e1d28b94c560db1ff773b03
parents e9e5e63a fc014eab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ final class HotwordDetectionConnection {
    private static final Duration MAX_UPDATE_TIMEOUT_DURATION =
            Duration.ofMillis(MAX_UPDATE_TIMEOUT_MILLIS);
    private static final long RESET_DEBUG_HOTWORD_LOGGING_TIMEOUT_MILLIS = 60 * 60 * 1000; // 1 hour
    private static final int MAX_ISOLATED_PROCESS_NUMBER = 10;

    private final Executor mAudioCopyExecutor = Executors.newCachedThreadPool();
    // TODO: This may need to be a Handler(looper)
@@ -772,7 +773,8 @@ final class HotwordDetectionConnection {
        ServiceConnection createLocked() {
            ServiceConnection connection =
                    new ServiceConnection(mContext, mIntent, mBindingFlags, mUser,
                            IHotwordDetectionService.Stub::asInterface, ++mRestartCount);
                            IHotwordDetectionService.Stub::asInterface,
                            mRestartCount++ % MAX_ISOLATED_PROCESS_NUMBER);
            connection.connect();

            updateAudioFlinger(connection, mAudioFlinger);