Merge "Add/update access method/level for mTag and shouldLog()." into tm-qpr-dev
This commit is contained in:
@@ -172,10 +172,14 @@ public abstract class Condition implements CallbackController<Condition.Callback
|
|||||||
return Boolean.TRUE.equals(mIsConditionMet);
|
return Boolean.TRUE.equals(mIsConditionMet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldLog() {
|
protected final boolean shouldLog() {
|
||||||
return Log.isLoggable(mTag, Log.DEBUG);
|
return Log.isLoggable(mTag, Log.DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected final String getTag() {
|
||||||
|
return mTag;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback that receives updates about whether the condition has been fulfilled.
|
* Callback that receives updates about whether the condition has been fulfilled.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ public class Monitor {
|
|||||||
final SubscriptionState state = new SubscriptionState(subscription);
|
final SubscriptionState state = new SubscriptionState(subscription);
|
||||||
|
|
||||||
mExecutor.execute(() -> {
|
mExecutor.execute(() -> {
|
||||||
|
if (shouldLog()) Log.d(mTag, "adding subscription");
|
||||||
mSubscriptions.put(token, state);
|
mSubscriptions.put(token, state);
|
||||||
|
|
||||||
// Add and associate conditions.
|
// Add and associate conditions.
|
||||||
@@ -143,7 +144,7 @@ public class Monitor {
|
|||||||
*/
|
*/
|
||||||
public void removeSubscription(@NotNull Subscription.Token token) {
|
public void removeSubscription(@NotNull Subscription.Token token) {
|
||||||
mExecutor.execute(() -> {
|
mExecutor.execute(() -> {
|
||||||
if (shouldLog()) Log.d(mTag, "removing callback");
|
if (shouldLog()) Log.d(mTag, "removing subscription");
|
||||||
if (!mSubscriptions.containsKey(token)) {
|
if (!mSubscriptions.containsKey(token)) {
|
||||||
Log.e(mTag, "subscription not present:" + token);
|
Log.e(mTag, "subscription not present:" + token);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user