Skip to content

Commit 58e5a41

Browse files
committed
Version 1.6.5: fixed an issue with export to the downloads folder
1 parent ede5481 commit 58e5a41

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

MediaPhone/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010

1111
targetSdkVersion 29
1212
minSdkVersion 14
13-
versionCode 46
14-
versionName '1.6.4'
13+
versionCode 47
14+
versionName '1.6.5'
1515
// versionNameSuffix = '-beta-1'
1616
resConfigs 'en', 'es', 'fr', 'nl', 'pt', 'pl', 'ru'
1717
}
@@ -49,7 +49,7 @@ dependencies {
4949
implementation project(':MediaUtilities')
5050

5151
implementation 'com.google.android.material:material:1.2.1' // for overall UI appearance
52-
implementation 'androidx.exifinterface:exifinterface:1.3.1' // for auto-selection of export resolution
52+
implementation 'androidx.exifinterface:exifinterface:1.3.2' // for auto-selection of export resolution
5353
implementation 'androidx.core:core:1.3.2' // for FileProvider
5454
implementation 'androidx.documentfile:documentfile:1.0.1' // for Storage Access Framework
5555
}

MediaPhone/src/main/java/ac/robinson/mediaphone/activity/SaveNarrativeActivity.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,18 +416,25 @@ public void run() {
416416
outputUri = file.getUri();
417417
} else {
418418
ContentValues contentValues = new ContentValues();
419-
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, fileName);
420-
contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH,
419+
contentValues.put(MediaStore.Downloads.DISPLAY_NAME, fileName);
420+
contentValues.put(MediaStore.Downloads.MIME_TYPE, getString(R.string.export_mime_type));
421+
contentValues.put(MediaStore.Downloads.RELATIVE_PATH,
421422
Environment.DIRECTORY_DOWNLOADS + File.separator +
422423
getString(R.string.export_local_directory) +
423424
(uriCount > 1 ? File.separator + outputDirectory.getName() : ""));
425+
contentValues.put(MediaStore.Downloads.IS_PENDING, 1);
424426
outputUri = contentResolver.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, contentValues);
425427
}
426428
if (outputUri != null) {
427429
OutputStream outputStream = null;
428430
try {
429431
outputStream = contentResolver.openOutputStream(outputUri);
430432
IOUtilities.copyFile(mediaFile, outputStream);
433+
if (mUsingDefaultOutputDirectory) { // record that the file is no-longer pending
434+
ContentValues contentValues = new ContentValues();
435+
contentValues.put(MediaStore.Downloads.IS_PENDING, 0);
436+
contentResolver.update(outputUri, contentValues, null, null);
437+
}
431438
} catch (IOException e) {
432439
failure = true;
433440
} finally {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
dependencies {
88
// distributionSha256Sum in gradle-wrapper.properties is also required for F-Droid (see distributionUrl version number)
99
// see: https://gradle.org/release-checksums/
10-
classpath 'com.android.tools.build:gradle:4.1.0'
10+
classpath 'com.android.tools.build:gradle:4.1.2'
1111
}
1212
}
1313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed video export bug on more recent Android versions

0 commit comments

Comments
 (0)