Search in sources :

Example 1 with CommonPresenter

use of com.mxt.anitrend.base.custom.presenter.CommonPresenter in project anitrend-app by AniTrend.

the class WebTokenRequest method invalidateInstance.

/**
 * Invalidate authentication state, defaulting to signed out state
 * and disable sync services
 */
public static void invalidateInstance(Context context) {
    CommonPresenter presenter = new BasePresenter(context);
    presenter.getSettings().setAuthenticated(false);
    presenter.getSettings().setLastDismissedNotificationId(-1);
    presenter.getDatabase().invalidateBoxStores();
    KoinExt.get(JobSchedulerUtil.class).cancelNotificationJob(context);
    WebFactory.invalidate();
    token = null;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
        ShortcutUtil.removeAllDynamicShortcuts(context);
    KoinExt.get(ISupportAnalytics.class).clearUserSession();
}
Also used : JobSchedulerUtil(com.mxt.anitrend.util.JobSchedulerUtil) CommonPresenter(com.mxt.anitrend.base.custom.presenter.CommonPresenter) BasePresenter(com.mxt.anitrend.presenter.base.BasePresenter) ISupportAnalytics(com.mxt.anitrend.analytics.contract.ISupportAnalytics)

Aggregations

ISupportAnalytics (com.mxt.anitrend.analytics.contract.ISupportAnalytics)1 CommonPresenter (com.mxt.anitrend.base.custom.presenter.CommonPresenter)1 BasePresenter (com.mxt.anitrend.presenter.base.BasePresenter)1 JobSchedulerUtil (com.mxt.anitrend.util.JobSchedulerUtil)1