diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java index cd652893..e5047e5e 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019 by k3b. + * Copyright (c) 2015-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -38,15 +38,15 @@ import de.k3b.LibGlobal; import de.k3b.android.GuiUtil; import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader; -import de.k3b.android.androFotoFinder.queries.ContentProviderMediaImpl; import de.k3b.android.androFotoFinder.queries.DatabaseHelper; import de.k3b.android.androFotoFinder.queries.FotoSql; import de.k3b.android.androFotoFinder.queries.FotoSqlBase; -import de.k3b.android.androFotoFinder.queries.IMediaDBApi; -import de.k3b.android.androFotoFinder.queries.MediaDBContentprovider; -import de.k3b.android.androFotoFinder.queries.MediaDBUpdater; -import de.k3b.android.androFotoFinder.queries.MediaImageDbReplacement; -import de.k3b.android.androFotoFinder.queries.MergedMediaDB; +import de.k3b.android.androFotoFinder.queries.IMediaRepositoryApi; +import de.k3b.android.androFotoFinder.queries.MediaContent2DBUpdateService; +import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepository; +import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepositoryImpl; +import de.k3b.android.androFotoFinder.queries.MediaDBRepository; +import de.k3b.android.androFotoFinder.queries.MergedMediaRepository; import de.k3b.android.osmdroid.forge.MapsForgeSupport; import de.k3b.android.util.LogCat; import de.k3b.android.widget.ActivityWithCallContext; @@ -67,10 +67,10 @@ */ public class AndroFotoFinderApp extends Application { private static String fileNamePrefix = "androFotofinder.logcat-"; - private static MediaDBUpdater mediaDbUpdater = null; + private static MediaContent2DBUpdateService mediaContent2DbUpdateService = null; - public static MediaDBUpdater getMediaDbUpdater() { - return mediaDbUpdater; + public static MediaContent2DBUpdateService getMediaContent2DbUpdateService() { + return mediaContent2DbUpdateService; } private LogCat mCrashSaveToFile = null; @@ -92,7 +92,7 @@ public static String getGetTeaserText(Context context, String linkUrlForDetails) } public static void setMediaImageDbReplacement(Context context, boolean useMediaImageDbReplacement) { - final IMediaDBApi oldMediaDBApi = FotoSql.getMediaDBApi(); + final IMediaRepositoryApi oldMediaDBApi = FotoSql.getMediaDBApi(); if ((oldMediaDBApi == null) || (Global.useMediaImageDbReplacement != useMediaImageDbReplacement)) { // menu must be recreated @@ -100,26 +100,28 @@ public static void setMediaImageDbReplacement(Context context, boolean useMediaI Global.useMediaImageDbReplacement = useMediaImageDbReplacement; - final MediaDBContentprovider mediaDBContentprovider = new MediaDBContentprovider(context); + final MediaContentproviderRepository mediaContentproviderRepository = new MediaContentproviderRepository(context); if (Global.useMediaImageDbReplacement) { final SQLiteDatabase writableDatabase = DatabaseHelper.getWritableDatabase(context); - final MediaImageDbReplacement mediaImageDbReplacement = new MediaImageDbReplacement(writableDatabase); - FotoSql.setMediaDBApi(new MergedMediaDB(mediaImageDbReplacement, mediaDBContentprovider)); + final MediaDBRepository mediaDBRepository = new MediaDBRepository(writableDatabase); + FotoSql.setMediaDBApi(new MergedMediaRepository(mediaDBRepository, mediaContentproviderRepository)); - AndroFotoFinderApp.mediaDbUpdater = new MediaDBUpdater(context, writableDatabase); + AndroFotoFinderApp.mediaContent2DbUpdateService = new MediaContent2DBUpdateService(context, writableDatabase); if (FotoSql.getCount(new QueryParameter().addWhere("1 = 1")) == 0) { // database is empty; reload from Contentprovider - AndroFotoFinderApp.mediaDbUpdater.rebuild(context, null); + AndroFotoFinderApp.mediaContent2DbUpdateService.rebuild(context, null); } + + } else { - if ((oldMediaDBApi != null) && (AndroFotoFinderApp.mediaDbUpdater != null)) { + if ((oldMediaDBApi != null) && (AndroFotoFinderApp.mediaContent2DbUpdateService != null)) { // switching from mediaImageDbReplacement to Contentprovider - AndroFotoFinderApp.mediaDbUpdater.clearMediaCopy(); + AndroFotoFinderApp.mediaContent2DbUpdateService.clearMediaCopy(); } - FotoSql.setMediaDBApi(mediaDBContentprovider); - AndroFotoFinderApp.mediaDbUpdater = null; + FotoSql.setMediaDBApi(mediaContentproviderRepository); + AndroFotoFinderApp.mediaContent2DbUpdateService = null; } } } @@ -164,8 +166,8 @@ public static RefWatcher getRefWatcher(Context context) { LibGlobal.LOG_TAG, ThumbNailUtils.LOG_TAG, IMapView.LOGTAG, ExifInterface.LOG_TAG, PhotoPropertiesImageReader.LOG_TAG, FotoSql.LOG_TAG, - MediaImageDbReplacement.LOG_TAG, - ContentProviderMediaImpl.LOG_TAG) { + MediaDBRepository.LOG_TAG, + MediaContentproviderRepositoryImpl.LOG_TAG) { @Override public void uncaughtException(Thread thread, Throwable ex) { diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java b/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java index 883c4402..f14871b1 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/FotoGalleryActivity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018 by k3b. + * Copyright (c) 2015-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -208,7 +208,7 @@ public boolean onOptionsItemSelected(MenuItem item) { AboutDialogPreference.createAboutDialog(this).show(); return true; case R.id.cmd_db_reload: - AndroFotoFinderApp.getMediaDbUpdater().rebuild(this, null); + AndroFotoFinderApp.getMediaContent2DbUpdateService().rebuild(this, null); return true; case R.id.cmd_more: new Handler().postDelayed(new Runnable() { diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java index 16e54560..13e7fe8f 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019 by k3b. + * Copyright (c) 2015-2020 by k3b. * * This file is part of AndroFotoFinder. * @@ -33,7 +33,7 @@ import java.util.Date; import java.util.List; -import de.k3b.android.androFotoFinder.queries.ContentProviderMediaImpl; +import de.k3b.android.androFotoFinder.queries.MediaContentproviderRepositoryImpl; import de.k3b.android.androFotoFinder.tagDB.TagSql; import de.k3b.android.widget.ActivityWithCallContext; import de.k3b.database.QueryParameter; @@ -138,7 +138,7 @@ private static void appendExifInfo(StringBuilder result, Activity context, Strin if (currentImageId != 0) { - ContentValues dbContent = ContentProviderMediaImpl.getDbContent(context, currentImageId); + ContentValues dbContent = MediaContentproviderRepositoryImpl.getDbContent(context, currentImageId); if (dbContent != null) { result.append(NL).append(line).append(NL); result.append(NL).append(TagSql.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE).append(NL).append(NL); diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/DatabaseHelper.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/DatabaseHelper.java index 5a983f79..18c44a81 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/DatabaseHelper.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/DatabaseHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 by k3b. + * Copyright (c) 2017-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -52,7 +52,7 @@ public static SQLiteDatabase getWritableDatabase(Context context) { } public static void version2Upgrade_RecreateMediDbCopy(final SQLiteDatabase db) { - for (String sql : MediaImageDbReplacement.Impl.DDL) { + for (String sql : MediaDBRepository.Impl.DDL) { db.execSQL(sql); } } diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java index dee35020..de044b7c 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/FotoSql.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019 by k3b. + * Copyright (c) 2015-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -279,13 +279,13 @@ public class FotoSql extends FotoSqlBase { */ private static final int SIZE_TRANLATION_LIMIT = SIZE_K * 10; - private static IMediaDBApi mediaDBApi; + private static IMediaRepositoryApi mediaDBApi; - public static IMediaDBApi getMediaDBApi() { + public static IMediaRepositoryApi getMediaDBApi() { return FotoSql.mediaDBApi; } - public static void setMediaDBApi(IMediaDBApi mediaDBApi) { + public static void setMediaDBApi(IMediaRepositoryApi mediaDBApi) { FotoSql.mediaDBApi = mediaDBApi; } diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaDBApi.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaRepositoryApi.java similarity index 95% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaDBApi.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaRepositoryApi.java index 8a9f67ed..b82e1d5f 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaDBApi.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/IMediaRepositoryApi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 by k3b. + * Copyright (c) 2019-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -27,9 +27,9 @@ import de.k3b.io.VISIBILITY; /** - * media database api + * RepositoryApi for media database access. */ -public interface IMediaDBApi { +public interface IMediaRepositoryApi { Cursor createCursorForQuery( StringBuilder out_debugMessage, String dbgContext, QueryParameter parameters, VISIBILITY visibility, CancellationSignal cancellationSignal); diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBUpdater.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContent2DBUpdateService.java similarity index 64% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBUpdater.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContent2DBUpdateService.java index 146eded6..bcee5576 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBUpdater.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContent2DBUpdateService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 by k3b. + * Copyright (c) 2019-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -19,33 +19,53 @@ package de.k3b.android.androFotoFinder.queries; import android.content.Context; +import android.database.ContentObserver; import android.database.sqlite.SQLiteDatabase; +import android.net.Uri; import android.widget.Toast; import java.util.Date; import de.k3b.io.IProgessListener; -public class MediaDBUpdater { +/** + * #155: takes care that chages from + * {@link MediaContentproviderRepository} are transfered to {@link MediaDBRepository} + */ +public class MediaContent2DBUpdateService { private final Context context; private final SQLiteDatabase writableDatabase; - public MediaDBUpdater(Context context, SQLiteDatabase writableDatabase) { + // called when image-/file-mediacontent has changed to indicate that data must + // be loaded from content-provider to content-copy + private static final ContentObserver mMediaObserverDirectory = new ContentObserver(null) { + + // ignore version with 3rd param: int userId + @Override + public void onChange(boolean selfChange, Uri uri) { + super.onChange(selfChange, uri); + + } + }; + + public MediaContent2DBUpdateService(Context context, SQLiteDatabase writableDatabase) { this.context = context; this.writableDatabase = writableDatabase; } + public void clearMediaCopy() { + DatabaseHelper.version2Upgrade_RecreateMediDbCopy(writableDatabase); + } + public void rebuild(Context context, IProgessListener progessListener) { long start = new Date().getTime(); clearMediaCopy(); - MediaImageDbReplacement.Impl.updateMedaiCopy(context, writableDatabase, null, progessListener); + MediaDBRepository.Impl.updateMedaiCopy(context, writableDatabase, null, progessListener); start = (new Date().getTime() - start) / 1000; final String text = "load db " + start + " secs"; Toast.makeText(context, text, Toast.LENGTH_LONG).show(); if (progessListener != null) progessListener.onProgress(0, 0, text); } - public void clearMediaCopy() { - DatabaseHelper.version2Upgrade_RecreateMediDbCopy(writableDatabase); - } + } diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBContentprovider.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepository.java similarity index 81% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBContentprovider.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepository.java index 6285254d..f599c1d4 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBContentprovider.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 by k3b. + * Copyright (c) 2019-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -28,12 +28,14 @@ import de.k3b.io.VISIBILITY; /** + * Access Media Data through Android media contentprovider. + * * Implementation of Context.getContentResolver()-ContentProvider based media api */ -public class MediaDBContentprovider implements IMediaDBApi { +public class MediaContentproviderRepository implements IMediaRepositoryApi { private final Context context; - public MediaDBContentprovider(final Context context) { + public MediaContentproviderRepository(final Context context) { this.context = context; } @@ -41,7 +43,7 @@ public MediaDBContentprovider(final Context context) { public Cursor createCursorForQuery( StringBuilder out_debugMessage, String dbgContext, QueryParameter parameters, VISIBILITY visibility, CancellationSignal cancellationSignal) { - return ContentProviderMediaImpl.createCursorForQuery( + return MediaContentproviderRepositoryImpl.createCursorForQuery( out_debugMessage, dbgContext, context, parameters, visibility, cancellationSignal); } @@ -49,7 +51,7 @@ public Cursor createCursorForQuery( public Cursor createCursorForQuery(StringBuilder out_debugMessage, String dbgContext, final String from, final String sqlWhereStatement, final String[] sqlWhereParameters, final String sqlSortOrder, CancellationSignal cancellationSignal, final String... sqlSelectColums) { - return ContentProviderMediaImpl.createCursorForQuery( + return MediaContentproviderRepositoryImpl.createCursorForQuery( out_debugMessage, dbgContext, context, from, sqlWhereStatement, sqlWhereParameters, sqlSortOrder, null, sqlSelectColums); } @@ -66,7 +68,7 @@ public int execUpdate(String dbgContext, String path, ContentValues values, VISI @Override public int exexUpdateImpl(String dbgContext, ContentValues values, String sqlWhere, String[] selectionArgs) { - return ContentProviderMediaImpl.exexUpdateImpl(dbgContext, context, values, sqlWhere, selectionArgs); + return MediaContentproviderRepositoryImpl.exexUpdateImpl(dbgContext, context, values, sqlWhere, selectionArgs); } /** @@ -77,7 +79,7 @@ public Long insertOrUpdateMediaDatabase(String dbgContext, String dbUpdateFilterJpgFullPathName, ContentValues values, VISIBILITY visibility, Long updateSuccessValue) { - return ContentProviderMediaImpl.insertOrUpdateMediaDatabase(dbgContext, context, + return MediaContentproviderRepositoryImpl.insertOrUpdateMediaDatabase(dbgContext, context, dbUpdateFilterJpgFullPathName, values, visibility, updateSuccessValue); @@ -88,7 +90,7 @@ public Long insertOrUpdateMediaDatabase(String dbgContext, */ @Override public Uri execInsert(String dbgContext, ContentValues values) { - return ContentProviderMediaImpl.execInsert(dbgContext, context, values); + return MediaContentproviderRepositoryImpl.execInsert(dbgContext, context, values); } /** @@ -96,12 +98,12 @@ public Uri execInsert(String dbgContext, ContentValues values) { */ @Override public int deleteMedia(String dbgContext, String where, String[] selectionArgs, boolean preventDeleteImageFile) { - return ContentProviderMediaImpl.deleteMedia(dbgContext, context, where, selectionArgs, preventDeleteImageFile); + return MediaContentproviderRepositoryImpl.deleteMedia(dbgContext, context, where, selectionArgs, preventDeleteImageFile); } @Override public ContentValues getDbContent(final long id) { - return ContentProviderMediaImpl.getDbContent(context, id); + return MediaContentproviderRepositoryImpl.getDbContent(context, id); } @Override diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepositoryImpl.java similarity index 98% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepositoryImpl.java index a9cd82b2..65716b03 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/ContentProviderMediaImpl.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaContentproviderRepositoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019 by k3b. + * Copyright (c) 2015-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -40,9 +40,9 @@ /** * Static Implementation of Context.getContentResolver()-ContentProvider based media api */ -public class ContentProviderMediaImpl { +public class MediaContentproviderRepositoryImpl { public static final String LOG_TAG = FotoSql.LOG_TAG + "Content"; - private static final String MODUL_NAME = ContentProviderMediaImpl.class.getName(); + private static final String MODUL_NAME = MediaContentproviderRepositoryImpl.class.getName(); public static Cursor createCursorForQuery( StringBuilder out_debugMessage, String dbgContext, final Context context, diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBRepository.java similarity index 97% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBRepository.java index caa409f5..330816ba 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaImageDbReplacement.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBRepository.java @@ -61,19 +61,21 @@ import static de.k3b.android.androFotoFinder.tagDB.TagSql.SQL_COL_EXT_XMP_LAST_MODIFIED_DATE; /** + * Access Media Data through stand alone database-table. + * * Since Android-10 (api 29) using sqLite functions as content-provider-columns is not possible anymore. * Therefore apm uses a copy of contentprovider MediaStore.Images with same column names. */ -public class MediaImageDbReplacement implements IMediaDBApi { +public class MediaDBRepository implements IMediaRepositoryApi { public static final String LOG_TAG = FotoSql.LOG_TAG + "DB"; // #155 public static final boolean debugEnabledSqlRefresh = true; - private static final String MODUL_NAME = ContentProviderMediaImpl.class.getName(); + private static final String MODUL_NAME = MediaContentproviderRepositoryImpl.class.getName(); private final SQLiteDatabase db; - public MediaImageDbReplacement(SQLiteDatabase db) { + public MediaDBRepository(SQLiteDatabase db) { this.db = db; } @@ -328,8 +330,8 @@ public long getCurrentUpdateId() { @Override public boolean mustRequery(long updateId) { final boolean modified = currentUpdateId != updateId; - if (modified && MediaImageDbReplacement.debugEnabledSqlRefresh) { - Log.i(MediaImageDbReplacement.LOG_TAG, "mustRequery: true because of " + currentUpdateReason); + if (modified && MediaDBRepository.debugEnabledSqlRefresh) { + Log.i(MediaDBRepository.LOG_TAG, "mustRequery: true because of " + currentUpdateReason); } return modified; } @@ -588,7 +590,7 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU if (progessListener != null) progessListener.onProgress(progress, 0, context.getString(R.string.load_db_menu_title)); - c = ContentProviderMediaImpl.createCursorForQuery(null, "updateMedaiCopy-source", context, + c = MediaContentproviderRepositoryImpl.createCursorForQuery(null, "updateMedaiCopy-source", context, query, null, null); itemCount = c.getCount(); @@ -625,7 +627,7 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU db.setTransactionSuccessful(); // This commits the transaction if there were no exceptions if (Global.debugEnabledSql) { java.util.Date endTime = new java.util.Date(); - final String message = "MediaImageDbReplacement.updateMedaiCopy(inserted:" + insertCout + + final String message = "MediaDBRepository.updateMedaiCopy(inserted:" + insertCout + ", updated:" + updateCount + ", toal:" + progress + " / " + itemCount + @@ -635,7 +637,7 @@ public static int updateMedaiCopy(Context context, SQLiteDatabase db, Date lastU } } catch (Exception ex) { java.util.Date endTime = new java.util.Date(); - final String message = "MediaImageDbReplacement.updateMedaiCopy(inserted:" + insertCout + + final String message = "MediaDBRepository.updateMedaiCopy(inserted:" + insertCout + ", updated:" + updateCount + ", toal:" + progress + " / " + itemCount + diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBApiWrapper.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaRepositoryApiWrapper.java similarity index 88% rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBApiWrapper.java rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaRepositoryApiWrapper.java index 29743daf..702de338 100644 --- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaDBApiWrapper.java +++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MediaRepositoryApiWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 by k3b. + * Copyright (c) 2019-2020 by k3b. * * This file is part of AndroFotoFinder / #APhotoManager. * @@ -28,25 +28,25 @@ import de.k3b.media.IPhotoProperties; /** - * (Default) Implementation of {@link IMediaDBApi} to forward all methods to an inner child {@link IPhotoProperties}. + * (Default) Implementation of {@link IMediaRepositoryApi} to forward all methods to an inner child {@link IPhotoProperties}. *
* Created by k3b on 30.11.2019.
*/
-public class MediaDBApiWrapper implements IMediaDBApi {
- protected final IMediaDBApi readChild;
- protected final IMediaDBApi writeChild;
- protected final IMediaDBApi transactionChild;
+public class MediaRepositoryApiWrapper implements IMediaRepositoryApi {
+ protected final IMediaRepositoryApi readChild;
+ protected final IMediaRepositoryApi writeChild;
+ protected final IMediaRepositoryApi transactionChild;
/**
* count the non path write calls
*/
private int modifyCount = 0;
- public MediaDBApiWrapper(IMediaDBApi child) {
+ public MediaRepositoryApiWrapper(IMediaRepositoryApi child) {
this(child, child, child);
}
- public MediaDBApiWrapper(IMediaDBApi readChild, IMediaDBApi writeChild, IMediaDBApi transactionChild) {
+ public MediaRepositoryApiWrapper(IMediaRepositoryApi readChild, IMediaRepositoryApi writeChild, IMediaRepositoryApi transactionChild) {
this.readChild = readChild;
this.writeChild = writeChild;
this.transactionChild = transactionChild;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaDB.java b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaRepository.java
similarity index 93%
rename from app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaDB.java
rename to app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaRepository.java
index 88733f90..f8f31800 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaDB.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/queries/MergedMediaRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 by k3b.
+ * Copyright (c) 2019-2020 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -30,11 +30,11 @@
* Since Android-10 (api 29) using sqLite functions as content-provider-columns is not possible anymore.
* Therefore apm uses a copy of contentprovider MediaStore.Images with same column names and same pk.
*/
-public class MergedMediaDB extends MediaDBApiWrapper {
- private final IMediaDBApi database;
- private final IMediaDBApi contentProvider;
+public class MergedMediaRepository extends MediaRepositoryApiWrapper {
+ private final IMediaRepositoryApi database;
+ private final IMediaRepositoryApi contentProvider;
- public MergedMediaDB(IMediaDBApi database, IMediaDBApi contentProvider) {
+ public MergedMediaRepository(IMediaRepositoryApi database, IMediaRepositoryApi contentProvider) {
super(database, contentProvider, database);
this.database = database;
this.contentProvider = contentProvider;
diff --git a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
index 475b0e3d..b1629047 100644
--- a/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
+++ b/app/src/main/java/de/k3b/android/androFotoFinder/tagDB/TagWorflow.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 by k3b.
+ * Copyright (c) 2017-2020 by k3b.
*
* This file is part of AndroFotoFinder / #APhotoManager.
*
@@ -30,7 +30,7 @@
import de.k3b.android.androFotoFinder.Global;
import de.k3b.android.androFotoFinder.queries.FotoSql;
-import de.k3b.android.androFotoFinder.queries.IMediaDBApi;
+import de.k3b.android.androFotoFinder.queries.IMediaRepositoryApi;
import de.k3b.android.util.AndroidFileCommands;
import de.k3b.io.FileCommands;
import de.k3b.io.IProgessListener;
@@ -80,7 +80,7 @@ public TagWorflow init(Activity context, SelectedFiles selectedItems, List