Search in sources :

Example 1 with AnalyticsValidator

use of com.microsoft.appcenter.analytics.channel.AnalyticsValidator in project mobile-center-sdk-android by Microsoft.

the class Analytics method startAppLevelFeatures.

/**
 * Start features at app level, this is not done if only libraries started the service.
 */
@WorkerThread
private void startAppLevelFeatures() {
    /* Share the started from app check between all calls. */
    if (mStartedFromApp) {
        /* Enable filtering logs. */
        mAnalyticsValidator = new AnalyticsValidator();
        mChannel.addListener(mAnalyticsValidator);
        /* Start session tracker. */
        mSessionTracker = new SessionTracker(mChannel, ANALYTICS_GROUP);
        if (isManualSessionTrackerEnabled) {
            mSessionTracker.enableManualSessionTracker();
        }
        mChannel.addListener(mSessionTracker);
        /* If we are in foreground, make sure we send start session log now (and track page). */
        if (mCurrentActivity != null) {
            Activity activity = mCurrentActivity.get();
            if (activity != null) {
                processOnResume(activity);
            }
        }
        /* Add new channel listener for transmission target. */
        mAnalyticsTransmissionTargetListener = AnalyticsTransmissionTarget.getChannelListener();
        mChannel.addListener(mAnalyticsTransmissionTargetListener);
    }
}
Also used : AnalyticsValidator(com.microsoft.appcenter.analytics.channel.AnalyticsValidator) Activity(android.app.Activity) SessionTracker(com.microsoft.appcenter.analytics.channel.SessionTracker) WorkerThread(androidx.annotation.WorkerThread)

Aggregations

Activity (android.app.Activity)1 WorkerThread (androidx.annotation.WorkerThread)1 AnalyticsValidator (com.microsoft.appcenter.analytics.channel.AnalyticsValidator)1 SessionTracker (com.microsoft.appcenter.analytics.channel.SessionTracker)1