diff --git a/app/build.gradle b/app/build.gradle
index 1974f0c..5be1332 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -53,6 +53,6 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
- implementation 'com.github.axet:android-audio-library:1.0.169' // implementation project(':android-audio-library')
+ implementation 'com.github.axet:android-audio-library:1.0.171' // implementation project(':android-audio-library')
assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' }
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f96d923..09050e2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -58,7 +58,12 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="true"
android:launchMode="singleInstance"
- android:showOnLockScreen="true" />
+ android:showOnLockScreen="true">
+
+
+
+
+
freeE)
+ return internal;
+ else
+ return external;
+ } catch (RuntimeException e) { // samsung devices unable to determine external folders
+ return internal;
+ }
+ }
+
+ public Uri getNewIntentRecording() {
+ SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(context);
+ String ext = shared.getString(AudioApplication.PREFERENCE_ENCODING, "");
+
+ String format = shared.getString(AudioApplication.PREFERENCE_FORMAT, "%s");
+
+ format = getFormatted(format, new Date());
+
+ File f = getIntentEncoding();
+
+ if (!Storage.mkdirs(f))
+ throw new RuntimeException("unable to create: " + f);
+ return Uri.fromFile(getNextFile(f, format, ext));
+ }
+
+ public void deleteTmp() {
+ File internal = getFilesDir(context, SHARE);
+ deleteTmp(internal);
+ File external = context.getExternalFilesDir(SHARE);
+ deleteTmp(external);
+ }
+
+ public void deleteTmp(File dir) {
+ if (dir == null)
+ return;
+ long now = System.currentTimeMillis();
+ File[] ff = dir.listFiles();
+ if (ff == null)
+ return;
+ for (File f : ff) {
+ if (f.isFile() && f.lastModified() + StorageProvider.TIMEOUT < now)
+ Storage.delete(f);
+ }
+ }
+
public File getNewFile(File f, String ext) {
SharedPreferences shared = PreferenceManager.getDefaultSharedPreferences(context);
@@ -66,9 +129,14 @@ public class Storage extends com.github.axet.audiolibrary.app.Storage {
format = getFormatted(format, new Date());
- if (!f.exists() && !f.mkdirs() && !f.exists())
+ if (!Storage.mkdirs(f))
throw new RuntimeException("Unable to create: " + f);
return getNextFile(f, format, ext);
}
+ @Override
+ public void migrateLocalStorage() {
+ super.migrateLocalStorage();
+ deleteTmp();
+ }
}
diff --git a/build.gradle b/build.gradle
index c69d831..42ee91b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.4.2'
+ classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.github.axet:gradle-android-dx:0.0.4'
}
}