Fix rebase errors

This commit is contained in:
Moxie Marlinspike 2014-01-06 18:52:18 -08:00
parent 71664926e9
commit dde2d2564a
7 changed files with 31 additions and 24 deletions

View File

@ -80,6 +80,8 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
private static final String DISPLAY_CATEGORY_PREF = "pref_display_category"; private static final String DISPLAY_CATEGORY_PREF = "pref_display_category";
private static final String PUSH_MESSAGING_PREF = "pref_toggle_push_messaging"; private static final String PUSH_MESSAGING_PREF = "pref_toggle_push_messaging";
private static final String MMS_PREF = "pref_mms_preferences"; private static final String MMS_PREF = "pref_mms_preferences";
private static final String KITKAT_DEFAULT_PREF = "pref_set_default";
private final DynamicTheme dynamicTheme = new DynamicTheme(); private final DynamicTheme dynamicTheme = new DynamicTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage(); private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
@ -108,16 +110,16 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
.setOnPreferenceChangeListener(new DisablePassphraseClickListener()); .setOnPreferenceChangeListener(new DisablePassphraseClickListener());
this.findPreference(MMS_PREF) this.findPreference(MMS_PREF)
.setOnPreferenceClickListener(new ApnPreferencesClickListener()); .setOnPreferenceClickListener(new ApnPreferencesClickListener());
this.findPreference(LED_COLOR_PREF) this.findPreference(TextSecurePreferences.LED_COLOR_PREF)
.setOnPreferenceChangeListener(new ListSummaryListener()); .setOnPreferenceChangeListener(new ListSummaryListener());
this.findPreference(LED_BLINK_PREF) this.findPreference(TextSecurePreferences.LED_BLINK_PREF)
.setOnPreferenceChangeListener(new ListSummaryListener()); .setOnPreferenceChangeListener(new ListSummaryListener());
this.findPreference(RINGTONE_PREF) this.findPreference(TextSecurePreferences.RINGTONE_PREF)
.setOnPreferenceChangeListener(new RingtoneSummaryListener()); .setOnPreferenceChangeListener(new RingtoneSummaryListener());
initializeListSummary((ListPreference) findPreference(LED_COLOR_PREF)); initializeListSummary((ListPreference) findPreference(TextSecurePreferences.LED_COLOR_PREF));
initializeListSummary((ListPreference) findPreference(LED_BLINK_PREF)); initializeListSummary((ListPreference) findPreference(TextSecurePreferences.LED_BLINK_PREF));
initializeRingtoneSummary((RingtonePreference) findPreference(RINGTONE_PREF)); initializeRingtoneSummary((RingtonePreference) findPreference(TextSecurePreferences.RINGTONE_PREF));
} }
@Override @Override
@ -178,8 +180,8 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
Preference defaultPreference = findPreference(KITKAT_DEFAULT_PREF); Preference defaultPreference = findPreference(KITKAT_DEFAULT_PREF);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
generalCategory.removePreference(findPreference(ALL_SMS_PREF)); generalCategory.removePreference(findPreference(TextSecurePreferences.ALL_SMS_PREF));
generalCategory.removePreference(findPreference(ALL_MMS_PERF)); generalCategory.removePreference(findPreference(TextSecurePreferences.ALL_MMS_PREF));
if (Util.isDefaultSmsProvider(this)) { if (Util.isDefaultSmsProvider(this)) {
generalCategory.removePreference(defaultPreference); generalCategory.removePreference(defaultPreference);

View File

@ -22,10 +22,8 @@ import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.MenuItem;
import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil; import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
import org.thoughtcrime.securesms.service.DirectoryRefreshListener; import org.thoughtcrime.securesms.service.DirectoryRefreshListener;
import org.whispersystems.textsecure.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.ThreadDatabase; import org.thoughtcrime.securesms.database.ThreadDatabase;
import org.thoughtcrime.securesms.notifications.MessageNotifier; import org.thoughtcrime.securesms.notifications.MessageNotifier;
@ -37,6 +35,7 @@ import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicTheme; import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.MemoryCleaner; import org.thoughtcrime.securesms.util.MemoryCleaner;
import org.thoughtcrime.securesms.util.Util; import org.thoughtcrime.securesms.util.Util;
import org.whispersystems.textsecure.crypto.MasterSecret;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;

View File

@ -361,7 +361,8 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
{ {
PduHeaders headers = retrieved.getPduHeaders(); PduHeaders headers = retrieved.getPduHeaders();
ContentValues contentValues = getContentValuesFromHeader(headers); ContentValues contentValues = getContentValuesFromHeader(headers);
boolean unread = Util.isDefaultSmsProvider(context) || ((mailbox & Types.SECURE_MESSAGE_BIT) != 0); boolean unread = org.thoughtcrime.securesms.util.Util.isDefaultSmsProvider(context) ||
((mailbox & Types.SECURE_MESSAGE_BIT) != 0);
if (threadId == -1 || retrieved.isGroupMessage()) { if (threadId == -1 || retrieved.isGroupMessage()) {
try { try {
@ -439,7 +440,7 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
contentValues.put(THREAD_ID, threadId); contentValues.put(THREAD_ID, threadId);
contentValues.put(STATUS, Status.DOWNLOAD_INITIALIZED); contentValues.put(STATUS, Status.DOWNLOAD_INITIALIZED);
contentValues.put(DATE_RECEIVED, System.currentTimeMillis() / 1000); contentValues.put(DATE_RECEIVED, System.currentTimeMillis() / 1000);
contentValues.put(READ, Util.isDefaultSmsProvider(context) ? 0 : 1); contentValues.put(READ, org.thoughtcrime.securesms.util.Util.isDefaultSmsProvider(context) ? 0 : 1);
if (!contentValues.containsKey(DATE_SENT)) if (!contentValues.containsKey(DATE_SENT))
contentValues.put(DATE_SENT, contentValues.getAsLong(DATE_RECEIVED)); contentValues.put(DATE_SENT, contentValues.getAsLong(DATE_RECEIVED));
@ -463,7 +464,7 @@ public class MmsDatabase extends Database implements MmsSmsColumns {
notifyConversationListeners(threadId); notifyConversationListeners(threadId);
DatabaseFactory.getThreadDatabase(context).update(threadId); DatabaseFactory.getThreadDatabase(context).update(threadId);
if (Util.isDefaultSmsProvider(context)) { if (org.thoughtcrime.securesms.util.Util.isDefaultSmsProvider(context)) {
DatabaseFactory.getThreadDatabase(context).setUnread(threadId); DatabaseFactory.getThreadDatabase(context).setUnread(threadId);
} }

View File

@ -260,7 +260,8 @@ public class SmsDatabase extends Database implements MmsSmsColumns {
Recipient recipient = new Recipient(null, message.getSender(), null, null); Recipient recipient = new Recipient(null, message.getSender(), null, null);
Recipients recipients = new Recipients(recipient); Recipients recipients = new Recipients(recipient);
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients); long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients);
boolean unread = Util.isDefaultSmsProvider(context) || message.isSecureMessage() || message.isKeyExchange(); boolean unread = org.thoughtcrime.securesms.util.Util.isDefaultSmsProvider(context) ||
message.isSecureMessage() || message.isKeyExchange();
ContentValues values = new ContentValues(6); ContentValues values = new ContentValues(6);
values.put(ADDRESS, message.getSender()); values.put(ADDRESS, message.getSender());

View File

@ -111,8 +111,7 @@ public class SmsListener extends BroadcastReceiver {
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT || if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT ||
PreferenceManager.getDefaultSharedPreferences(context) TextSecurePreferences.isInterceptAllSmsEnabled(context))
.getBoolean(ApplicationPreferencesActivity.ALL_SMS_PREF, true))
{ {
return true; return true;
} }

View File

@ -5,14 +5,14 @@ import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import org.thoughtcrime.securesms.service.SendReceiveService; import org.thoughtcrime.securesms.service.SendReceiveService;
import org.thoughtcrime.securesms.service.SmsListener; import org.thoughtcrime.securesms.service.SmsDeliveryListener;
public abstract class BaseTransport { public abstract class BaseTransport {
protected Intent constructSentIntent(Context context, long messageId, long type, boolean upgraded) { protected Intent constructSentIntent(Context context, long messageId, long type, boolean upgraded) {
Intent pending = new Intent(SendReceiveService.SENT_SMS_ACTION, Intent pending = new Intent(SendReceiveService.SENT_SMS_ACTION,
Uri.parse("custom://" + messageId + System.currentTimeMillis()), Uri.parse("custom://" + messageId + System.currentTimeMillis()),
context, SmsListener.class); context, SmsDeliveryListener.class);
pending.putExtra("type", type); pending.putExtra("type", type);
pending.putExtra("message_id", messageId); pending.putExtra("message_id", messageId);
@ -24,7 +24,7 @@ public abstract class BaseTransport {
protected Intent constructDeliveredIntent(Context context, long messageId, long type) { protected Intent constructDeliveredIntent(Context context, long messageId, long type) {
Intent pending = new Intent(SendReceiveService.DELIVERED_SMS_ACTION, Intent pending = new Intent(SendReceiveService.DELIVERED_SMS_ACTION,
Uri.parse("custom://" + messageId + System.currentTimeMillis()), Uri.parse("custom://" + messageId + System.currentTimeMillis()),
context, SmsListener.class); context, SmsDeliveryListener.class);
pending.putExtra("type", type); pending.putExtra("type", type);
pending.putExtra("message_id", messageId); pending.putExtra("message_id", messageId);

View File

@ -18,13 +18,14 @@ public class TextSecurePreferences {
public static final String THREAD_TRIM_NOW = "pref_trim_now"; public static final String THREAD_TRIM_NOW = "pref_trim_now";
public static final String ENABLE_MANUAL_MMS_PREF = "pref_enable_manual_mms"; public static final String ENABLE_MANUAL_MMS_PREF = "pref_enable_manual_mms";
private static final String RINGTONE_PREF = "pref_key_ringtone"; public static final String RINGTONE_PREF = "pref_key_ringtone";
private static final String VIBRATE_PREF = "pref_key_vibrate"; private static final String VIBRATE_PREF = "pref_key_vibrate";
private static final String NOTIFICATION_PREF = "pref_key_enable_notifications"; private static final String NOTIFICATION_PREF = "pref_key_enable_notifications";
private static final String LED_COLOR_PREF = "pref_led_color"; public static final String LED_COLOR_PREF = "pref_led_color";
private static final String LED_BLINK_PREF = "pref_led_blink"; public static final String LED_BLINK_PREF = "pref_led_blink";
private static final String LED_BLINK_PREF_CUSTOM = "pref_led_blink_custom"; private static final String LED_BLINK_PREF_CUSTOM = "pref_led_blink_custom";
private static final String ALL_MMS_PERF = "pref_all_mms"; public static final String ALL_MMS_PREF = "pref_all_mms";
public static final String ALL_SMS_PREF = "pref_all_sms";
private static final String PASSPHRASE_TIMEOUT_INTERVAL_PREF = "pref_timeout_interval"; private static final String PASSPHRASE_TIMEOUT_INTERVAL_PREF = "pref_timeout_interval";
private static final String PASSPHRASE_TIMEOUT_PREF = "pref_timeout_passphrase"; private static final String PASSPHRASE_TIMEOUT_PREF = "pref_timeout_passphrase";
private static final String AUTO_KEY_EXCHANGE_PREF = "pref_auto_complete_key_exchange"; private static final String AUTO_KEY_EXCHANGE_PREF = "pref_auto_complete_key_exchange";
@ -175,7 +176,11 @@ public class TextSecurePreferences {
} }
public static boolean isInterceptAllMmsEnabled(Context context) { public static boolean isInterceptAllMmsEnabled(Context context) {
return getBooleanPreference(context, ALL_MMS_PERF, true); return getBooleanPreference(context, ALL_MMS_PREF, true);
}
public static boolean isInterceptAllSmsEnabled(Context context) {
return getBooleanPreference(context, ALL_SMS_PREF, true);
} }
public static boolean isNotificationsEnabled(Context context) { public static boolean isNotificationsEnabled(Context context) {