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:
Moxie Marlinspike
2014-02-20 14:49:31 -08:00
parent c5821f770a
commit 918f223149
8 changed files with 66 additions and 14 deletions

View File

@@ -44,6 +44,11 @@ public class TextSecurePreferences {
private static final String IN_THREAD_NOTIFICATION_PREF = "pref_key_inthread_notifications";
private static final String LOCAL_REGISTRATION_ID_PREF = "pref_local_registration_id";
public static final String ALLOW_SMS_FALLBACK_PREF = "pref_allow_sms_traffic_out";
public static boolean isSmsFallbackEnabled(Context context) {
return getBooleanPreference(context, ALLOW_SMS_FALLBACK_PREF, true);
}
public static int getLocalRegistrationId(Context context) {
return getIntegerPreference(context, LOCAL_REGISTRATION_ID_PREF, 0);
@@ -175,7 +180,7 @@ public class TextSecurePreferences {
}
public static boolean isSmsDeliveryReportsEnabled(Context context) {
return getBooleanPreference(context, SMS_DELIVERY_REPORT_PREF, false);
return getBooleanPreference(context, SMS_DELIVERY_REPORT_PREF, true);
}
public static boolean hasPromptedPushRegistration(Context context) {