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

Commit b431e461 authored by Ytai Ben-tsvi's avatar Ytai Ben-tsvi Committed by Automerger Merge Worker
Browse files

Merge "Add capture state to soundtrigger_middleware dump" into rvc-dev am: b42d1a5a

Change-Id: If3aa9ff4ed6513e4ce375fa40e57190f556339f2
parents f5c59c4e b42d1a5a
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -114,6 +114,8 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
        DEAD
        DEAD
    };
    };


    private Boolean mCaptureState;

    private final @NonNull ISoundTriggerMiddlewareInternal mDelegate;
    private final @NonNull ISoundTriggerMiddlewareInternal mDelegate;
    private final @NonNull Context mContext;
    private final @NonNull Context mContext;
    private Map<Integer, Set<ModuleService>> mModules;
    private Map<Integer, Set<ModuleService>> mModules;
@@ -224,6 +226,11 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
            mDelegate.setCaptureState(active);
            mDelegate.setCaptureState(active);
        } catch (Exception e) {
        } catch (Exception e) {
            throw handleException(e);
            throw handleException(e);
        } finally {
            // It is safe to lock here - local operation.
            synchronized (this) {
                mCaptureState = active;
            }
        }
        }
    }
    }


@@ -274,8 +281,11 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware
                "This implementation is not inteded to be used directly with Binder.");
                "This implementation is not inteded to be used directly with Binder.");
    }
    }


    @Override public void dump(PrintWriter pw) {
    @Override
    public void dump(PrintWriter pw) {
        synchronized (this) {
        synchronized (this) {
            pw.printf("Capture state is %s\n", mCaptureState == null ? "uninitialized"
                    : (mCaptureState ? "active" : "inactive"));
            if (mModules != null) {
            if (mModules != null) {
                for (int handle : mModules.keySet()) {
                for (int handle : mModules.keySet()) {
                    pw.println("=========================================");
                    pw.println("=========================================");