Ejemplo n.º 1
0
 @Override
 public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
   // IMPORTANT: do NOT call super() here - doing so throws a SQLiteException
   AppLog.w(
       T.READER, "Downgrading database from version " + oldVersion + " to version " + newVersion);
   reset(db);
 }
Ejemplo n.º 2
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();
  }
Ejemplo n.º 3
0
 @Override
 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
   // for now just reset the db when upgrading, future versions may want to avoid this
   // and modify table structures, etc., on upgrade while preserving data
   AppLog.i(
       T.READER, "Upgrading database from version " + oldVersion + " to version " + newVersion);
   reset(db);
 }