stable decoder

This commit is contained in:
Alexey Kuznetsov 2019-07-05 20:45:14 +03:00
commit fcb66ecdf2
3 changed files with 8 additions and 12 deletions

View file

@ -101,20 +101,17 @@ public class SettingsActivity extends AppCompatSettingsThemeActivity implements
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
super.onSharedPreferenceChanged(sharedPreferences, key);
if (key.equals(AudioApplication.PREFERENCE_CONTROLS)) {
if (sharedPreferences.getBoolean(AudioApplication.PREFERENCE_CONTROLS, false)) {
if (sharedPreferences.getBoolean(AudioApplication.PREFERENCE_CONTROLS, false))
RecordingService.start(this);
} else {
RecordingService.stopService(this);
}
else
RecordingService.stop(this);
}
if (key.equals(AudioApplication.PREFERENCE_STORAGE)) {
if (key.equals(AudioApplication.PREFERENCE_STORAGE))
storage.migrateLocalStorageDialog(this);
}
if (key.equals(AudioApplication.PREFERENCE_RATE)) {
int sampleRate = Integer.parseInt(sharedPreferences.getString(AudioApplication.PREFERENCE_RATE, ""));
if (sampleRate != Sound.getValidRecordRate(Sound.getInMode(this), sampleRate)) {
if (sampleRate != Sound.getValidRecordRate(Sound.getInMode(this), sampleRate))
Toast.Error(this, "Not supported Hz");
}
}
}

View file

@ -102,10 +102,10 @@ public class RecordingService extends PersistentService {
start(context);
return;
}
stopService(context);
stop(context);
}
public static void stopService(Context context) {
public static void stop(Context context) {
stop(context, new Intent(context, RecordingService.class));
}
@ -126,7 +126,6 @@ public class RecordingService extends PersistentService {
}
};
optimization.create();
storage = new Storage(this);
}