mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 09:08:37 +00:00
Refactor MMS send/download to be synchronous.
1) Make the radio change a synchronous action with a timeout. 2) Move the send logic into an MmsTransport, in preparation for UniversalTransport composition. 3) Move the download logic into a synchronous receiver.
This commit is contained in:
@@ -25,6 +25,8 @@ import android.widget.EditText;
|
||||
import android.os.Build;
|
||||
import android.provider.Telephony;
|
||||
|
||||
import org.thoughtcrime.securesms.mms.MmsRadio;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
@@ -134,6 +136,14 @@ public class Util {
|
||||
}
|
||||
}
|
||||
|
||||
public static void wait(Object lock, int timeout) {
|
||||
try {
|
||||
lock.wait(timeout);
|
||||
} catch (InterruptedException ie) {
|
||||
throw new AssertionError(ie);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean isDefaultSmsProvider(Context context){
|
||||
return (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) ||
|
||||
|
||||
Reference in New Issue
Block a user