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

Commit fd14b576 authored by Xiaowen Lei's avatar Xiaowen Lei Committed by Automerger Merge Worker
Browse files

Merge "Add/update access method/level for mTag and shouldLog()." into...

Merge "Add/update access method/level for mTag and shouldLog()." into tm-qpr-dev am: dfd09a63 am: 621eb2bd

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



Change-Id: Id355ae4819b2f062c7f21991b65ad7de7d882c67
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f933369f 621eb2bd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -172,10 +172,14 @@ public abstract class Condition implements CallbackController<Condition.Callback
        return Boolean.TRUE.equals(mIsConditionMet);
    }

    private boolean shouldLog() {
    protected final boolean shouldLog() {
        return Log.isLoggable(mTag, Log.DEBUG);
    }

    protected final String getTag() {
        return mTag;
    }

    /**
     * Callback that receives updates about whether the condition has been fulfilled.
     */
+2 −1
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ public class Monitor {
        final SubscriptionState state = new SubscriptionState(subscription);

        mExecutor.execute(() -> {
            if (shouldLog()) Log.d(mTag, "adding subscription");
            mSubscriptions.put(token, state);

            // Add and associate conditions.
@@ -143,7 +144,7 @@ public class Monitor {
     */
    public void removeSubscription(@NotNull Subscription.Token token) {
        mExecutor.execute(() -> {
            if (shouldLog()) Log.d(mTag, "removing callback");
            if (shouldLog()) Log.d(mTag, "removing subscription");
            if (!mSubscriptions.containsKey(token)) {
                Log.e(mTag, "subscription not present:" + token);
                return;