Skip to content

Commit 91eb4b3

Browse files
committed
#155: prepare to fix android10 incompatibility: refactored replace all static method calls of ContentProviderMediaExecuter(ContentProviderMediaImpl) with dynamic Interface IMediaDBApi calls
1 parent 60afb0f commit 91eb4b3

32 files changed

+318
-128
lines changed

app/src/main/java/de/k3b/android/androFotoFinder/AdapterArrayHelper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import java.util.ArrayList;
2727

2828
import de.k3b.android.androFotoFinder.queries.FotoSql;
29+
import de.k3b.io.FileUtils;
2930
import de.k3b.io.VISIBILITY;
3031
import de.k3b.io.collections.SelectedItems;
31-
import de.k3b.io.FileUtils;
3232
import de.k3b.media.PhotoPropertiesUtil;
3333

3434
/**
@@ -47,7 +47,7 @@ public AdapterArrayHelper(Activity context, String fullPhotoPath, String debugCo
4747

4848
if (Global.mustRemoveNOMEDIAfromDB && (mRootDir != null) && (mFullPhotoPaths != null)) {
4949
String parentDirString = mRootDir.getAbsolutePath();
50-
FotoSql.execDeleteByPath(debugContext + " AdapterArrayHelper mustRemoveNOMEDIAfromDB ", context, parentDirString, VISIBILITY.PRIVATE_PUBLIC);
50+
FotoSql.execDeleteByPath(debugContext + " AdapterArrayHelper mustRemoveNOMEDIAfromDB ", parentDirString, VISIBILITY.PRIVATE_PUBLIC);
5151
}
5252
}
5353

app/src/main/java/de/k3b/android/androFotoFinder/AffUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static SelectedFiles querySelectedFiles(Context context, SelectedItems it
122122
List<String> paths = new ArrayList<String>();
123123
List<Date> datesPhotoTaken = new ArrayList<Date>();
124124

125-
if (FotoSql.getFileNames(context, items, ids, paths, datesPhotoTaken) != null) {
125+
if (FotoSql.getFileNames(items, ids, paths, datesPhotoTaken) != null) {
126126
return new SelectedFiles(paths.toArray(new String[paths.size()]), ids.toArray(new Long[ids.size()]), datesPhotoTaken.toArray(new Date[datesPhotoTaken.size()]));
127127
}
128128
}

app/src/main/java/de/k3b/android/androFotoFinder/AndroFotoFinderApp.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import de.k3b.android.androFotoFinder.imagedetail.HugeImageLoader;
3939
import de.k3b.android.androFotoFinder.queries.FotoSql;
4040
import de.k3b.android.androFotoFinder.queries.FotoSqlBase;
41+
import de.k3b.android.androFotoFinder.queries.MediaDBContentprovider;
4142
import de.k3b.android.osmdroid.forge.MapsForgeSupport;
4243
import de.k3b.android.util.LogCat;
4344
import de.k3b.android.widget.ActivityWithCallContext;
@@ -94,6 +95,9 @@ public static RefWatcher getRefWatcher(Context context) {
9495
// StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyDeath().build());
9596
FotoSqlBase.init();
9697

98+
/// #155: todo: depending on android-api version set IMediaDBApi
99+
FotoSql.setMediaDBApi(new MediaDBContentprovider(this));
100+
97101
super.onCreate();
98102

99103
LibGlobal.appName = getString(R.string.app_name);
@@ -165,7 +169,7 @@ private File getOutpuFile() {
165169
// #60: configure some of the mapsforge settings first
166170
MapsForgeSupport.createInstance(this);
167171

168-
FotoSql.deleteMediaWithNullPath(this);
172+
FotoSql.deleteMediaWithNullPath();
169173

170174
Log.i(Global.LOG_CONTEXT, getAppId() + " created");
171175
}

app/src/main/java/de/k3b/android/androFotoFinder/PhotoAutoprocessingEditActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ private SelectedFiles getSelectedFiles(String dbgContext, Intent intent, boolean
591591
if (itemCount > 0) {
592592
if ((mustLoadIDs) && (ids == null)) {
593593
ids = new Long[itemCount];
594-
Map<String, Long> idMap = FotoSql.execGetPathIdMap(this, fileNames);
594+
Map<String, Long> idMap = FotoSql.execGetPathIdMap(fileNames);
595595

596596
for (int i = 0; i < itemCount; i++) {
597597
ids[i] = idMap.get(fileNames[i]);

app/src/main/java/de/k3b/android/androFotoFinder/PhotoPropertiesEditActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private static SelectedFiles getSelectedFiles(String dbgContext, Context ctx, In
284284
if (itemCount > 0) {
285285
if ((mustLoadIDs) && (ids == null)) {
286286
ids = new Long[itemCount];
287-
Map<String, Long> idMap = FotoSql.execGetPathIdMap(ctx, fileNames);
287+
Map<String, Long> idMap = FotoSql.execGetPathIdMap(fileNames);
288288

289289
for (int i = 0; i < itemCount; i++) {
290290
ids[i] = idMap.get(fileNames[i]);

app/src/main/java/de/k3b/android/androFotoFinder/backup/Backup2ZipService.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import de.k3b.android.androFotoFinder.Global;
3232
import de.k3b.android.androFotoFinder.R;
3333
import de.k3b.android.androFotoFinder.media.PhotoPropertiesMediaDBCursor;
34-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
3534
import de.k3b.android.androFotoFinder.queries.FotoSql;
3635
import de.k3b.android.androFotoFinder.tagDB.TagSql;
3736
import de.k3b.database.QueryParameter;
@@ -210,8 +209,8 @@ private void execQuery(QueryParameter query,
210209
Cursor cursor = null;
211210
try {
212211
this.onProgress(0,0, "Calculate");
213-
cursor = ContentProviderMediaExecuter.createCursorForQuery(
214-
null, "ZipExecute", context,
212+
cursor = FotoSql.getMediaDBApi().createCursorForQuery(
213+
null, "ZipExecute",
215214
query, null);
216215

217216
int itemCount = cursor.getCount();

app/src/main/java/de/k3b/android/androFotoFinder/backup/BackupActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private SelectedFiles getSelectedFiles(String dbgContext, Intent intent, boolean
496496
if (itemCount > 0) {
497497
if ((mustLoadIDs) && (ids == null)) {
498498
ids = new Long[itemCount];
499-
Map<String, Long> idMap = FotoSql.execGetPathIdMap(this, fileNames);
499+
Map<String, Long> idMap = FotoSql.execGetPathIdMap(fileNames);
500500

501501
for (int i = 0; i < itemCount; i++) {
502502
ids[i] = idMap.get(fileNames[i]);
@@ -702,7 +702,7 @@ private void updateHistory(QueryParameter query) {
702702

703703
paths.add(DCIM_ROOT);
704704

705-
String minFolder = FotoSql.getMinFolder(getApplicationContext(), query, true);
705+
String minFolder = FotoSql.getMinFolder(query, true);
706706
updateHistory(FileUtils.getDir(minFolder), filenames, paths, 1);
707707

708708
String queryFolder = FotoSql.getFilePath(query, false);

app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryLoaderTask.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.List;
2929

3030
import de.k3b.android.androFotoFinder.Global;
31-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
3231
import de.k3b.android.androFotoFinder.queries.FotoSql;
3332
import de.k3b.database.QueryParameter;
3433
import de.k3b.io.Directory;
@@ -102,8 +101,8 @@ protected IDirectory doInBackground(QueryParameter... queryParameter) {
102101
}
103102

104103
try {
105-
cursor = ContentProviderMediaExecuter.createCursorForQuery(
106-
null, "ZipExecute", context,
104+
cursor = FotoSql.getMediaDBApi().createCursorForQuery(
105+
null, "ZipExecute",
107106
queryParameters, null);
108107

109108
int itemCount = cursor.getCount();

app/src/main/java/de/k3b/android/androFotoFinder/directory/DirectoryPickerFragment.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import de.k3b.android.androFotoFinder.ThumbNailUtils;
6363
import de.k3b.android.androFotoFinder.backup.BackupActivity;
6464
import de.k3b.android.androFotoFinder.imagedetail.ImageDetailMetaDialogBuilder;
65-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
6665
import de.k3b.android.androFotoFinder.queries.FotoSql;
6766
import de.k3b.android.androFotoFinder.queries.FotoThumbSql;
6867
import de.k3b.android.androFotoFinder.queries.FotoViewerParameter;
@@ -545,7 +544,7 @@ private void onDeleteAnswer(File file, IDirectory dir) {
545544
}
546545

547546
// delete from database
548-
if (FotoSql.deleteMedia("delete album", getActivity(),
547+
if (FotoSql.deleteMedia("delete album",
549548
ListUtils.toStringList(file.getAbsolutePath()),false) > 0) {
550549
deleteSuccess = true;
551550
}
@@ -664,11 +663,11 @@ private boolean fixLinks(IDirectory linkDir) {
664663
if (!canonicalPath.endsWith("/")) canonicalPath+="/";
665664

666665
String sqlWhereLink = FotoSql.SQL_COL_PATH + " like '" + linkPath + "%'";
667-
SelectedFiles linkFiles = FotoSql.getSelectedfiles(context, sqlWhereLink, VISIBILITY.PRIVATE_PUBLIC);
666+
SelectedFiles linkFiles = FotoSql.getSelectedfiles(sqlWhereLink, VISIBILITY.PRIVATE_PUBLIC);
668667

669668
String sqlWhereCanonical = FotoSql.SQL_COL_PATH + " in (" + linkFiles.toString() + ")";
670669
sqlWhereCanonical = sqlWhereCanonical.replace(linkPath,canonicalPath);
671-
SelectedFiles canonicalFiles = FotoSql.getSelectedfiles(context, sqlWhereCanonical, VISIBILITY.PRIVATE_PUBLIC);
670+
SelectedFiles canonicalFiles = FotoSql.getSelectedfiles(sqlWhereCanonical, VISIBILITY.PRIVATE_PUBLIC);
672671
HashMap<String, String> link2canonical = new HashMap<String, String>();
673672
for(String cann : canonicalFiles.getFileNames()) {
674673
link2canonical.put(linkPath + cann.substring(canonicalPath.length()), cann);
@@ -693,9 +692,9 @@ private boolean fixLinks(IDirectory linkDir) {
693692
if (cann == null) {
694693
// rename linkFile to canonicalFile
695694
updateValues.put(FotoSql.SQL_COL_PATH, canonicalPath + lin.substring(linkPath.length()));
696-
ContentProviderMediaExecuter.execUpdate("fixLinks", context, linkIds[i].intValue(), updateValues);
695+
FotoSql.getMediaDBApi().execUpdate("fixLinks", linkIds[i].intValue(), updateValues);
697696
} else {
698-
ContentProviderMediaExecuter.deleteMedia("DirectoryPickerFragment.fixLinks", context, FotoSql.FILTER_COL_PK, new String[]{linkIds[i].toString()}, true);
697+
FotoSql.getMediaDBApi().deleteMedia("DirectoryPickerFragment.fixLinks", FotoSql.FILTER_COL_PK, new String[]{linkIds[i].toString()}, true);
699698
}
700699
}
701700
PhotoPropertiesMediaFilesScanner.notifyChanges(context, "Fixed link/canonical duplicates");

app/src/main/java/de/k3b/android/androFotoFinder/directory/ShowInMenuHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private long getPickCount(String dbgContext,
134134
QueryParameter query = AndroidAlbumUtils.getAsAlbumOrMergedNewQuery(
135135
dbgContext, mContext, baseQuery, filter);
136136
if (query == null) return 0;
137-
return FotoSql.getCount(mContext, query);
137+
return FotoSql.getCount(query);
138138
}
139139

140140
private boolean showPhoto(String dbgContext, QueryParameter baseQuery) {
@@ -162,7 +162,7 @@ private boolean showMap(String dbgContext, QueryParameter baseQuery) {
162162
QueryParameter query = AndroidAlbumUtils.getAsAlbumOrMergedNewQuery(
163163
dbgContext, mContext, baseQuery, currentSelectionFilter);
164164
if (query != null) {
165-
IGeoRectangle area = FotoSql.execGetGeoRectangle(null, mContext, query,
165+
IGeoRectangle area = FotoSql.execGetGeoRectangle(null, query,
166166
null, "Calculate visible arean", dbgContext);
167167
MapGeoPickerActivity.showActivity(dbgContext, mContext, null,
168168
query, area, 0);

app/src/main/java/de/k3b/android/androFotoFinder/gallery/cursor/GalleryCursorFragment.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
import de.k3b.android.androFotoFinder.imagedetail.ImageDetailMetaDialogBuilder;
7272
import de.k3b.android.androFotoFinder.locationmap.GeoEditActivity;
7373
import de.k3b.android.androFotoFinder.locationmap.MapGeoPickerActivity;
74-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
7574
import de.k3b.android.androFotoFinder.queries.FotoSql;
7675
import de.k3b.android.androFotoFinder.queries.FotoViewerParameter;
7776
import de.k3b.android.androFotoFinder.queries.Queryable;
@@ -1153,7 +1152,7 @@ private Uri getUri(Activity parent, long id) {
11531152
Uri resultUri = null;
11541153
if (mModePickGeoElsePickImaage) {
11551154
// mode pick gep
1156-
IGeoPoint initialPoint = FotoSql.execGetPosition(null, parent,
1155+
IGeoPoint initialPoint = FotoSql.execGetPosition(null,
11571156
null, id, mDebugPrefix, "getSelectedUri");
11581157

11591158
if (initialPoint != null) {
@@ -1417,7 +1416,7 @@ private void onDuplicatesFound(SelectedItems selectedItems, StringBuffer debugMe
14171416

14181417
String sqlWhere = query.toAndroidWhere(); // + " OR " + FotoSql.SQL_COL_PATH + " is null";
14191418
try {
1420-
delCount = ContentProviderMediaExecuter.deleteMedia(mDebugPrefix + "onDuplicatesFound", activity, sqlWhere, null, true);
1419+
delCount = FotoSql.getMediaDBApi().deleteMedia(mDebugPrefix + "onDuplicatesFound", sqlWhere, null, true);
14211420
} catch (Exception ex) {
14221421
Log.w(Global.LOG_CONTEXT, "deleteMedia via update failed for 'where " + sqlWhere +
14231422
"'.");

app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailActivityViewPager.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ private static int updateIncompleteMediaDatabase(String debugPrefix, Context con
800800
String dbPathSearch = null;
801801
ArrayList<String> missing = new ArrayList<String>();
802802
dbPathSearch = dirToScan.getPath() + "/%";
803-
List<String> known = FotoSql.execGetFotoPaths(context, dbPathSearch);
803+
List<String> known = FotoSql.execGetFotoPaths(dbPathSearch);
804804
File[] existing = dirToScan.listFiles();
805805

806806
if (existing != null) {
@@ -973,7 +973,7 @@ public boolean onOptionsItemSelected(MenuItem menuItem) {
973973

974974
case R.id.cmd_show_geo_as: {
975975
final long imageId = getCurrentImageId();
976-
IGeoPoint _geo = FotoSql.execGetPosition(null, this,
976+
IGeoPoint _geo = FotoSql.execGetPosition(null,
977977
null, imageId, mDebugPrefix, "on cmd_show_geo_as");
978978
final String currentFilePath = getCurrentFilePath();
979979
GeoPointDto geo = new GeoPointDto(_geo.getLatitude(), _geo.getLongitude(), GeoPointDto.NO_ZOOM);

app/src/main/java/de/k3b/android/androFotoFinder/imagedetail/ImageDetailMetaDialogBuilder.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import java.util.Date;
3434
import java.util.List;
3535

36-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
36+
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaImpl;
3737
import de.k3b.android.androFotoFinder.tagDB.TagSql;
3838
import de.k3b.android.widget.ActivityWithCallContext;
3939
import de.k3b.database.QueryParameter;
@@ -138,7 +138,7 @@ private static void appendExifInfo(StringBuilder result, Activity context, Strin
138138

139139
if (currentImageId != 0) {
140140

141-
ContentValues dbContent = ContentProviderMediaExecuter.getDbContent(context, currentImageId);
141+
ContentValues dbContent = ContentProviderMediaImpl.getDbContent(context, currentImageId);
142142
if (dbContent != null) {
143143
result.append(NL).append(line).append(NL);
144144
result.append(NL).append(TagSql.SQL_TABLE_EXTERNAL_CONTENT_URI_FILE).append(NL).append(NL);

app/src/main/java/de/k3b/android/androFotoFinder/locationmap/LocationMapFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ private boolean zoomToFit(IGeoPoint geoCenterPoint, Object... dbgContext) {
11201120
QueryParameter baseQuery = getQueryForPositionRectangle(geoCenterPoint);
11211121
BoundingBox boundingBox = null;
11221122

1123-
IGeoRectangle fittingRectangle = FotoSql.execGetGeoRectangle(null, this.getActivity(),
1123+
IGeoRectangle fittingRectangle = FotoSql.execGetGeoRectangle(null,
11241124
baseQuery, null, mDebugPrefix, "zoomToFit", dbgContext);
11251125
double delta = getDelta(fittingRectangle);
11261126
if ((geoCenterPoint != null) && (delta < 1e-6)) {
@@ -1194,7 +1194,7 @@ private double getMarkerDelta() {
11941194

11951195
private IGeoPoint getGeoPointById(int markerId, IGeoPoint notFoundValue, Object... dbgContext) {
11961196
if (markerId != NO_MARKER_ID) {
1197-
IGeoPoint pos = FotoSql.execGetPosition(null, this.getActivity(),
1197+
IGeoPoint pos = FotoSql.execGetPosition(null,
11981198
null, markerId, mDebugPrefix, "getGeoPointById", dbgContext);
11991199
if (pos != null) {
12001200
return pos;

app/src/main/java/de/k3b/android/androFotoFinder/locationmap/MapGeoPickerActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static void showActivity(String debugContext, Activity context, SelectedF
9494
}
9595

9696
if (AffUtils.putSelectedFiles(intent, selectedItems)) {
97-
IGeoPoint initialPoint = FotoSql.execGetPosition(null, context,
97+
IGeoPoint initialPoint = FotoSql.execGetPosition(null,
9898
null, selectedItems.getId(0), context, mDebugPrefix, "showActivity");
9999
if (initialPoint != null) {
100100
GeoUri PARSER = new GeoUri(GeoUri.OPT_PARSE_INFER_MISSING);

app/src/main/java/de/k3b/android/androFotoFinder/locationmap/MarkerLoaderTask.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
import de.k3b.android.androFotoFinder.Global;
3535
import de.k3b.android.androFotoFinder.R;
36-
import de.k3b.android.androFotoFinder.queries.ContentProviderMediaExecuter;
3736
import de.k3b.android.androFotoFinder.queries.FotoSql;
3837
import de.k3b.android.osmdroid.ClickableIconOverlay;
3938
import de.k3b.android.osmdroid.IconFactory;
@@ -96,8 +95,8 @@ protected OverlayManager doInBackground(QueryParameter... queryParameter) {
9695

9796
Cursor cursor = null;
9897
try {
99-
cursor = ContentProviderMediaExecuter.createCursorForQuery(
100-
null, "MakerLoader", mContext,
98+
cursor = FotoSql.getMediaDBApi().createCursorForQuery(
99+
null, "MakerLoader",
101100
queryParameters, null);
102101

103102
int itemCount = cursor.getCount();

app/src/main/java/de/k3b/android/androFotoFinder/locationmap/PickerLocationMapFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected void onOk() {
170170

171171
Activity activity = getActivity();
172172
if (mMarkerId != NO_MARKER_ID) {
173-
result = FotoSql.execGetPosition(null, activity, null, mMarkerId,
173+
result = FotoSql.execGetPosition(null, null, mMarkerId,
174174
mDebugPrefix,"onOk");
175175
}
176176

app/src/main/java/de/k3b/android/androFotoFinder/media/PhotoPropertiesMediaDBCsvImportActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
package de.k3b.android.androFotoFinder.media;
2121

22+
import android.app.Activity;
2223
import android.content.ContentValues;
2324
import android.content.Intent;
2425
import android.net.Uri;
2526
import android.os.AsyncTask;
2627
import android.os.Bundle;
27-
import android.app.Activity;
2828
import android.util.Log;
2929
import android.view.View;
3030
import android.widget.TextView;
@@ -206,7 +206,7 @@ private void updateDB(String dbgContext, String _path, long xmlLastFileModifyDat
206206

207207
TagSql.setFileModifyDate(dbValues, new Date().getTime() / 1000);
208208

209-
mUpdateCount += TagSql.execUpdate(dbgContext, PhotoPropertiesMediaDBCsvImportActivity.this, path, xmlLastFileModifyDate, dbValues, VISIBILITY.PRIVATE_PUBLIC);
209+
mUpdateCount += TagSql.execUpdate(dbgContext, path, xmlLastFileModifyDate, dbValues, VISIBILITY.PRIVATE_PUBLIC);
210210
mItemCount++;
211211
}
212212
}

app/src/main/java/de/k3b/android/androFotoFinder/queries/AndroidAlbumUtils.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static QueryParameter getQueryFromUriOrNull(
155155

156156
QueryParameter query = QueryParameter.load(context.getContentResolver().openInputStream(uri));
157157
if (query != null) {
158-
Map<String, Long> found = FotoSql.execGetPathIdMap(context, path);
158+
Map<String, Long> found = FotoSql.execGetPathIdMap(path);
159159
if ((found == null) || (found.size() == 0)) {
160160
AndroidAlbumUtils.albumMediaScan(dbgContext + " not found mediadb => ", context, new File(path), 1);
161161
}
@@ -368,7 +368,7 @@ public static void insertToMediaDB(String dbgContext, @NonNull Context context,
368368
ContentValues values = new ContentValues();
369369
String newAbsolutePath = PhotoPropertiesMediaFilesScanner.setFileFields(values, fileToBeScannedAndInserted);
370370
values.put(FotoSql.SQL_COL_EXT_MEDIA_TYPE, FotoSql.MEDIA_TYPE_ALBUM_FILE);
371-
ContentProviderMediaExecuter.insertOrUpdateMediaDatabase(dbgContext, context, newAbsolutePath, values, null, 1l);
371+
FotoSql.getMediaDBApi().insertOrUpdateMediaDatabase(dbgContext, newAbsolutePath, values, null, 1l);
372372
}
373373
}
374374

@@ -381,7 +381,7 @@ public static int albumMediaScan(String dbgContext, Context context, File _root,
381381
int result = 0;
382382
if (root != null) {
383383
List<String> currentFiles = AlbumFile.getFilePaths(null, root, subDirLevels);
384-
List<String> databaseFiles = FotoSql.getAlbumFiles(context, FileUtils.tryGetCanonicalPath(root, null), subDirLevels);
384+
List<String> databaseFiles = FotoSql.getAlbumFiles(FileUtils.tryGetCanonicalPath(root, null), subDirLevels);
385385

386386
List<String> added = new ArrayList<String>();
387387
List<String> removed = new ArrayList<String>();
@@ -392,7 +392,7 @@ public static int albumMediaScan(String dbgContext, Context context, File _root,
392392
result++;
393393
}
394394

395-
result += FotoSql.deleteMedia(dbgMessage + "delete-obsolete", context, removed, false);
395+
result += FotoSql.deleteMedia(dbgMessage + "delete-obsolete", removed, false);
396396
}
397397
return result;
398398
}

0 commit comments

Comments
 (0)