From d7070e7ecf50b41c7bd8a04596716914009031ff Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 11 Jul 2013 14:58:40 -0700 Subject: [PATCH] Inserted the Registration activity into initial setup flow. 1) Added push messaging toggle to preferences. 2) Added push messaging registration screen to setup flow. 3) Migrated rest of SharedPreferences accessors to TextSecurePreferences. --- .../textsecure/push/PushServiceSocket.java | 5 +- res/layout/conversation_list_activity.xml | 9 + res/layout/registration_activity.xml | 34 +++- res/values/strings.xml | 12 +- res/xml/preferences.xml | 5 + .../ApplicationPreferencesActivity.java | 139 +++++++++++--- .../securesms/RegistrationActivity.java | 21 +++ .../securesms/RoutingActivity.java | 58 +++--- .../securesms/gcm/GcmIntentService.java | 8 +- .../notifications/MessageNotifier.java | 23 +-- .../LedBlinkPatternListPreference.java | 8 +- .../PassphraseTimeoutPreference.java | 5 +- .../securesms/service/KeyCachingService.java | 5 +- .../securesms/service/MmsListener.java | 4 +- .../service/RegistrationService.java | 22 +-- .../securesms/service/SmsListener.java | 3 +- .../securesms/service/SmsReceiver.java | 6 +- .../securesms/transport/SmsTransport.java | 7 +- .../securesms/util/DynamicLanguage.java | 7 +- .../securesms/util/DynamicTheme.java | 3 +- .../securesms/util/TextSecurePreferences.java | 176 ++++++++++++++++-- .../thoughtcrime/securesms/util/Trimmer.java | 8 +- 22 files changed, 427 insertions(+), 141 deletions(-) diff --git a/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java b/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java index 0ad2001d7a..a59bc5fd58 100644 --- a/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java +++ b/library/src/org/whispersystems/textsecure/push/PushServiceSocket.java @@ -65,9 +65,8 @@ public class PushServiceSocket { makeRequest(REGISTER_GCM_PATH, "PUT", new Gson().toJson(registration)); } - public void unregisterGcmId(String gcmRegistrationId) throws IOException, RateLimitException { - GcmRegistrationId registration = new GcmRegistrationId(gcmRegistrationId); - makeRequest(REGISTER_GCM_PATH, "DELETE", new Gson().toJson(registration)); + public void unregisterGcmId() throws IOException, RateLimitException { + makeRequest(REGISTER_GCM_PATH, "DELETE", null); } public void sendMessage(String recipient, String messageText) diff --git a/res/layout/conversation_list_activity.xml b/res/layout/conversation_list_activity.xml index 73fbafc8bf..ec9f405dd6 100644 --- a/res/layout/conversation_list_activity.xml +++ b/res/layout/conversation_list_activity.xml @@ -18,4 +18,13 @@ android:choiceMode="singleChoice" android:dividerHeight="1dp" android:background="?navigation_drawer_background"/> + + + \ No newline at end of file diff --git a/res/layout/registration_activity.xml b/res/layout/registration_activity.xml index 86c736688c..a0a6a9a76a 100644 --- a/res/layout/registration_activity.xml +++ b/res/layout/registration_activity.xml @@ -19,7 +19,7 @@ android:layout_width="fill_parent" android:layout_marginBottom="16dip" android:layout_marginTop="16dip" - android:text="@string/registration_activity__please_confirm_your_country_code_and_phone_number"/> + android:text="@string/registration_activity__textsecure_can_use_the_data_channel_to_avoid_sms_charges_when_communicating_with_other_textsecure_users"/> -