Better support for revoked audio permissions.

// FREEBIE
pull/1/head
Moxie Marlinspike 9 years ago
parent 79cb6166d5
commit 339d352d6e

@ -3,9 +3,6 @@ package org.thoughtcrime.redphone.audio;
import android.os.Build; import android.os.Build;
import android.util.Log; import android.util.Log;
import org.thoughtcrime.securesms.R;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.DatagramSocket; import java.net.DatagramSocket;
@ -44,9 +41,9 @@ public class CallAudioManager {
public void start() throws AudioException { public void start() throws AudioException {
try { try {
start(handle); start(handle);
} catch (NativeAudioException e) { } catch (NativeAudioException | NoSuchMethodError e) {
Log.w(TAG, e); Log.w(TAG, e);
throw new AudioException("sorry_there_was_a_problem_initializing_the_audio_on_your_device"); throw new AudioException("Sorry, there was a problem initiating the audio on your device.");
} }
} }

@ -1,11 +1,21 @@
package org.thoughtcrime.redphone.audio; package org.thoughtcrime.redphone.audio;
public class NativeAudioException extends Exception { public class NativeAudioException extends Exception {
public NativeAudioException() { public NativeAudioException() {
super(); super();
} }
public NativeAudioException(String message) { public NativeAudioException(String detailMessage) {
super(message); super(detailMessage);
}
public NativeAudioException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
} }
public NativeAudioException(Throwable throwable) {
super(throwable);
}
} }

Loading…
Cancel
Save