forked from upstream-mirrors/OpenTracks
Removed interface AppConfig, since it is technically not needed.
This commit is contained in:
@@ -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.
|
* NOTE: How often actual application startup happens depends on the OS.
|
||||||
* Not every start of an activity will trigger this.
|
* 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();
|
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() {
|
public String getDatabaseName() {
|
||||||
return "database.db";
|
return "database.db";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
|
|
||||||
import java.util.UUID;
|
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.MarkerColumns;
|
||||||
import de.dennisguse.opentracks.content.data.Track;
|
import de.dennisguse.opentracks.content.data.Track;
|
||||||
import de.dennisguse.opentracks.content.data.TrackPointsColumns;
|
import de.dennisguse.opentracks.content.data.TrackPointsColumns;
|
||||||
@@ -29,7 +29,7 @@ public class CustomSQLiteOpenHelper extends SQLiteOpenHelper {
|
|||||||
private static final int DATABASE_VERSION = 31;
|
private static final int DATABASE_VERSION = 31;
|
||||||
|
|
||||||
public CustomSQLiteOpenHelper(Context context) {
|
public CustomSQLiteOpenHelper(Context context) {
|
||||||
this(context, ((AppConfig) context.getApplicationContext()).getDatabaseName());
|
this(context, ((Startup) context.getApplicationContext()).getDatabaseName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
Reference in New Issue
Block a user