This commit is contained in:
Dennis Guse
2025-11-02 18:09:23 +01:00
parent f47ab142f2
commit 3d083928eb
3 changed files with 2 additions and 88 deletions
@@ -71,8 +71,7 @@ public class ContentProviderUtils {
private static final String TAG = ContentProviderUtils.class.getSimpleName();
// The authority (the first part of the URI) for the app's content provider.
@VisibleForTesting
public static final String AUTHORITY_PACKAGE = BuildConfig.APPLICATION_ID + ".content";
static final String AUTHORITY_PACKAGE = BuildConfig.APPLICATION_ID + ".content";
// The base URI for the app's content provider.
public static final String CONTENT_BASE_URI = "content://" + AUTHORITY_PACKAGE;
@@ -19,7 +19,6 @@ package de.dennisguse.opentracks.data;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.SQLException;
@@ -111,18 +110,7 @@ public class CustomContentProvider extends ContentProvider {
@Override
public boolean onCreate() {
return onCreate(getContext());
}
/**
* Helper method to make onCreate is testable.
*
* @param context context to creates database
* @return true means run successfully
*/
@VisibleForTesting
boolean onCreate(Context context) {
CustomSQLiteOpenHelper databaseHelper = new CustomSQLiteOpenHelper(context);
CustomSQLiteOpenHelper databaseHelper = new CustomSQLiteOpenHelper(getContext());
try {
db = databaseHelper.getWritableDatabase();
// Necessary to enable cascade deletion from Track to TrackPoints and Markers