auto import from //branches/cupcake/...@131421
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4dbee3e..dc37ece 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -69,9 +69,6 @@
</intent-filter>
</activity>
- <activity android:name=".ui.UndeliveredMessagesActivity"
- android:label="@string/menu_undelivered_messages"/>
-
<activity android:name=".ui.SelectContactMethodActivity"
android:label="Select Contact Method"
android:theme="@android:style/Theme.Dialog">
diff --git a/res/drawable/ic_gallery_video_overlay.png b/res/drawable/ic_gallery_video_overlay.png
new file mode 100644
index 0000000..ae263a7
--- /dev/null
+++ b/res/drawable/ic_gallery_video_overlay.png
Binary files differ
diff --git a/res/layout/video_attachment_view.xml b/res/layout/video_attachment_view.xml
index 94357c8..89f38ca 100644
--- a/res/layout/video_attachment_view.xml
+++ b/res/layout/video_attachment_view.xml
@@ -27,17 +27,24 @@
android:paddingRight="5dip"
android:background="@drawable/attachment_editor_bg">
- <LinearLayout
+ <RelativeLayout
android:layout_weight="1"
android:gravity="center"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
<ImageView
android:id="@+id/video_thumbnail"
- android:layout_width="200dip"
- android:layout_height="150dip"/>
- </LinearLayout>
+ android:scaleType="centerCrop"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:src="@drawable/ic_gallery_video_overlay" />
+ </RelativeLayout>
<LinearLayout
android:orientation="vertical"
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 7d0bac0..159f7c7 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Všechny konverzace budou smazány."</string>
<string name="confirm_delete_message">"Zpráva bude smazána."</string>
<string name="confirm_delete_all_messages">"Celá konverzace bude smazána."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Podrobnosti se nepodařilo zobrazit."</string>
<string name="message_details_title">"Podrobnosti zprávy"</string>
<string name="message_type_label">"Typ:"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 1e47c48..bb0d08f 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Alle Threads werden gelöscht."</string>
<string name="confirm_delete_message">"Die Nachricht wird gelöscht."</string>
<string name="confirm_delete_all_messages">"Der gesamte Thread wird gelöscht."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Details nicht abrufbar"</string>
<string name="message_details_title">"Nachrichtendetails"</string>
<string name="message_type_label">"Typ:"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
deleted file mode 100644
index 45926d1..0000000
--- a/res/values-en-rGB/strings.xml
+++ /dev/null
@@ -1,431 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for app_label (3258003248485901157) -->
- <skip />
- <!-- no translation found for new_message (2345256870516839002) -->
- <skip />
- <!-- no translation found for create_new_message (6804283184694435863) -->
- <skip />
- <!-- no translation found for menu_call_back (4870282119726948537) -->
- <skip />
- <!-- no translation found for menu_compose_new (4850912366132519786) -->
- <skip />
- <!-- no translation found for menu_preferences (121030258205660289) -->
- <skip />
- <!-- no translation found for menu_send_email (6302307949477724424) -->
- <skip />
- <!-- no translation found for menu_add_address_to_contacts (8362075627883964225) -->
- <skip />
- <!-- no translation found for menu_delete_all (3061603860881424044) -->
- <skip />
- <!-- no translation found for menu_delete (612298155606258567) -->
- <skip />
- <!-- no translation found for menu_undelivered_messages (3310106784737825246) -->
- <skip />
- <!-- no translation found for menu_view (4608917361485479217) -->
- <skip />
- <!-- no translation found for refreshing (1144339054362316851) -->
- <skip />
- <!-- no translation found for has_draft (7932044256500477806) -->
- <skip />
- <!-- no translation found for broadcast_from_to (8289555208463237267) -->
- <skip />
- <!-- no translation found for anonymous_recipient (370840964350859310) -->
- <skip />
- <!-- no translation found for no_subject_view (8747375242520980630) -->
- <skip />
- <!-- no translation found for messagelist_sender_self (6893641211775402343) -->
- <skip />
- <!-- no translation found for view_picture (182441399798366054) -->
- <skip />
- <!-- no translation found for view_slideshow (3687951805042574132) -->
- <skip />
- <!-- no translation found for view_message_details (5931936154574969312) -->
- <skip />
- <!-- no translation found for view_delivery_report (6747124396895750268) -->
- <skip />
- <!-- no translation found for delete_message (7122146964039229420) -->
- <skip />
- <!-- no translation found for sent_on (7068917517399159347) -->
- <skip />
- <!-- no translation found for expire_on (6058228667700274966) -->
- <skip />
- <!-- no translation found for kilobyte (77557380092066617) -->
- <skip />
- <!-- no translation found for undelivered_msg_dialog_title (5642008266440436432) -->
- <skip />
- <!-- no translation found for undelivered_msg_dialog_body (4088964055840797461) -->
- <skip />
- <!-- no translation found for undelivered_sms_dialog_body (5719810742229886538) -->
- <skip />
- <!-- no translation found for delete_thread (8068622638470523362) -->
- <skip />
- <!-- no translation found for menu_forward (4654040080712677237) -->
- <skip />
- <!-- no translation found for download (6052000585456874993) -->
- <skip />
- <!-- no translation found for downloading (2331449702204372995) -->
- <skip />
- <!-- no translation found for inline_subject (1057593861955558359) -->
- <skip />
- <!-- no translation found for drm_protected_text (5090309757753303825) -->
- <skip />
- <!-- no translation found for insufficient_drm_rights (713395881157470245) -->
- <skip />
- <!-- no translation found for copy_message_text (8079869731196438404) -->
- <skip />
- <!-- no translation found for message_options (6768657983671653299) -->
- <skip />
- <!-- no translation found for done (5692941848821523481) -->
- <skip />
- <!-- no translation found for move_up (7840166087289836781) -->
- <skip />
- <!-- no translation found for move_down (7137520499971337798) -->
- <skip />
- <!-- no translation found for remove_slide (2041581184478762613) -->
- <skip />
- <!-- no translation found for add_slide (8526249251456352316) -->
- <skip />
- <!-- no translation found for discard_slideshow (4941067214919289030) -->
- <skip />
- <!-- no translation found for remove_text (3343833561788267578) -->
- <skip />
- <!-- no translation found for add_picture (6261638664929381010) -->
- <skip />
- <!-- no translation found for remove_picture (5570448289475766437) -->
- <skip />
- <!-- no translation found for add_music (2138355650438728648) -->
- <skip />
- <!-- no translation found for remove_music (6902194762884330870) -->
- <skip />
- <!-- no translation found for add_video (4871037769920861030) -->
- <skip />
- <!-- no translation found for remove_video (4006257467076952738) -->
- <skip />
- <!-- no translation found for add_slide_hint (4550321283595449062) -->
- <skip />
- <!-- no translation found for to_hint (3527557439716888687) -->
- <skip />
- <!-- no translation found for compose_title (6091748510108686831) -->
- <skip />
- <!-- no translation found for subject_hint (964087085592746110) -->
- <skip />
- <!-- no translation found for add_attachment (403515618641379456) -->
- <skip />
- <!-- no translation found for add_subject (1016146616716999903) -->
- <skip />
- <!-- no translation found for discard (8045857438483739928) -->
- <skip />
- <!-- no translation found for replace (3011137664630212612) -->
- <skip />
- <!-- no translation found for remove (3446249649305108375) -->
- <skip />
- <!-- no translation found for send (4588237451332993810) -->
- <skip />
- <!-- no translation found for all_threads (3428821799078520562) -->
- <skip />
- <!-- no translation found for type_to_compose_text_enter_to_send (716376529054534007) -->
- <skip />
- <!-- no translation found for view (5798196094987648628) -->
- <skip />
- <!-- no translation found for open_keyboard_to_compose_message (6923280988127304903) -->
- <skip />
- <!-- no translation found for image_too_large (4757715962254243586) -->
- <skip />
- <!-- no translation found for ask_for_automatically_resize (5220091377970970751) -->
- <skip />
- <!-- no translation found for compressing (6068942312135905137) -->
- <skip />
- <!-- no translation found for unsupported_media_format (7536412347274258686) -->
- <skip />
- <!-- no translation found for select_different_media (5232072118917078124) -->
- <skip />
- <!-- no translation found for exceed_message_size_limitation (4529545741276259470) -->
- <skip />
- <!-- no translation found for failed_to_add_media (599322199829187461) -->
- <skip />
- <!-- no translation found for failed_to_resize_image (6874608449956885873) -->
- <skip />
- <!-- no translation found for resize_image_error_information (2470178098798138935) -->
- <skip />
- <!-- no translation found for forward_prefix (5561169333148128303) -->
- <skip />
- <!-- no translation found for discard_message (7812754950243824139) -->
- <skip />
- <!-- no translation found for discard_message_reason (1459210455416641710) -->
- <skip />
- <!-- no translation found for has_invalid_recipient (3044532309594028107) -->
- <skip />
- <!-- no translation found for invalid_recipient_message (7114641238129777380) -->
- <skip />
- <!-- no translation found for cannot_send_message (3539764493371229831) -->
- <skip />
- <!-- no translation found for cannot_send_message_reason (1550124249131189549) -->
- <skip />
- <!-- no translation found for cannot_forward_drm_obj (2059649148574485079) -->
- <skip />
- <!-- no translation found for converting_to_picture_message (988309928477950901) -->
- <skip />
- <!-- no translation found for converting_to_text_message (336544435869444347) -->
- <skip />
- <!-- no translation found for cannot_add_slide_anymore (7618374946244055418) -->
- <skip />
- <!-- no translation found for cannot_save_message (8699044042414699907) -->
- <skip />
- <!-- no translation found for cannot_load_message (4119129383387570853) -->
- <skip />
- <!-- no translation found for message_saved_as_draft (1791383562773468615) -->
- <skip />
- <!-- no translation found for cannot_play_audio (8124291060595271675) -->
- <skip />
- <!-- no translation found for preview (905780061608264828) -->
- <skip />
- <!-- no translation found for preview_slideshow (1987323374841884815) -->
- <skip />
- <!-- no translation found for replace_image (5044691097548260240) -->
- <skip />
- <!-- no translation found for duration_sec (5239949266819498493) -->
- <skip />
- <!-- no translation found for duration_selector_title (9018514730482308242) -->
- <skip />
- <!-- no translation found for layout_selector_title (810284897410818922) -->
- <skip />
- <!-- no translation found for layout_top (9086094103292222569) -->
- <skip />
- <!-- no translation found for layout_bottom (2937044863909479713) -->
- <skip />
- <!-- no translation found for type_to_compose_text_or_leave_blank (3962051996041530419) -->
- <skip />
- <!-- no translation found for secs (7043775193623288319) -->
- <skip />
- <!-- no translation found for select_dialog_items:0 (7255708690676420661) -->
- <!-- no translation found for select_dialog_items:1 (6326211460937404403) -->
- <!-- no translation found for select_dialog_items:2 (8106043728232804734) -->
- <!-- no translation found for select_dialog_items:3 (2790891280827747410) -->
- <!-- no translation found for select_dialog_items:4 (8165288902715311641) -->
- <!-- no translation found for select_dialog_items:5 (2965734882484074219) -->
- <!-- no translation found for select_dialog_items:6 (4447076239651872211) -->
- <!-- no translation found for select_dialog_items:7 (3192297672236800662) -->
- <!-- no translation found for select_dialog_items:8 (6933746444106582724) -->
- <!-- no translation found for select_dialog_items:9 (7491181909656261098) -->
- <!-- no translation found for select_dialog_items:10 (4171252848990096937) -->
- <!-- no translation found for menu_view_contact (3860698418952279049) -->
- <skip />
- <!-- no translation found for menu_add_to_contacts (2615113356305072658) -->
- <skip />
- <!-- no translation found for hidden_sender_address (28472377592031922) -->
- <skip />
- <!-- no translation found for yes (5079475575915848417) -->
- <skip />
- <!-- no translation found for no (8785858785740174673) -->
- <skip />
- <!-- no translation found for play (7190194180677705071) -->
- <skip />
- <!-- no translation found for edit (6579912119490946684) -->
- <skip />
- <!-- no translation found for resize (6171821552019338747) -->
- <skip />
- <!-- no translation found for try_to_send (9213414255983235880) -->
- <skip />
- <!-- no translation found for preferences_title (3689801794983666059) -->
- <skip />
- <!-- no translation found for restore_default (3966622856817838280) -->
- <skip />
- <!-- no translation found for pref_notification_settings_title (3994468521207856125) -->
- <skip />
- <!-- no translation found for pref_mms_settings_title (1763152060305466043) -->
- <skip />
- <!-- no translation found for pref_sms_settings_title (3963754401159096127) -->
- <skip />
- <!-- no translation found for pref_default_mms_max_size (7486308211042513626) -->
- <skip />
- <!-- no translation found for pref_default_mms_creation_mode (7604784965974593397) -->
- <skip />
- <!-- no translation found for pref_default_mms_resubmission_mode (3432974169999388053) -->
- <skip />
- <!-- no translation found for pref_summary_manage_sim_messages (3804850077896001449) -->
- <skip />
- <!-- no translation found for pref_summary_mms_delivery_reports (3552203456704975977) -->
- <skip />
- <!-- no translation found for pref_summary_mms_read_reports (5325573454182638004) -->
- <skip />
- <!-- no translation found for pref_summary_sms_delivery_reports (3961121615030283227) -->
- <skip />
- <!-- no translation found for pref_title_manage_sim_messages (3359241832840012222) -->
- <skip />
- <!-- no translation found for pref_title_mms_delivery_reports (7084708078268983549) -->
- <skip />
- <!-- no translation found for pref_title_mms_read_reports (5246697042963116850) -->
- <skip />
- <!-- no translation found for pref_title_sms_delivery_reports (3684411934120469787) -->
- <skip />
- <!-- no translation found for pref_title_notification_enabled (5672266674345175760) -->
- <skip />
- <!-- no translation found for pref_summary_notification_enabled (6727902049987326043) -->
- <skip />
- <!-- no translation found for pref_title_notification_vibrate (6524387481181069013) -->
- <skip />
- <!-- no translation found for pref_summary_notification_vibrate (4688139343663584459) -->
- <skip />
- <!-- no translation found for pref_title_notification_ringtone (4765777349529564565) -->
- <skip />
- <!-- no translation found for pref_title_mms_auto_retrieval (3722610550305106347) -->
- <skip />
- <!-- no translation found for pref_summary_mms_auto_retrieval (1547409889209432924) -->
- <skip />
- <!-- no translation found for pref_title_mms_retrieval_during_roaming (8762212309768960685) -->
- <skip />
- <!-- no translation found for pref_summary_mms_retrieval_during_roaming (9154571760174975240) -->
- <skip />
- <!-- no translation found for to_label (3406570886408344063) -->
- <skip />
- <!-- no translation found for confirm_dialog_title (6029874642545163709) -->
- <skip />
- <!-- no translation found for confirm_delete_conversation (1912520874012907686) -->
- <skip />
- <!-- no translation found for confirm_delete_all_conversations (6717572033203873971) -->
- <skip />
- <!-- no translation found for confirm_delete_message (6170980574640011348) -->
- <skip />
- <!-- no translation found for confirm_delete_all_messages (2151272227912940768) -->
- <skip />
- <!-- no translation found for cannot_get_details (2469055532372741963) -->
- <skip />
- <!-- no translation found for message_details_title (2242969509445077738) -->
- <skip />
- <!-- no translation found for message_type_label (8137426651673190040) -->
- <skip />
- <!-- no translation found for text_message (7657613074841007425) -->
- <skip />
- <!-- no translation found for multimedia_message (8078022403467343397) -->
- <skip />
- <!-- no translation found for multimedia_notification (7114172353190880417) -->
- <skip />
- <!-- no translation found for from_label (2975091346907357259) -->
- <skip />
- <!-- no translation found for to_address_label (2128706149258592017) -->
- <skip />
- <!-- no translation found for bcc_label (3232116255558553347) -->
- <skip />
- <!-- no translation found for sent_label (5754995398776123211) -->
- <skip />
- <!-- no translation found for received_label (8131392878573082643) -->
- <skip />
- <!-- no translation found for saved_label (1607228320964526991) -->
- <skip />
- <!-- no translation found for subject_label (7966114512591057536) -->
- <skip />
- <!-- no translation found for message_size_label (2756661303751964398) -->
- <skip />
- <!-- no translation found for priority_label (2327894310386134122) -->
- <skip />
- <!-- no translation found for priority_high (7068811967179430031) -->
- <skip />
- <!-- no translation found for priority_normal (581477667452865251) -->
- <skip />
- <!-- no translation found for priority_low (3093118565992518851) -->
- <skip />
- <!-- no translation found for message_class_label (2083976754508141430) -->
- <skip />
- <!-- no translation found for menu_edit (8081487591451123270) -->
- <skip />
- <!-- no translation found for menu_retry_sending (6671298322520734809) -->
- <skip />
- <!-- no translation found for menu_retry_sending_all (7334332875683298886) -->
- <skip />
- <!-- no translation found for menu_delete_messages (6010435134612525633) -->
- <skip />
- <!-- no translation found for retrying_dialog_body (5424166611326847178) -->
- <skip />
- <!-- no translation found for sim_copy_to_phone_memory (7502507798505092049) -->
- <skip />
- <!-- no translation found for sim_delete (3744482747880335906) -->
- <skip />
- <!-- no translation found for sim_manage_messages_title (2224370244272755174) -->
- <skip />
- <!-- no translation found for sim_view (2901276256668634922) -->
- <skip />
- <!-- no translation found for sim_empty (5621034997044578048) -->
- <skip />
- <!-- no translation found for delivery_header_title (8387156807599026141) -->
- <skip />
- <!-- no translation found for status_none (6844039525130437018) -->
- <skip />
- <!-- no translation found for status_pending (4950042900677422141) -->
- <skip />
- <!-- no translation found for status_read (2069196305805434939) -->
- <skip />
- <!-- no translation found for status_received (2841575114879154848) -->
- <skip />
- <!-- no translation found for status_failed (6297598652185248143) -->
- <skip />
- <!-- no translation found for status_unread (3692894105078652218) -->
- <skip />
- <!-- no translation found for status_rejected (8002583553329148277) -->
- <skip />
- <!-- no translation found for recipient_label (3914797304363374392) -->
- <skip />
- <!-- no translation found for status_label (3575512121551992393) -->
- <skip />
- <!-- no translation found for attach_image (7858067230913147138) -->
- <skip />
- <!-- no translation found for attach_take_photo (8879240345379878436) -->
- <skip />
- <!-- no translation found for attach_video (4732695100777270953) -->
- <skip />
- <!-- no translation found for attach_sound (6477238390474896118) -->
- <skip />
- <!-- no translation found for attach_record_sound (8665931817646070882) -->
- <skip />
- <!-- no translation found for select_bottom_text (6336986464523033005) -->
- <skip />
- <!-- no translation found for select_top_text (9032471641643788289) -->
- <skip />
- <!-- no translation found for notification_multiple (581638616693879058) -->
- <skip />
- <!-- no translation found for notification_multiple_title (6200385282147357641) -->
- <skip />
- <!-- no translation found for sim_full_title (916348878005114210) -->
- <skip />
- <!-- no translation found for sim_full_body (5281677370824155451) -->
- <skip />
- <!-- no translation found for type_audio (2215911637661619313) -->
- <skip />
- <!-- no translation found for type_picture (5527400236650139163) -->
- <skip />
- <!-- no translation found for type_video (2877419500986886548) -->
- <skip />
- <!-- no translation found for confirm (911569518910442942) -->
- <skip />
- <!-- no translation found for message_send_read_report (6838342740528546867) -->
- <skip />
- <!-- no translation found for url_list_label (2213608172782653967) -->
- <skip />
- <!-- no translation found for message_queued (9175279001588881353) -->
- <skip />
- <!-- no translation found for no_subject (581518313257847800) -->
- <skip />
- <!-- no translation found for unknown_sender (3525861341253354) -->
- <skip />
- <!-- no translation found for dl_failure_notification (7878221501398680435) -->
- <skip />
- <!-- no translation found for rate_limit_surpassed (3685485425435902727) -->
- <skip />
- <!-- no translation found for confirm_rate_limit (7793782488379602480) -->
- <skip />
- <!-- no translation found for message_download_failed_title (480180958948034360) -->
- <skip />
- <!-- no translation found for message_send_failed_title (1752091406248896099) -->
- <skip />
- <!-- no translation found for message_failed_body (997379697068110061) -->
- <skip />
- <!-- no translation found for download_later (3002807649222703566) -->
- <skip />
- <!-- no translation found for select_audio (6309973899214936884) -->
- <skip />
- <!-- no translation found for copy_to_sdcard (5640801421475974907) -->
- <skip />
- <!-- no translation found for menu_insert_smiley (4316799709734277425) -->
- <skip />
-</resources>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 7e8b4eb..2b1065d 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Se eliminarán todas las cadenas."</string>
<string name="confirm_delete_message">"Se eliminará el mensaje."</string>
<string name="confirm_delete_all_messages">"Se eliminará toda la cadena."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"No se pueden obtener detalles."</string>
<string name="message_details_title">"Detalles del mensaje"</string>
<string name="message_type_label">"Tipo:"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index df6a43e..bf176e7 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Tous les fils de discussion vont être supprimés."</string>
<string name="confirm_delete_message">"Le message va être supprimé."</string>
<string name="confirm_delete_all_messages">"L\'intégralité du fil de discussion va être supprimée."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Impossible de récupérer les détails"</string>
<string name="message_details_title">"Détails du message"</string>
<string name="message_type_label">"Type :"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index bc37a6e..7ff59f0 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Verranno eliminate tutte le conversazioni."</string>
<string name="confirm_delete_message">"Il messaggio verrà eliminato."</string>
<string name="confirm_delete_all_messages">"Verrà eliminata l\'intera conversazione."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Impossibile ottenere i dettagli"</string>
<string name="message_details_title">"Dettagli messaggio"</string>
<string name="message_type_label">"Tipo:"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index 5d1403c..95dac1f 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"スレッドはすべて削除されます。"</string>
<string name="confirm_delete_message">"メッセージを削除します。"</string>
<string name="confirm_delete_all_messages">"スレッド全体が削除されます。"</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"詳細を表示できません"</string>
<string name="message_details_title">"メッセージの詳細"</string>
<string name="message_type_label">"タイプ:"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 900eea8..10d4e48 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"대화목록이 모두 삭제됩니다."</string>
<string name="confirm_delete_message">"메시지가 삭제됩니다."</string>
<string name="confirm_delete_all_messages">"전체 대화가 삭제됩니다."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"세부정보를 가져올 수 없음"</string>
<string name="message_details_title">"메시지 세부정보"</string>
<string name="message_type_label">"유형:"</string>
diff --git a/res/values-nb/arrays.xml b/res/values-nb/arrays.xml
index 128ce6a..1a3efd8 100644
--- a/res/values-nb/arrays.xml
+++ b/res/values-nb/arrays.xml
@@ -28,8 +28,8 @@
<item>":-!"</item>
<item>":-["</item>
<item>"O:-)"</item>
- <item>":-\\\\"</item>
- <item>":\\\'("</item>
+ <item>":-\\\\\\\\"</item>
+ <item>":\\\\\\\'("</item>
<item>":-X"</item>
<item>":-D"</item>
<item>"o_O"</item>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index e3d7bf8..826f0ec 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -23,8 +23,7 @@
<string name="menu_compose_new">"Skriv melding"</string>
<string name="menu_preferences">"Innstillinger"</string>
<string name="menu_add_address_to_contacts">"Legg <xliff:g id="NAME">%s</xliff:g> til som kontakt"</string>
- <!-- no translation found for menu_call (5877123227307074690) -->
- <skip />
+ <string name="menu_call">"Ring"</string>
<string name="menu_delete_all">"Slett tråder"</string>
<string name="menu_delete">"Slett"</string>
<string name="menu_undelivered_messages">"Ikke leverte meldinger"</string>
@@ -166,7 +165,7 @@
<string name="confirm_delete_conversation">"Hele tråden vil bli slettet."</string>
<string name="confirm_delete_all_conversations">"Alle tråder vil bli slettet."</string>
<string name="confirm_delete_message">"Denne meldingen vil bli slettet."</string>
- <string name="confirm_delete_all_messages">"Hele tråden vil bli slettet."</string>
+ <string name="confirm_delete_all_messages">"Hele tråden vil bli slettet.\n\n\n65701806463341097\nAlle meldinger på SIM-kortet vil bli slettet."</string>
<!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
<skip />
<string name="cannot_get_details">"Kan ikke hente detaljer"</string>
@@ -211,12 +210,10 @@
<string name="attach_image">"Bilder"</string>
<string name="attach_take_photo">"Kamera"</string>
<string name="attach_video">"Video"</string>
- <!-- no translation found for attach_record_video (3099814114743078615) -->
- <skip />
+ <string name="attach_record_video">"Ta opp video"</string>
<string name="attach_sound">"Lyd"</string>
<string name="attach_record_sound">"Ta opp lyd"</string>
- <!-- no translation found for attach_slideshow (3497422151091037063) -->
- <skip />
+ <string name="attach_slideshow">"Lysbildevisning"</string>
<string name="select_bottom_text">"Tekst på bunnen"</string>
<string name="select_top_text">"Text på toppen"</string>
<string name="notification_multiple">"<xliff:g id="COUNT">%s</xliff:g> uleste meldinger."</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index faa49ec..a314d6c 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Alle threads worden verwijderd."</string>
<string name="confirm_delete_message">"Het bericht wordt verwijderd."</string>
<string name="confirm_delete_all_messages">"De volledige thread wordt verwijderd."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Kan details niet ophalen"</string>
<string name="message_details_title">"Berichtdetails"</string>
<string name="message_type_label">"Type:"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index ae55a10..c06b55d 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Wszystkie wątki zostaną usunięte."</string>
<string name="confirm_delete_message">"Wiadomość zostanie usunięta."</string>
<string name="confirm_delete_all_messages">"Cały wątek zostanie usunięty."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Nie można uzyskać szczegółów"</string>
<string name="message_details_title">"Szczegóły wiadomości"</string>
<string name="message_type_label">"Typ:"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index eb60f07..1373c9b 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"Все ветки будут удалены."</string>
<string name="confirm_delete_message">"Это сообщение будет удалено."</string>
<string name="confirm_delete_all_messages">"Вся ветка будет удалена."</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"Не удается получить сведения"</string>
<string name="message_details_title">"Сведения о сообщении"</string>
<string name="message_type_label">"Тип:"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index d6cf8a7..95e5757 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"会删除所有线程。"</string>
<string name="confirm_delete_message">"会删除此信息。"</string>
<string name="confirm_delete_all_messages">"会删除整个线程。"</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"无法获取详情"</string>
<string name="message_details_title">"信息详情"</string>
<string name="message_type_label">"类型:"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index ed18b6d..1bc850d 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -167,6 +167,8 @@
<string name="confirm_delete_all_conversations">"所有會話群組都會被刪除。"</string>
<string name="confirm_delete_message">"此簡訊將被刪除。"</string>
<string name="confirm_delete_all_messages">"將刪除整個會話群組。"</string>
+ <!-- no translation found for confirm_delete_all_SIM_messages (65701806463341097) -->
+ <skip />
<string name="cannot_get_details">"無法取得細節"</string>
<string name="message_details_title">"簡訊細節"</string>
<string name="message_type_label">"類型:"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index a4d33e0..15ac245 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -42,7 +42,8 @@
<string name="menu_delete_all">Delete threads</string>
<!-- Context menu item on an individual conversation for deleting that conversation -->
<string name="menu_delete">Delete</string>
- <!-- Menu item for viewing all messages that were unable to be delivered, i.e. send failed -->
+ <!-- This string is no longer used. It used to be the menu item for viewing all messages that
+ were unable to be delivered, i.e. send failed -->
<string name="menu_undelivered_messages">Undelivered messages</string>
<!-- Context menu item on an individual conversation for viewing that conversation -->
<string name="menu_view">View</string>
diff --git a/src/com/android/mms/transaction/MessagingNotification.java b/src/com/android/mms/transaction/MessagingNotification.java
index fc503d0..d4b327a 100644
--- a/src/com/android/mms/transaction/MessagingNotification.java
+++ b/src/com/android/mms/transaction/MessagingNotification.java
@@ -22,8 +22,8 @@
import com.android.mms.R;
import com.android.mms.ui.ComposeMessageActivity;
+import com.android.mms.ui.ConversationList;
import com.android.mms.ui.MessagingPreferenceActivity;
-import com.android.mms.ui.UndeliveredMessagesActivity;
import com.android.mms.util.AddressUtils;
import com.android.mms.util.ContactNameCache;
import com.android.mms.util.DownloadManager;
@@ -420,13 +420,8 @@
NotificationManager nm = (NotificationManager)
context.getSystemService(Context.NOTIFICATION_SERVICE);
- Intent failedIntent = null;
- if (isDownload) {
- failedIntent = new Intent(context, ComposeMessageActivity.class);
- failedIntent.putExtra("thread_id", threadId);
- } else {
- failedIntent = new Intent(context, UndeliveredMessagesActivity.class);
- }
+ Intent failedIntent = new Intent(context, ComposeMessageActivity.class);
+ failedIntent.putExtra("thread_id", threadId);
PendingIntent pendingIntent = PendingIntent.getActivity(
context, 0, failedIntent, 0);
diff --git a/src/com/android/mms/ui/ComposeMessageActivity.java b/src/com/android/mms/ui/ComposeMessageActivity.java
index 61dd3b3..3a523f7 100644
--- a/src/com/android/mms/ui/ComposeMessageActivity.java
+++ b/src/com/android/mms/ui/ComposeMessageActivity.java
@@ -104,7 +104,6 @@
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
-import android.view.MotionEvent;
import android.view.View;
import android.view.ViewStub;
import android.view.Window;
@@ -254,7 +253,6 @@
// properties of the message -- any bit set
// will require conversion to MMS.
- private int mMsgSize; // Number of septets or octets required for the message.
private int mMsgCount; // Number of SMS messages required to send the current message.
// These fields are only used in MMS compose mode (requiresMms() == true) and should
@@ -389,7 +387,6 @@
}
private void resetCounter() {
- mMsgSize = 0;
mMsgCount = 1;
mTextCounter.setText("");
@@ -407,7 +404,6 @@
* int[3] is the encoding type that should be used for the message.
*/
mMsgCount = params[0];
- mMsgSize = params[1];
int remainingInCurrentMessage = params[2];
if (mMsgCount > 1 || remainingInCurrentMessage <= CHARS_REMAINING_BEFORE_COUNTER_SHOWN) {
@@ -466,8 +462,14 @@
// Get text from slideshow if needed.
if (mAttachmentEditor != null) {
int attachmentType = mAttachmentEditor.getAttachmentType();
- if (AttachmentEditor.TEXT_ONLY == attachmentType) {
- mMsgText = mSlideshow.get(0).getText().getText();
+ if (AttachmentEditor.TEXT_ONLY == attachmentType && mSlideshow != null) {
+ SlideModel model = mSlideshow.get(0);
+ if (model != null) {
+ TextModel textModel = model.getText();
+ if (textModel != null) {
+ mMsgText = textModel.getText();
+ }
+ }
}
}
@@ -617,58 +619,6 @@
}
}
- private class ResizeButtonListener implements OnClickListener {
- private final Uri mImageUri;
- private final ResizeImageResultCallback
- mCallback = new ResizeImageResultCallback() {
- public void onResizeResult(PduPart part) {
- Context context = ComposeMessageActivity.this;
- Resources r = context.getResources();
-
- if (part == null) {
- Toast.makeText(context,
- r.getString(R.string.failed_to_add_media, getPictureString()),
- Toast.LENGTH_SHORT).show();
- return;
- }
-
- convertMessageIfNeeded(HAS_ATTACHMENT, true);
- try {
- long messageId = ContentUris.parseId(mMessageUri);
- Uri newUri = mPersister.persistPart(part, messageId);
- mAttachmentEditor.changeImage(newUri);
- mAttachmentEditor.setAttachment(
- mSlideshow, AttachmentEditor.IMAGE_ATTACHMENT);
- } catch (MmsException e) {
- Toast.makeText(context,
- r.getString(R.string.failed_to_add_media, getPictureString()),
- Toast.LENGTH_SHORT).show();
- } catch (UnsupportContentTypeException e) {
- MessageUtils.showErrorDialog(context,
- r.getString(R.string.unsupported_media_format, getPictureString()),
- r.getString(R.string.select_different_media, getPictureString()));
- } catch (ResolutionException e) {
- MessageUtils.showErrorDialog(context,
- r.getString(R.string.failed_to_resize_image),
- r.getString(R.string.resize_image_error_information));
- } catch (ExceedMessageSizeException e) {
- MessageUtils.showErrorDialog(context,
- r.getString(R.string.exceed_message_size_limitation),
- r.getString(R.string.failed_to_add_media, getPictureString()));
- }
- }
- };
-
- public ResizeButtonListener(Uri uri) {
- mImageUri = uri;
- }
-
- public void onClick(DialogInterface dialog, int which) {
- MessageUtils.resizeImageAsync(ComposeMessageActivity.this,
- mImageUri, mAttachmentEditorHandler, mCallback);
- }
- }
-
private void discardTemporaryMessage() {
if (requiresMms()) {
if (mMessageUri != null) {
@@ -1038,8 +988,6 @@
menu.setHeaderTitle(R.string.message_options);
- String recipient = msgItem.mAddress;
-
MsgListMenuClickListener l = new MsgListMenuClickListener();
if (msgItem.isMms()) {
switch (msgItem.mBoxId) {
@@ -1173,7 +1121,6 @@
String type = mMsgListCursor.getString(COLUMN_MSG_TYPE);
long msgId = mMsgListCursor.getLong(COLUMN_ID);
MessageItem msgItem = getMessageItem(type, msgId);
- String itemTitle = (String)item.getTitle();
if (msgItem == null) {
return false;
@@ -1376,9 +1323,8 @@
fout = new FileOutputStream(file);
- int size;
byte[] buffer = new byte[8000];
- while((size = fin.read(buffer)) != -1) {
+ while(fin.read(buffer) != -1) {
fout.write(buffer);
}
@@ -1646,7 +1592,7 @@
Configuration config = getResources().getConfiguration();
mIsKeyboardOpen = config.keyboardHidden == KEYBOARDHIDDEN_NO;
- mIsLandscape = config.orientation == config.ORIENTATION_LANDSCAPE;
+ mIsLandscape = config.orientation == Configuration.ORIENTATION_LANDSCAPE;
onKeyboardStateChanged(mIsKeyboardOpen);
if (TRACE) {
@@ -1760,13 +1706,7 @@
if (mMsgListAdapter != null) {
mMsgListAdapter.registerObservers();
- synchronized (mMsgListCursorLock) {
- if (mMsgListCursor == null) {
- startMsgListQuery();
- } else {
- SqliteWrapper.requery(this, mMsgListCursor);
- }
- }
+ startMsgListQuery();
}
}
@@ -1921,7 +1861,7 @@
}
mIsKeyboardOpen = newConfig.keyboardHidden == KEYBOARDHIDDEN_NO;
- mIsLandscape = newConfig.orientation == newConfig.ORIENTATION_LANDSCAPE;
+ mIsLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE;
onKeyboardStateChanged(mIsKeyboardOpen);
}
@@ -2391,6 +2331,45 @@
}
}
+ private final ResizeImageResultCallback mResizeImageCallback = new ResizeImageResultCallback() {
+ public void onResizeResult(PduPart part) {
+ Context context = ComposeMessageActivity.this;
+ Resources r = context.getResources();
+
+ if (part == null) {
+ Toast.makeText(context,
+ r.getString(R.string.failed_to_add_media, getPictureString()),
+ Toast.LENGTH_SHORT).show();
+ return;
+ }
+
+ convertMessageIfNeeded(HAS_ATTACHMENT, true);
+ try {
+ long messageId = ContentUris.parseId(mMessageUri);
+ Uri newUri = mPersister.persistPart(part, messageId);
+ mAttachmentEditor.changeImage(newUri);
+ mAttachmentEditor.setAttachment(
+ mSlideshow, AttachmentEditor.IMAGE_ATTACHMENT);
+ } catch (MmsException e) {
+ Toast.makeText(context,
+ r.getString(R.string.failed_to_add_media, getPictureString()),
+ Toast.LENGTH_SHORT).show();
+ } catch (UnsupportContentTypeException e) {
+ MessageUtils.showErrorDialog(context,
+ r.getString(R.string.unsupported_media_format, getPictureString()),
+ r.getString(R.string.select_different_media, getPictureString()));
+ } catch (ResolutionException e) {
+ MessageUtils.showErrorDialog(context,
+ r.getString(R.string.failed_to_resize_image),
+ r.getString(R.string.resize_image_error_information));
+ } catch (ExceedMessageSizeException e) {
+ MessageUtils.showErrorDialog(context,
+ r.getString(R.string.exceed_message_size_limitation),
+ r.getString(R.string.failed_to_add_media, getPictureString()));
+ }
+ }
+ };
+
private void addImage(Uri uri) {
try {
mAttachmentEditor.changeImage(uri);
@@ -2404,15 +2383,8 @@
getResourcesString(R.string.unsupported_media_format, getPictureString()),
getResourcesString(R.string.select_different_media, getPictureString()));
} catch (ResolutionException e) {
- MessageUtils.showResizeConfirmDialog(
- this, new ResizeButtonListener(uri),
- new Runnable() {
- public void run() {
- if (!requiresMms()) {
- convertMessage(false);
- }
- }
- });
+ MessageUtils.resizeImageAsync(ComposeMessageActivity.this,
+ uri, mAttachmentEditorHandler, mResizeImageCallback);
} catch (ExceedMessageSizeException e) {
MessageUtils.showErrorDialog(
ComposeMessageActivity.this,
@@ -2655,17 +2627,15 @@
}
private void startMsgListQuery() {
- synchronized (mMsgListCursorLock) {
- // Cancel any pending queries
- mMsgListQueryHandler.cancelOperation(MESSAGE_LIST_QUERY_TOKEN);
- try {
- // Kick off the new query
- mMsgListQueryHandler.startQuery(
- MESSAGE_LIST_QUERY_TOKEN, null, getThreadUri(),
- PROJECTION, null, null, null);
- } catch (SQLiteException e) {
- SqliteWrapper.checkSQLiteException(this, e);
- }
+ // Cancel any pending queries
+ mMsgListQueryHandler.cancelOperation(MESSAGE_LIST_QUERY_TOKEN);
+ try {
+ // Kick off the new query
+ mMsgListQueryHandler.startQuery(
+ MESSAGE_LIST_QUERY_TOKEN, null, getThreadUri(),
+ PROJECTION, null, null, null);
+ } catch (SQLiteException e) {
+ SqliteWrapper.checkSQLiteException(this, e);
}
}
@@ -2826,7 +2796,6 @@
}
private void deleteTemporarySmsMessage(long threadId) {
- String where = getTemporarySmsMessageWhere(threadId);
SqliteWrapper.delete(this, mContentResolver,
ContentUris.withAppendedId(Sms.Conversations.CONTENT_URI, threadId),
Sms.TYPE + "=" + Sms.MESSAGE_TYPE_DRAFT, null);
diff --git a/src/com/android/mms/ui/ConversationList.java b/src/com/android/mms/ui/ConversationList.java
index 09760b9..625725e 100644
--- a/src/com/android/mms/ui/ConversationList.java
+++ b/src/com/android/mms/ui/ConversationList.java
@@ -78,7 +78,6 @@
// IDs of the main menu items.
private static final int MENU_COMPOSE_NEW = 0;
private static final int MENU_SEARCH = 1;
- private static final int MENU_UNDELIVERED_MESSAGES = 2;
private static final int MENU_DELETE_ALL = 3;
private static final int MENU_PREFERENCES = 4;
private static final int MENU_VIEW_BROADCAST_THREADS = 5;
@@ -88,7 +87,6 @@
private static final int MENU_VIEW = 1;
private Cursor mCursor;
- private final Object mCursorLock = new Object();
private ThreadListQueryHandler mQueryHandler;
private ConversationListAdapter mListAdapter;
private CharSequence mTitle;
@@ -165,13 +163,7 @@
getContentResolver().delete(Threads.OBSOLETE_THREADS_URI, null, null);
- synchronized (mCursorLock) {
- if (mCursor == null) {
- startAsyncQuery();
- } else {
- SqliteWrapper.requery(this, mCursor);
- }
- }
+ startAsyncQuery();
}
@Override
@@ -199,14 +191,12 @@
protected void onStop() {
super.onStop();
- synchronized (mCursorLock) {
- if (mCursor != null) {
- if (mListAdapter != null) {
- mListAdapter.changeCursor(null);
- }
- mCursor.close();
- mCursor = null;
+ if (mCursor != null) {
+ if (mListAdapter != null) {
+ mListAdapter.changeCursor(null);
}
+ mCursor.close();
+ mCursor = null;
}
}
@@ -231,17 +221,15 @@
private void startAsyncQuery() {
try {
- synchronized (mCursorLock) {
- setTitle(getString(R.string.refreshing));
- setProgressBarIndeterminateVisibility(true);
+ setTitle(getString(R.string.refreshing));
+ setProgressBarIndeterminateVisibility(true);
- mQueryHandler.cancelOperation(THREAD_LIST_QUERY_TOKEN);
- // FIXME: I have to pass the mQueryToken as cookie since the
- // AsyncQueryHandler.onQueryComplete() method doesn't provide
- // the same token as what I input here.
- mQueryHandler.startQuery(0, mQueryToken, mBaseUri, mProjection, mQuery, null,
- Conversations.DEFAULT_SORT_ORDER);
- }
+ mQueryHandler.cancelOperation(THREAD_LIST_QUERY_TOKEN);
+ // FIXME: I have to pass the mQueryToken as cookie since the
+ // AsyncQueryHandler.onQueryComplete() method doesn't provide
+ // the same token as what I input here.
+ mQueryHandler.startQuery(0, mQueryToken, mBaseUri, mProjection, mQuery, null,
+ Conversations.DEFAULT_SORT_ORDER);
} catch (SQLiteException e) {
SqliteWrapper.checkSQLiteException(this, e);
}
@@ -261,24 +249,6 @@
android.R.drawable.ic_menu_delete);
}
- // Check undelivered messages
- Cursor mmsCursor = SqliteWrapper.query(this, getContentResolver(),
- Mms.Outbox.CONTENT_URI, null, null, null, null);
- Cursor smsCursor = SqliteWrapper.query(this, getContentResolver(),
- Uri.withAppendedPath(Sms.CONTENT_URI, "undelivered"),
- null, null, null, null);
- if (((mmsCursor != null) && (mmsCursor.getCount() > 0)) ||
- ((smsCursor != null) && (smsCursor.getCount() > 0))) {
- menu.add(0, MENU_UNDELIVERED_MESSAGES, 0, R.string.menu_undelivered_messages).setIcon(
- R.drawable.ic_menu_undelivered);
- }
- if (mmsCursor != null) {
- mmsCursor.close();
- }
- if (smsCursor != null) {
- smsCursor.close();
- }
-
menu.add(0, MENU_PREFERENCES, 0, R.string.menu_preferences).setIcon(
android.R.drawable.ic_menu_preferences);
@@ -297,11 +267,6 @@
case MENU_DELETE_ALL:
confirmDeleteDialog(new DeleteThreadListener(-1L), true);
break;
- case MENU_UNDELIVERED_MESSAGES: {
- Intent intent = new Intent(this, UndeliveredMessagesActivity.class);
- startActivityIfNeeded(intent, -1);
- break;
- }
case MENU_PREFERENCES: {
Intent intent = new Intent(this, MessagingPreferenceActivity.class);
startActivityIfNeeded(intent, -1);
@@ -496,44 +461,42 @@
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
- synchronized (mCursorLock) {
- if (mCursor != null) {
- mCursor.close();
- }
-
- if (cursor != null) {
- mCursor = cursor;
- switch ((Integer) cookie) {
- case THREAD_LIST_QUERY_TOKEN:
- mListAdapter = new ConversationListAdapter(
- ConversationList.this,
- cursor,
- true, // simple (non-search)
- mListAdapter,
- mCachingNameStore);
- break;
- case SEARCH_TOKEN:
- mListAdapter = new ConversationListAdapter(
- ConversationList.this,
- cursor,
- false, // non-simple (search)
- mListAdapter,
- mCachingNameStore);
- break;
- default:
- Log.e(TAG, "Bad query token: " + token);
- break;
- }
-
- ConversationList.this.setListAdapter(mListAdapter);
- } else {
- Log.e(TAG, "Cannot init the cursor for the thread list.");
- finish();
- }
-
- setTitle(mTitle);
- setProgressBarIndeterminateVisibility(false);
+ if (mCursor != null) {
+ mCursor.close();
}
+
+ if (cursor != null) {
+ mCursor = cursor;
+ switch ((Integer) cookie) {
+ case THREAD_LIST_QUERY_TOKEN:
+ mListAdapter = new ConversationListAdapter(
+ ConversationList.this,
+ cursor,
+ true, // simple (non-search)
+ mListAdapter,
+ mCachingNameStore);
+ break;
+ case SEARCH_TOKEN:
+ mListAdapter = new ConversationListAdapter(
+ ConversationList.this,
+ cursor,
+ false, // non-simple (search)
+ mListAdapter,
+ mCachingNameStore);
+ break;
+ default:
+ Log.e(TAG, "Bad query token: " + token);
+ break;
+ }
+
+ ConversationList.this.setListAdapter(mListAdapter);
+ } else {
+ Log.e(TAG, "Cannot init the cursor for the thread list.");
+ finish();
+ }
+
+ setTitle(mTitle);
+ setProgressBarIndeterminateVisibility(false);
}
@Override
@@ -548,13 +511,8 @@
MessagingNotification.updateSendFailedNotification(ConversationList.this);
// Make sure the list reflects the delete
- synchronized (mCursorLock) {
- if (mCursor == null) {
- startAsyncQuery();
- } else {
- SqliteWrapper.requery(ConversationList.this, mCursor);
- }
- }
+ startAsyncQuery();
+
onContentChanged();
break;
}
diff --git a/src/com/android/mms/ui/MessageItem.java b/src/com/android/mms/ui/MessageItem.java
index e6109bc..93b8b3a 100644
--- a/src/com/android/mms/ui/MessageItem.java
+++ b/src/com/android/mms/ui/MessageItem.java
@@ -77,8 +77,9 @@
mContext = context;
mThreadType = threadType;
mMsgId = cursor.getLong(columnsMap.mColumnMsgId);
-
+
if ("sms".equals(type)) {
+ ContactNameCache nameCache = ContactNameCache.getInstance();
mReadReport = false; // No read reports in sms
mDeliveryReport = (cursor.getLong(columnsMap.mColumnSmsStatus)
!= Sms.STATUS_NONE);
@@ -95,11 +96,12 @@
} else {
mContact = String.format(
context.getString(R.string.broadcast_from_to),
- meString, mAddress);
+ meString,
+ nameCache.getContactName(context, mAddress));
}
} else {
// For incoming messages, the ADDRESS field contains the sender.
- mContact = ContactNameCache.getInstance().getContactName(context, mAddress);
+ mContact = nameCache.getContactName(context, mAddress);
}
mBody = cursor.getString(columnsMap.mColumnSmsBody);
diff --git a/src/com/android/mms/ui/MessageUtils.java b/src/com/android/mms/ui/MessageUtils.java
index 0a9eb30..a23ade9 100644
--- a/src/com/android/mms/ui/MessageUtils.java
+++ b/src/com/android/mms/ui/MessageUtils.java
@@ -556,13 +556,27 @@
public static void resizeImageAsync(final Context context,
final Uri imageUri, final Handler handler,
final ResizeImageResultCallback cb) {
- final ProgressDialog progressDialog = ProgressDialog.show(
- context,
- context.getText(R.string.image_too_large),
- context.getText(R.string.compressing),
- true,
- false);
+ // Show a progress dialog if the resize hasn't finished
+ // within one second.
+
+ // Make the progress dialog.
+ final ProgressDialog progressDialog = new ProgressDialog(context);
+ progressDialog.setTitle(context.getText(R.string.image_too_large));
+ progressDialog.setMessage(context.getText(R.string.compressing));
+ progressDialog.setIndeterminate(true);
+ progressDialog.setCancelable(false);
+
+ // Stash the runnable for showing it away so we can cancel
+ // it later if the resize completes ahead of the deadline.
+ final Runnable showProgress = new Runnable() {
+ public void run() {
+ progressDialog.show();
+ }
+ };
+ // Schedule it for one second from now.
+ handler.postDelayed(showProgress, 1000);
+
new Thread(new Runnable() {
public void run() {
final PduPart part;
@@ -572,6 +586,9 @@
CarrierContentRestriction.IMAGE_WIDTH_LIMIT,
CarrierContentRestriction.IMAGE_HEIGHT_LIMIT);
} finally {
+ // Cancel pending show of the progress dialog if necessary.
+ handler.removeCallbacks(showProgress);
+ // Dismiss the progress dialog if it's around.
progressDialog.dismiss();
}
@@ -584,39 +601,6 @@
}).start();
}
- public static void showResizeConfirmDialog(Context context,
- OnClickListener resizeListener,
- final Runnable cancel) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context)
- .setIcon(R.drawable.ic_sms_error)
- .setTitle(R.string.image_too_large)
- .setMessage(R.string.ask_for_automatically_resize)
- .setPositiveButton(R.string.resize, resizeListener);
-
- if (cancel == null) {
- builder.setCancelable(true)
- .setNegativeButton(R.string.no, null);
- } else {
- OnClickListener clickCancel = new OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- cancel.run();
- }
- };
-
- OnCancelListener cancelListener = new OnCancelListener() {
- public void onCancel(DialogInterface dialog) {
- cancel.run();
- }
- };
-
- builder.setNegativeButton(R.string.no, clickCancel)
- .setOnCancelListener(cancelListener);
- }
-
-
- builder.show();
- }
-
public static void showDiscardDraftConfirmDialog(Context context,
OnClickListener listener) {
new AlertDialog.Builder(context)
diff --git a/src/com/android/mms/ui/SlideEditorActivity.java b/src/com/android/mms/ui/SlideEditorActivity.java
index cea4879..944197f 100644
--- a/src/com/android/mms/ui/SlideEditorActivity.java
+++ b/src/com/android/mms/ui/SlideEditorActivity.java
@@ -537,8 +537,7 @@
getResourcesString(R.string.unsupported_media_format, getPictureString()),
getResourcesString(R.string.select_different_media, getPictureString()));
} catch (ResolutionException e) {
- ResizeButtonListener listener = new ResizeButtonListener(data.getData());
- MessageUtils.showResizeConfirmDialog(this, listener, null);
+ MessageUtils.resizeImageAsync(this, data.getData(), new Handler(), mResizeImageCallback);
} catch (ExceedMessageSizeException e) {
MessageUtils.showErrorDialog(SlideEditorActivity.this,
getResourcesString(R.string.exceed_message_size_limitation),
@@ -561,8 +560,7 @@
getResourcesString(R.string.unsupported_media_format, getPictureString()),
getResourcesString(R.string.select_different_media, getPictureString()));
} catch (ResolutionException e) {
- ResizeButtonListener listener = new ResizeButtonListener(data.getData());
- MessageUtils.showResizeConfirmDialog(this, listener, null);
+ MessageUtils.resizeImageAsync(this, data.getData(), new Handler(), mResizeImageCallback);
} catch (ExceedMessageSizeException e) {
MessageUtils.showErrorDialog(SlideEditorActivity.this,
getResourcesString(R.string.exceed_message_size_limitation),
@@ -628,56 +626,43 @@
}
}
- private class ResizeButtonListener implements DialogInterface.OnClickListener {
- private final Uri mImageUri;
- private final ResizeImageResultCallback
- mCallback = new ResizeImageResultCallback() {
- public void onResizeResult(PduPart part) {
- Context context = SlideEditorActivity.this;
- if (part == null) {
- Toast.makeText(SlideEditorActivity.this,
- getResourcesString(R.string.failed_to_add_media, getPictureString()),
- Toast.LENGTH_SHORT).show();
- return;
- }
-
- try {
- long messageId = ContentUris.parseId(mUri);
- PduPersister persister = PduPersister.getPduPersister(context);
- Uri newUri = persister.persistPart(part, messageId);
- mSlideshowEditor.changeImage(mPosition, newUri);
-
- setReplaceButtonText(R.string.replace_image);
- } catch (MmsException e) {
- notifyUser("add picture failed");
- Toast.makeText(SlideEditorActivity.this,
- getResourcesString(R.string.failed_to_add_media, getPictureString()),
- Toast.LENGTH_SHORT).show();
- } catch (UnsupportContentTypeException e) {
- MessageUtils.showErrorDialog(SlideEditorActivity.this,
- getResourcesString(R.string.unsupported_media_format, getPictureString()),
- getResourcesString(R.string.select_different_media, getPictureString()));
- } catch (ResolutionException e) {
- MessageUtils.showErrorDialog(SlideEditorActivity.this,
- getResourcesString(R.string.failed_to_resize_image),
- getResourcesString(R.string.resize_image_error_information));
- } catch (ExceedMessageSizeException e) {
- MessageUtils.showErrorDialog(SlideEditorActivity.this,
- getResourcesString(R.string.exceed_message_size_limitation),
- getResourcesString(R.string.failed_to_add_media, getPictureString()));
- }
+ private final ResizeImageResultCallback mResizeImageCallback = new ResizeImageResultCallback() {
+ public void onResizeResult(PduPart part) {
+ Context context = SlideEditorActivity.this;
+ if (part == null) {
+ Toast.makeText(SlideEditorActivity.this,
+ getResourcesString(R.string.failed_to_add_media, getPictureString()),
+ Toast.LENGTH_SHORT).show();
+ return;
}
- };
- public ResizeButtonListener(Uri uri) {
- mImageUri = uri;
- }
+ try {
+ long messageId = ContentUris.parseId(mUri);
+ PduPersister persister = PduPersister.getPduPersister(context);
+ Uri newUri = persister.persistPart(part, messageId);
+ mSlideshowEditor.changeImage(mPosition, newUri);
- public void onClick(DialogInterface dialog, int which) {
- MessageUtils.resizeImageAsync(SlideEditorActivity.this,
- mImageUri, new Handler(), mCallback);
+ setReplaceButtonText(R.string.replace_image);
+ } catch (MmsException e) {
+ notifyUser("add picture failed");
+ Toast.makeText(SlideEditorActivity.this,
+ getResourcesString(R.string.failed_to_add_media, getPictureString()),
+ Toast.LENGTH_SHORT).show();
+ } catch (UnsupportContentTypeException e) {
+ MessageUtils.showErrorDialog(SlideEditorActivity.this,
+ getResourcesString(R.string.unsupported_media_format, getPictureString()),
+ getResourcesString(R.string.select_different_media, getPictureString()));
+ } catch (ResolutionException e) {
+ MessageUtils.showErrorDialog(SlideEditorActivity.this,
+ getResourcesString(R.string.failed_to_resize_image),
+ getResourcesString(R.string.resize_image_error_information));
+ } catch (ExceedMessageSizeException e) {
+ MessageUtils.showErrorDialog(SlideEditorActivity.this,
+ getResourcesString(R.string.exceed_message_size_limitation),
+ getResourcesString(R.string.failed_to_add_media, getPictureString()));
+ }
}
- }
+ };
private String getResourcesString(int id, String mediaName) {
Resources r = getResources();
diff --git a/src/com/android/mms/ui/UndeliveredMessagesActivity.java b/src/com/android/mms/ui/UndeliveredMessagesActivity.java
deleted file mode 100644
index 4dc08dd..0000000
--- a/src/com/android/mms/ui/UndeliveredMessagesActivity.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.mms.ui;
-
-import com.android.mms.R;
-import com.android.mms.transaction.MessageSender;
-import com.android.mms.transaction.MessagingNotification;
-import com.android.mms.transaction.SmsMessageSender;
-import com.android.mms.transaction.TransactionService;
-import com.android.mms.util.SendingProgressTokenManager;
-import com.google.android.mms.MmsException;
-import com.google.android.mms.util.SqliteWrapper;
-
-import android.app.AlertDialog;
-import android.app.ListActivity;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.DialogInterface.OnClickListener;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.BaseColumns;
-import android.provider.Telephony.Mms;
-import android.provider.Telephony.MmsSms;
-import android.provider.Telephony.Sms;
-import android.provider.Telephony.MmsSms.PendingMessages;
-import android.util.Log;
-import android.view.ContextMenu;
-import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ContextMenu.ContextMenuInfo;
-import android.view.View.OnCreateContextMenuListener;
-import android.widget.AdapterView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.AdapterView.OnItemClickListener;
-
-/**
- * Allows user to manage the undelivered messages.
- */
-public class UndeliveredMessagesActivity extends ListActivity {
- private static final String TAG = "UndeliveredMessagesActivity";
- private static final boolean DEBUG = true; //Config.LOGV && false;
-
- // IDs of the options menu items for the list of undelivered messages.
- private static final int MENU_RETRY_SENDING_ALL = 0;
- private static final int MENU_DELETE_MESSAGES = 1;
-
- // IDs of the context menu items for the list of undelivered messages.
- private static final int MENU_EDIT = 0;
- private static final int MENU_RETRY_SENDING = 1;
- private static final int MENU_DELETE = 2;
-
- private static final String[] PROJECTION = {
- MmsSms.TYPE_DISCRIMINATOR_COLUMN,
- BaseColumns._ID,
- "thread_id",
- // For SMS
- Sms.ADDRESS,
- Sms.BODY,
- Sms.DATE,
- Sms.READ,
- Sms.TYPE,
- Sms.STATUS,
- // For MMS
- Mms.SUBJECT,
- Mms.SUBJECT_CHARSET,
- Mms.DATE,
- Mms.READ,
- Mms.MESSAGE_TYPE,
- Mms.MESSAGE_BOX,
- PendingMessages.ERROR_TYPE
- };
-
- // Must be consistent with the PROJECTION.
- static final int COLUMN_MSG_TYPE = 0;
- static final int COLUMN_ID = 1;
- static final int COLUMN_THREAD_ID = 2;
- static final int COLUMN_SMS_ADDRESS = 3;
- static final int COLUMN_SMS_BODY = 4;
- static final int COLUMN_SMS_DATE = 5;
- static final int COLUMN_SMS_READ = 6;
- static final int COLUMN_SMS_BOX = 7;
- static final int COLUMN_SMS_STATUS = 8;
- static final int COLUMN_MMS_SUBJECT = 9;
- static final int COLUMN_MMS_SUBJECT_CHARSET = 10;
- static final int COLUMN_MMS_DATE = 11;
- static final int COLUMN_MMS_READ = 12;
- static final int COLUMN_MMS_MSG_TYPE = 13;
- static final int COLUMN_MMS_BOX = 14;
- static final int COLUMN_MMS_ERROR_TYPE = 15;
-
- private Cursor mCursor;
- private UndeliveredMessagesListAdapter mAdapter;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- initActivity();
- }
-
- private void initActivity() {
- // Cancel any failed message notifications
- MessagingNotification.cancelNotification(getApplicationContext(),
- MessagingNotification.MESSAGE_FAILED_NOTIFICATION_ID);
-
- mCursor = SqliteWrapper.query(this, getContentResolver(),
- MmsSms.CONTENT_UNDELIVERED_URI, PROJECTION, null, null, null);
-
- if (mCursor != null) {
- startManagingCursor(mCursor);
- } else {
- Log.e(TAG, "Cannot load undelivered messages.");
- finish();
- }
-
- // Initialize the list adapter.
- mAdapter = new UndeliveredMessagesListAdapter(this, mCursor, getListView());
- setListAdapter(mAdapter);
-
- // Initialize the context menu of the list.
- getListView().setOnCreateContextMenuListener(mOnCreateContextMenuListener);
- getListView().setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- long threadId = mCursor.getLong(COLUMN_THREAD_ID);
- long msgId = mCursor.getLong(COLUMN_ID);
- String msgType = mCursor.getString(COLUMN_MSG_TYPE);
- editMessage(threadId, msgId, msgType);
- }
- });
- }
-
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- menu.clear();
-
- if (mAdapter.getCount() > 0) {
- // Menu item 'Retry sending all'
- MenuItem mi = menu.add(0, MENU_RETRY_SENDING_ALL, 0,
- R.string.menu_retry_sending_all);
- mi.setIcon(android.R.drawable.ic_menu_send);
- mi.setAlphabeticShortcut('a');
-
- // Menu item 'Delete Messages'
- mi = menu.add(0, MENU_DELETE_MESSAGES, 0,
- R.string.menu_delete_messages);
- mi.setIcon(android.R.drawable.ic_menu_delete);
- mi.setAlphabeticShortcut('x');
- return true;
- } else {
- return super.onPrepareOptionsMenu(menu);
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case MENU_RETRY_SENDING_ALL:
- // Reset position of the cursor.
- mCursor.moveToPosition(-1);
- while (mCursor.moveToNext()) {
- long threadId = mCursor.getLong(COLUMN_THREAD_ID);
- long msgId = mCursor.getLong(COLUMN_ID);
- String msgType = mCursor.getString(COLUMN_MSG_TYPE);
- retryToSendMessage(threadId, msgId, msgType);
- }
- return true;
- case MENU_DELETE_MESSAGES:
- confirmDialog(R.string.confirm_delete_all_messages,
- mConfirmDeleteAllMessagesListener);
- return true;
- default:
- return super.onOptionsItemSelected(item);
- }
- }
-
- private final OnCreateContextMenuListener mOnCreateContextMenuListener =
- new OnCreateContextMenuListener() {
- public void onCreateContextMenu(ContextMenu menu, View v,
- ContextMenuInfo menuInfo) {
- menu.add(0, MENU_EDIT, 0, R.string.menu_edit);
- menu.add(0, MENU_RETRY_SENDING, 0, R.string.menu_retry_sending);
- menu.add(0, MENU_DELETE, 0, R.string.menu_delete);
- }
- };
-
- @Override
- public boolean onContextItemSelected(MenuItem item) {
- long threadId = mCursor.getLong(COLUMN_THREAD_ID);
- long msgId = mCursor.getLong(COLUMN_ID);
- String msgType = mCursor.getString(COLUMN_MSG_TYPE);
- switch (item.getItemId()) {
- case MENU_EDIT: {
- editMessage(threadId, msgId, msgType);
- break;
- }
- case MENU_RETRY_SENDING: {
- retryToSendMessage(threadId, msgId, msgType);
- break;
- }
- case MENU_DELETE: {
- confirmDialog(R.string.confirm_delete_message,
- mConfirmDeleteMessageListener);
- break;
- }
- }
- return super.onContextItemSelected(item);
- }
-
- private void editMessage(long threadId, long msgId, String msgType) {
- Intent intent = new Intent(this, ComposeMessageActivity.class);
- intent.putExtra("thread_id", threadId);
- intent.putExtra("undelivered_flag", true);
-
- if (msgType.equals("sms")) {
- Uri.Builder builder = Sms.Outbox.CONTENT_URI.buildUpon();
- Uri uri = builder.appendPath(Long.toString(msgId)).build();
- ContentValues values = new ContentValues(1);
- values.put(Sms.TYPE, Sms.MESSAGE_TYPE_DRAFT);
- SqliteWrapper.update(this, getContentResolver(), uri, values, null, null);
- } else {
- Uri.Builder builder = Mms.Outbox.CONTENT_URI.buildUpon();
- Uri uri = builder.appendPath(Long.toString(msgId)).build();
- ContentValues values = new ContentValues(1);
- values.put(Mms.MESSAGE_BOX, Mms.MESSAGE_BOX_DRAFTS);
- SqliteWrapper.update(this, getContentResolver(), uri, values, null, null);
- }
-
- startActivityIfNeeded(intent, -1);
- }
-
- private void retryToSendMessage(long threadId, long msgId, String msgType) {
- if ("sms".equals(msgType)) {
- // Pending SMs should be resent in other way.
- resendShortMessage(threadId, msgId);
- return;
- }
-
- Uri.Builder uriBuilder = PendingMessages.CONTENT_URI.buildUpon();
- uriBuilder.appendQueryParameter("protocol", msgType);
- uriBuilder.appendQueryParameter("message", Long.toString(msgId));
-
- Cursor cursor = SqliteWrapper.query(this, getContentResolver(),
- uriBuilder.build(), null, null, null, null);
-
- if (cursor != null) {
- try {
- if ((cursor.getCount() == 1) && cursor.moveToFirst()) {
- // Reset status of this message for retrying.
- ContentValues values = new ContentValues(3);
- values.put(PendingMessages.ERROR_TYPE, 0);
- values.put(PendingMessages.RETRY_INDEX, 0);
- values.put(PendingMessages.DUE_TIME, 0);
-
- int columnIndex = cursor.getColumnIndexOrThrow(
- PendingMessages._ID);
- long id = cursor.getLong(columnIndex);
- getContentResolver().update(PendingMessages.CONTENT_URI,
- values, PendingMessages._ID + "=" + id, null);
-
- SendingProgressTokenManager.put(msgId, threadId);
-
- // Start transaction service to retry sending.
- startService(new Intent(this, TransactionService.class));
-
- // Show dialog to notify user the retrying is in progress.
- LinearLayout dialog = (LinearLayout) LayoutInflater.from(this).inflate(
- R.layout.retry_sending_dialog, null);
-
- long last = cursor.getLong(cursor.getColumnIndexOrThrow(
- PendingMessages.LAST_TRY));
- String body = getString(R.string.retrying_dialog_body).replace(
- "%s", MessageUtils.formatTimeStampString(this, last));
- ((TextView) dialog.findViewById(R.id.body_text_view)).setText(body);
- }
- } finally {
- cursor.close();
- }
- }
- }
-
- private void resendShortMessage(long threadId, long msgId) {
- Uri uri = ContentUris.withAppendedId(Sms.CONTENT_URI, msgId);
- Cursor cursor = SqliteWrapper.query(this, getContentResolver(),
- uri, new String[] { Sms.ADDRESS, Sms.BODY }, null, null, null);
-
- if (cursor != null) {
- try {
- if ((cursor.getCount() == 1) && cursor.moveToFirst()) {
- MessageSender sender = new SmsMessageSender(
- this, new String[] { cursor.getString(0) },
- cursor.getString(1), threadId);
- sender.sendMessage(threadId);
-
- // Delete the undelivered message since the sender will
- // save a new one into database.
- SqliteWrapper.delete(this, getContentResolver(), uri, null, null);
- }
- } catch (MmsException e) {
- Log.e(TAG, e.getMessage());
- } finally {
- cursor.close();
- }
- }
- }
-
- private final OnClickListener mConfirmDeleteMessageListener = new OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- deleteMessageByCursor(UndeliveredMessagesActivity.this, mCursor);
- }
- };
-
- private final OnClickListener mConfirmDeleteAllMessagesListener = new OnClickListener() {
- public void onClick(DialogInterface dialog, int which) {
- // Reset position of the cursor.
- mCursor.moveToPosition(-1);
- while (mCursor.moveToNext()) {
- deleteMessageByCursor(UndeliveredMessagesActivity.this, mCursor);
- }
-
- finish(); // leave this activity.
- }
- };
-
- private void confirmDialog(int messageId, OnClickListener listener) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.confirm_dialog_title);
- builder.setCancelable(true);
- builder.setMessage(messageId);
- builder.setPositiveButton(R.string.yes, listener);
- builder.setNegativeButton(R.string.no, null);
-
- builder.show();
- }
-
- static void deleteMessageByCursor(Context context, Cursor cursor) {
- String type = cursor.getString(COLUMN_MSG_TYPE);
- long msgId = cursor.getLong(COLUMN_ID);
- Uri baseUri = type.equals("sms") ? Sms.CONTENT_URI: Mms.CONTENT_URI;
- SqliteWrapper.delete(context, context.getContentResolver(),
- ContentUris.withAppendedId(baseUri, msgId), null, null);
- }
-}
-
diff --git a/src/com/android/mms/ui/UndeliveredMessagesListAdapter.java b/src/com/android/mms/ui/UndeliveredMessagesListAdapter.java
deleted file mode 100644
index 5b1058b..0000000
--- a/src/com/android/mms/ui/UndeliveredMessagesListAdapter.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2008 Esmertec AG.
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.mms.ui;
-
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_ID;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_MMS_ERROR_TYPE;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_MMS_MSG_TYPE;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_MSG_TYPE;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_SMS_ADDRESS;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_SMS_BODY;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_SMS_DATE;
-import static com.android.mms.ui.UndeliveredMessagesActivity.COLUMN_SMS_STATUS;
-
-import com.android.mms.R;
-import com.android.mms.util.ContactNameCache;
-import com.google.android.mms.MmsException;
-import com.google.android.mms.pdu.EncodedStringValue;
-import com.google.android.mms.pdu.MultimediaMessagePdu;
-import com.google.android.mms.pdu.PduHeaders;
-import com.google.android.mms.pdu.PduPersister;
-import com.google.android.mms.pdu.SendReq;
-
-import android.content.ContentUris;
-import android.content.Context;
-import android.database.Cursor;
-import android.net.Uri;
-import android.provider.Telephony.Mms;
-import android.provider.Telephony.MmsSms;
-import android.provider.Telephony.Sms;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CursorAdapter;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.TextView;
-
-/**
- * The back-end data adapter of undelivered messages list.
- */
-public class UndeliveredMessagesListAdapter extends CursorAdapter {
- private static final String TAG = "UndeliveredMessagesListAdapter";
-
- private final LayoutInflater mInflater;
- private final ListView mListView;
-
- public UndeliveredMessagesListAdapter(Context context, Cursor c,
- ListView listView) {
- super(context, c);
-
- mInflater = (LayoutInflater) context.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
- mListView = listView;
- }
-
- @Override
- public void bindView(View view, Context context, Cursor cursor) {
- String type = cursor.getString(COLUMN_MSG_TYPE);
- int errorType = cursor.getInt(COLUMN_MMS_ERROR_TYPE);
- int status = cursor.getInt(COLUMN_SMS_STATUS);
- if (type.equals("mms")) {
- bindMmsView(view, context, cursor);
- } else if(type.equals("sms")) {
- bindSmsView(view, context, cursor);
- }
-
- // Show error icon for all undelivered messages.
- ImageView errIcon = (ImageView) view.findViewById(R.id.error);
- if ((type.equals("mms") && (errorType < MmsSms.ERR_TYPE_GENERIC_PERMANENT))
- || (type.equals("sms") && (status == Sms.STATUS_PENDING))) {
- errIcon.setImageResource(R.drawable.ic_dialog_email_pending);
- } else {
- errIcon.setImageResource(R.drawable.ic_sms_error);
- }
- errIcon.setVisibility(View.VISIBLE);
- }
-
- @Override
- public View newView(Context context, Cursor cursor, ViewGroup parent) {
- return mInflater.inflate(R.layout.conversation_header, parent, false);
- }
-
- @Override
- public void notifyDataSetChanged() {
- super.notifyDataSetChanged();
- mListView.setSelection(mListView.getCount());
- }
-
- private void bindSmsView(View view, Context context, Cursor cursor) {
- // Set contact and message body
- String contact = ContactNameCache.getInstance().getContactName(
- mContext, cursor.getString(COLUMN_SMS_ADDRESS));
- contact = mContext.getString(R.string.to_label) + contact;
- TextView addrView = (TextView) view.findViewById(R.id.from);
- addrView.setText(contact);
-
- String body = cursor.getString(COLUMN_SMS_BODY);
- TextView bodyView = (TextView) view.findViewById(R.id.subject);
- bodyView.setText(body);
-
- // Set time stamp
- TextView timeStamp = (TextView) view.findViewById(R.id.date);
- long date = cursor.getLong(COLUMN_SMS_DATE);
- String time = MessageUtils.formatTimeStampString(context, date);
- timeStamp.setText(time);
- }
-
- private void bindMmsView(View view, Context context, Cursor cursor) {
- if (cursor.getInt(COLUMN_MMS_MSG_TYPE)
- != PduHeaders.MESSAGE_TYPE_SEND_REQ) {
- return;
- }
-
- long msgId = cursor.getLong(COLUMN_ID);
- Uri uri = ContentUris.withAppendedId(Mms.CONTENT_URI, msgId);
- MultimediaMessagePdu msg;
- try {
- msg = (MultimediaMessagePdu) PduPersister.getPduPersister(
- mContext).load(uri);
- } catch (MmsException e) {
- Log.e(TAG, "Cannot load: " + uri);
- return;
- }
-
- TextView bodyView = (TextView) view.findViewById(R.id.subject);
- EncodedStringValue subject = msg.getSubject();
- bodyView.setText(subject == null ? "" : subject.getString());
-
- // Get display address.
- String contact = ContactNameCache.getInstance().getContactName(
- mContext, EncodedStringValue.concat(((SendReq) msg).getTo()));
- contact = mContext.getString(R.string.to_label) + contact;
- TextView addrView = (TextView) view.findViewById(R.id.from);
- addrView.setText(contact);
-
- String timeStamp = MessageUtils.formatTimeStampString(
- mContext, ((SendReq) msg).getDate() * 1000L);
- TextView timeStampView = (TextView) view.findViewById(R.id.date);
- timeStampView.setText(timeStamp);
- }
-}