Пример #1
0
  public static void removeWpComUserRelatedData(Context context) {
    // cancel all Volley requests - do this before unregistering push since that uses
    // a Volley request
    VolleyUtils.cancelAllRequests(requestQueue);

    NotificationsUtils.unregisterDevicePushNotifications(context);
    try {
      GCMRegistrar.checkDevice(context);
      GCMRegistrar.unregister(context);
    } catch (Exception e) {
      AppLog.v(T.NOTIFS, "Could not unregister for GCM: " + e.getMessage());
    }

    // delete wpcom blogs
    wpDB.deleteWordPressComBlogs(context);

    // reset default account
    AccountHelper.getDefaultAccount().signout();

    // reset all reader-related prefs & data
    AppPrefs.reset();
    ReaderDatabase.reset();

    // Reset Stats Data
    StatsDatabaseHelper.getDatabase(context).reset();

    // Reset Simperium buckets (removes local data)
    SimperiumUtils.resetBucketsAndDeauthorize();
  }
Пример #2
0
 // Configure Simperium and start buckets if we are signed in to WP.com
 private void configureSimperium() {
   if (AccountHelper.isSignedInWordPressDotCom()) {
     AppLog.i(T.NOTIFS, "Configuring Simperium");
     SimperiumUtils.configureSimperium(this, AccountHelper.getDefaultAccount().getAccessToken());
   }
 }