Add/update access method/level for mTag and shouldLog().
So that these can be accessed in the inheriting classes. Also some minor addition/updates to the logging messages. Bug: 249826718 Test: manual Test: atest TimeoutToUserZeroMediaConditionTest Change-Id: Ic49084e5ea826ce4021f58a2075f4339c5344faf
This commit is contained in:
@@ -132,10 +132,14 @@ public abstract class Condition implements CallbackController<Condition.Callback
|
||||
return 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.
|
||||
*/
|
||||
|
||||
@@ -113,6 +113,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.
|
||||
@@ -139,7 +140,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;
|
||||
|
||||
Reference in New Issue
Block a user