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

Commit a84663e3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reduce logspam for BoundServiceSession errors" into main

parents e591d195 e6fdbd8c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1606,6 +1606,10 @@ public abstract class NotificationListenerService extends Service {
                applyUpdateLocked(update);
                mCompletionListener = completionListener;
            }
            if (isConnected) {
                Log.e(TAG, "onListenerConnected called on an already connected service!"
                        + " This can result in duplicate events.");
            }
            isConnected = true;
            final SomeArgs args = SomeArgs.obtain();
            args.argl1 = dispatchToken;
+9 −2
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ public class BoundServiceSession implements IBinderSession {
    @GuardedBy("this")
    int mTotal = 0;

    private boolean mKnownBad = false;

    BoundServiceSession(BiConsumer<ConnectionRecord, Boolean> processStateUpdater,
            WeakReference<ConnectionRecord> weakCr, String debugName) {
        mProcessStateUpdater = processStateUpdater;
@@ -122,8 +124,13 @@ public class BoundServiceSession implements IBinderSession {
        // the underlying ConnectionRecord. This also ensures that there are no shenanigans that
        // the remote app can perform with the given token to remain unfrozen.
        logTraceInstant(() -> errorMessage);
        if (!mKnownBad) {
            Slog.wtfStack(TAG,
                    errorMessage + ". Current keys: " + mKeyByTag + "; Counts: " + mCountByKey);
            mKnownBad = true;
        } else {
            Slog.e(TAG, errorMessage + ". Current keys: " + mKeyByTag + "; Counts: " + mCountByKey);
        }
        mKeyByTag.clear();
        mCountByKey.clear();
        if (mTotal != 0) {