Delete database as panic response even when signed out

The method `runOnDbThread()` depends on an executor
that's created by roboguice at startup.
It requires to be signed in, so use a different thread instead.
This commit is contained in:
Torsten Grote
2016-01-13 15:46:26 -02:00
parent 42d1f6ded0
commit c8d0e64542

View File

@@ -89,14 +89,14 @@ public class PanicResponderActivity extends BriarActivity {
}
private void deleteAllData() {
runOnDbThread(new Runnable() {
new Thread() {
@Override
public void run() {
clearSharedPrefs();
// TODO somehow delete/shred the database more thoroughly
FileUtils
.deleteFileOrDir(
databaseConfig.getDatabaseDirectory());
clearSharedPrefs();
PanicResponder.deleteAllAppData(PanicResponderActivity.this);
// nothing left to do after everything is deleted,
@@ -104,6 +104,7 @@ public class PanicResponderActivity extends BriarActivity {
LOG.info("Signing out...");
signOut(true);
}
});
}.start();
}
}