mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-05 07:32:14 +00:00
Add preference to disable the SMS channel all together.
1) If the SMS fallback preference is disabled, no outgoing messages will succeed via the SMS transport. 2) If the SMS fallback preference is disabled, "mirroring" the SMS db state when not the default system SMS app is disabled.
This commit is contained in:
@@ -20,14 +20,12 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Telephony;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
||||
import org.thoughtcrime.securesms.protocol.WirePrefix;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
import ws.com.google.android.mms.pdu.GenericPdu;
|
||||
import ws.com.google.android.mms.pdu.NotificationInd;
|
||||
@@ -52,7 +50,8 @@ public class MmsListener extends BroadcastReceiver {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ||
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
|
||||
TextSecurePreferences.isSmsFallbackEnabled(context)) ||
|
||||
TextSecurePreferences.isInterceptAllMmsEnabled(context))
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -110,7 +110,8 @@ public class SmsListener extends BroadcastReceiver {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ||
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
|
||||
TextSecurePreferences.isSmsFallbackEnabled(context)) ||
|
||||
TextSecurePreferences.isInterceptAllSmsEnabled(context))
|
||||
{
|
||||
return true;
|
||||
@@ -120,8 +121,7 @@ public class SmsListener extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private boolean isChallenge(Context context, Intent intent) {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String messageBody = getSmsMessageBodyFromIntent(intent);
|
||||
String messageBody = getSmsMessageBodyFromIntent(intent);
|
||||
|
||||
if (messageBody == null)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user