use of com.microsoft.appcenter.channel.AbstractChannelListener in project mobile-center-sdk-android by Microsoft.
the class EventFilter method applyEnabledState.
@Override
protected synchronized void applyEnabledState(boolean enabled) {
/* Enable filtering logs when this module is enabled. */
if (enabled) {
mChannelListener = new AbstractChannelListener() {
@Override
public boolean shouldFilter(@NonNull Log log) {
/* Filter out events. */
if (log instanceof EventLog) {
AppCenterLog.info(LOG_TAG, "Filtered an event out.");
return true;
}
return false;
}
};
mChannel.addListener(mChannelListener);
} else /* On applying disabled state, let's make sure we remove listener. */
if (mChannel != null) {
mChannel.removeListener(mChannelListener);
}
}
Aggregations