Removed interface AppConfig, since it is technically not needed.

This commit is contained in:
Ristello
2021-10-13 21:42:37 +02:00
committed by Dennis Guse
parent 8079a25a42
commit 58ca78b976
3 changed files with 8 additions and 14 deletions
@@ -1,10 +0,0 @@
package de.dennisguse.opentracks;
public interface AppConfig {
/**
* Returns the name of the database used by SQLiteOpenHelper.
* See {@link android.database.sqlite.SQLiteOpenHelper} for details.
* @return SQLite database name.
*/
String getDatabaseName();
}
@@ -14,7 +14,7 @@ import de.dennisguse.opentracks.settings.PreferencesUtils;
* NOTE: How often actual application startup happens depends on the OS.
* Not every start of an activity will trigger this.
*/
public class Startup extends Application implements AppConfig {
public class Startup extends Application {
private static final String TAG = Startup.class.getSimpleName();
@@ -41,7 +41,11 @@ public class Startup extends Application implements AppConfig {
}
}
@Override
/**
* Returns the name of the database used by SQLiteOpenHelper.
* See {@link android.database.sqlite.SQLiteOpenHelper} for details.
* @return SQLite database name.
*/
public String getDatabaseName() {
return "database.db";
}
@@ -11,7 +11,7 @@ import androidx.annotation.VisibleForTesting;
import java.util.UUID;
import de.dennisguse.opentracks.AppConfig;
import de.dennisguse.opentracks.Startup;
import de.dennisguse.opentracks.content.data.MarkerColumns;
import de.dennisguse.opentracks.content.data.Track;
import de.dennisguse.opentracks.content.data.TrackPointsColumns;
@@ -29,7 +29,7 @@ public class CustomSQLiteOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 31;
public CustomSQLiteOpenHelper(Context context) {
this(context, ((AppConfig) context.getApplicationContext()).getDatabaseName());
this(context, ((Startup) context.getApplicationContext()).getDatabaseName());
}
@VisibleForTesting