Esempio n. 1
0
    /**
     * This method is called when: 1. the app starts (but it's not opened by a service or a
     * broadcast receiver, i.e. an activity is resumed) 2. the app was in background and is now
     * foreground
     */
    public void onAppComesFromBackground() {
      AppLog.i(T.UTILS, "App comes from background");
      ConnectionChangeReceiver.setEnabled(WordPress.this, true);
      AnalyticsUtils.refreshMetadata();
      mApplicationOpenedDate = new Date();
      AnalyticsTracker.track(AnalyticsTracker.Stat.APPLICATION_OPENED);
      if (NetworkUtils.isNetworkAvailable(mContext)) {
        // Rate limited PN Token Update
        updatePushNotificationTokenIfNotLimited();

        // Rate limited WPCom blog list Update
        sUpdateWordPressComBlogList.runIfNotLimited();

        // Rate limited blog options Update
        sUpdateCurrentBlogOption.runIfNotLimited();
      }
      sDeleteExpiredStats.runIfNotLimited();
    }
Esempio n. 2
0
 public void onAppGoesToBackground() {
   AppLog.i(T.UTILS, "App goes to background");
   ConnectionChangeReceiver.setEnabled(WordPress.this, false);
 }