fix encoding crashes

This commit is contained in:
Alexey Kuznetsov 2020-11-27 22:49:16 +03:00
commit c4fb7126f3
5 changed files with 5 additions and 3 deletions

View file

@ -53,7 +53,7 @@ android {
dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.github.axet:android-audio-library:1.0.177' // implementation project(':android-audio-library')
implementation 'com.github.axet:android-audio-library:1.0.178' // implementation project(':android-audio-library')
implementation ('com.github.axet:wget:1.6.1') { exclude group: 'org.json', module: 'json' }
assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' }
}

View file

@ -205,6 +205,7 @@ public class MainActivity extends AppCompatThemeActivity {
public void close() {
synchronized (encodings.handlers) {
encodings.handlers.remove(this);
removeCallbacksAndMessages(null);
}
}

View file

@ -107,7 +107,7 @@ public class SettingsActivity extends AppCompatSettingsThemeActivity implements
if (key.equals(AudioApplication.PREFERENCE_RATE)) {
int sampleRate = Integer.parseInt(sharedPreferences.getString(AudioApplication.PREFERENCE_RATE, ""));
if (sampleRate != Sound.getValidRecordRate(Sound.getInMode(this), sampleRate))
Toast.Error(this, "Not supported Hz");
Toast.Text(this, "Not supported Hz");
}
}

View file

@ -191,6 +191,7 @@ public class EncodingService extends PersistentService {
EncodingStorage encodings = ((AudioApplication) getApplication()).encodings;
synchronized (encodings.handlers) {
encodings.handlers.remove(handler);
handler.removeCallbacksAndMessages(null);
}
}

View file

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