Prompt user for APN details when missing.

If TextSecure is running on a device without APN details, we prompt
the user to manually specify them when the user goes to send an MMS
message.
This commit is contained in:
Moxie Marlinspike
2013-03-04 17:43:04 -08:00
parent fa8208de33
commit 07c59d969a
7 changed files with 245 additions and 14 deletions

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:background="@drawable/background_pattern_repeat">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" >
<LinearLayout android:paddingRight="16dip"
android:paddingLeft="16dip"
android:paddingTop="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<TextView style="@style/Registration.Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dip"
android:text="@string/prompt_apn_activity__textsecure_requires_apn_settings_to_deliver_media_messages_via_your_wireless_carrier"/>
<TextView style="@style/Registration.Description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dip"
android:text="@string/prompt_apn_activity__to_send_media_messages_please_complete_the_necessary_apn_information_below"/>
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:text="@string/prompt_apn_activity__mmsc_url_required"/>
<EditText android:id="@+id/mmsc_url"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginBottom="10dip" />
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:text="@string/prompt_apn_activity__mms_proxy_host_optional"/>
<EditText android:id="@+id/mms_proxy_host"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:layout_marginBottom="10dip" />
<TextView style="@style/Registration.Label"
android:layout_width="fill_parent"
android:text="@string/prompt_apn_activity__mms_proxy_port_optional"/>
<EditText android:id="@+id/mms_proxy_port"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dip"
android:inputType="number"
android:singleLine="true" />
<LinearLayout android:orientation="horizontal"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:layout_marginBottom="20dip">
<Button style="@android:style/Widget.Button"
android:id="@+id/cancel_button"
android:text="@android:string/cancel"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="7dip"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button style="@android:style/Widget.Button"
android:id="@+id/ok_button"
android:text="@android:string/ok"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>

View File

@@ -120,6 +120,11 @@
<!-- PassphrasePromptActivity -->
<string name="PassphrasePromptActivity_invalid_passphrase_exclamation">Invalid Passphrase!</string>
<!-- PromptApnActivity -->
<string name="PromptApnActivity_you_must_specify_an_mmsc_url_for_your_carrier">You must specify an MMSC URL for your carrier.</string>
<string name="PromptApnActivity_mms_settings_updated">MMS Settings Updated</string>
<string name="PromptApnActivity_you_can_modify_these_values_from_the_textsecure_settings_menu_at_any_time_">You can modify these values from the TextSecure settings menu at any time.</string>
<!-- ReceiveKeyActivity -->
<string name="ReceiveKeyActivity_error_you_have_received_a_corrupted_public_key">ERROR:\n\nYou have received a corrupted public key. This key can not be processed, please re-initiate a secure session.</string>
<string name="ReceiveKeyActivity_error_you_have_received_a_public_key_from_an_unsupported_version_of_the_protocol">ERROR:\n\nYou have received a public key from an unsupported version of the protocol. This key can not be processed, please re-initiate a secure session.</string>
@@ -295,6 +300,13 @@
<string name="prompt_passphrase_activity__textsecure_passphrase">TEXTSECURE PASSPHRASE</string>
<string name="prompt_passphrase_activity__unlock">Unlock</string>
<!-- prompt_apn_activity -->
<string name="prompt_apn_activity__textsecure_requires_apn_settings_to_deliver_media_messages_via_your_wireless_carrier">TextSecure requires APN settings to deliver media messages via your wireless carrier. Your device does not make this information available, which is occasionally true for locked devices and other restrictive configurations.</string>
<string name="prompt_apn_activity__to_send_media_messages_please_complete_the_necessary_apn_information_below">To send media messages, please complete the necessary APN information below. The values for your carrier can generally be located by searching for \'&amp;lt;your carrier&amp;gt; APN\'. You will only need to do this once.</string>
<string name="prompt_apn_activity__mmsc_url_required">MMSC URL (REQUIRED):</string>
<string name="prompt_apn_activity__mms_proxy_host_optional">MMS PROXY HOST (OPTIONAL):</string>
<string name="prompt_apn_activity__mms_proxy_port_optional">MMS PROXY PORT (OPTIONAL):</string>
<!-- receive_key_activity -->
<string name="receive_key_activity__session">Session</string>
<string name="receive_key_activity__identities">Identities</string>