summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2024-01-16 10:18:00 +0100
committerThomas <tschneider.ac@gmail.com>2024-01-16 10:32:35 +0100
commit1a237e00c3ba78651d5985745d2264af53c4510f (patch)
tree33e64bdd595ce88edc3ae45d21c4f25ad171029c
parentfbf2d72f5decd5498b2345a001b4be480432c4d5 (diff)
Clean class
-rw-r--r--app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java23
1 files changed, 4 insertions, 19 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java b/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java
index 6d34fb91a..d414269cf 100644
--- a/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java
+++ b/app/src/main/java/app/fedilab/android/mastodon/client/entities/app/CachedBundle.java
@@ -68,7 +68,7 @@ public class CachedBundle {
}
- public long insertAccountBundle(Account account, BaseAccount currentUser) throws DBException {
+ public void insertAccountBundle(Account account, BaseAccount currentUser) throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
@@ -83,9 +83,8 @@ public class CachedBundle {
valuesAccount.put(Sqlite.COL_INSTANCE, currentUser.instance);
valuesAccount.put(Sqlite.COL_TYPE, CacheType.ACCOUNT.getValue());
removeIntent(currentUser, account.id);
- return db.insertOrThrow(Sqlite.TABLE_INTENT, null, valuesAccount);
+ db.insertOrThrow(Sqlite.TABLE_INTENT, null, valuesAccount);
}
- return -1;
}
/**
@@ -272,21 +271,8 @@ public class CachedBundle {
/**
* Remove a bundle from db
- *
- * @param id - intent id
*/
- private void removeIntent(String id) throws DBException {
- if (db == null) {
- throw new DBException("db is null. Wrong initialization.");
- }
- db.delete(Sqlite.TABLE_INTENT, Sqlite.COL_ID + " = '" + id + "'", null);
- }
-
- /**
- * Remove a bundle from db
- *
- */
- public long deleteOldIntent() throws DBException {
+ public void deleteOldIntent() throws DBException {
if (db == null) {
throw new DBException("db is null. Wrong initialization.");
}
@@ -296,10 +282,9 @@ public class CachedBundle {
Date date = cal.getTime();
String dateStr = Helper.dateToString(date);
try {
- return db.delete(Sqlite.TABLE_INTENT, Sqlite.COL_CREATED_AT + " < ?", new String[]{dateStr});
+ db.delete(Sqlite.TABLE_INTENT, Sqlite.COL_CREATED_AT + " < ?", new String[]{dateStr});
}catch (Exception e) {
e.printStackTrace();
- return -1;
}
}