add exoloader

This commit is contained in:
Alexey Kuznetsov 2019-04-30 09:00:57 +03:00
commit 579f4ed4a6
5 changed files with 12 additions and 5 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@
/build
/captures
android-library
app/src/main/assets/*.dex

View file

@ -53,6 +53,6 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.github.axet:android-audio-library:1.0.150' // implementation project(':android-audio-library')
implementation 'com.github.axet:android-audio-library:1.0.151' // implementation project(':android-audio-library')
assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' }
}

View file

@ -118,6 +118,12 @@ public class MainActivity extends AppCompatThemeActivity {
receiver.registerReceiver(this);
RecordingService.startIfPending(this);
try {
new Recordings.ExoLoader(this, false);
} catch (Exception e) {
Log.e(TAG, "error", e);
}
}
void checkPending() {
@ -204,7 +210,7 @@ public class MainActivity extends AppCompatThemeActivity {
try {
storage.migrateLocalStorage();
} catch (RuntimeException e) {
} catch (Exception e) {
ErrorDialog.Error(this, e);
}

View file

@ -29,9 +29,9 @@ import com.github.axet.audiolibrary.encoders.FormatFLAC;
import com.github.axet.audiolibrary.encoders.FormatM4A;
import com.github.axet.audiolibrary.encoders.FormatOGG;
import com.github.axet.audiolibrary.encoders.OnFlyEncoding;
import com.github.axet.audiorecorder.BuildConfig;
import com.github.axet.audiorecorder.R;
import com.github.axet.audiorecorder.activities.MainActivity;
import com.github.axet.audiorecorder.services.RecordingService;
import java.io.File;
import java.nio.ShortBuffer;
@ -192,7 +192,7 @@ public class AudioApplication extends com.github.axet.audiolibrary.app.MainAppli
}
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wlcpu = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, RecordingService.class.getCanonicalName() + "_cpulock");
PowerManager.WakeLock wlcpu = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":recordinglock");
wlcpu.acquire();
android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_AUDIO);

View file

@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.github.axet:gradle-android-dx:0.0.4'
}
}