Better support for revoked audio permissions.

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-10-27 15:14:54 -07:00
parent 79cb6166d5
commit 339d352d6e
2 changed files with 14 additions and 7 deletions

View File

@ -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.");
} }
} }

View File

@ -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);
}
} }