diff options
author | Tom Taylor <tomtaylor@google.com> | 2011-08-11 14:35:31 -0700 |
---|---|---|
committer | Tom Taylor <tomtaylor@google.com> | 2011-08-15 10:56:08 -0700 |
commit | 6d38b19aa9aef46afa855187f23e44d4c06f8878 (patch) | |
tree | 626c2cb14ae1ac1d4d826245bb5fa4220b43fcd9 /apptests/res | |
parent | 4f59ce252207e067b2c06a48dc65c6338a16dab6 (diff) | |
download | packages_apps_Mms-6d38b19aa9aef46afa855187f23e44d4c06f8878.zip packages_apps_Mms-6d38b19aa9aef46afa855187f23e44d4c06f8878.tar.gz packages_apps_Mms-6d38b19aa9aef46afa855187f23e44d4c06f8878.tar.bz2 |
Add new send sms intent
Add a new intent to send an sms message without any UI interaction.
Presently, the Messaging app can already respond to intents with
the android.intent.action.SENDTO action, but this brings up the
ComposeMessageActivity primed with a destination and message. It's up
to the user to review the message and hit send. This new intent will
send the message to the user without the user seeing the compose screen
and having to hit send. Apps could already send sms's by talking
directly to the SmsManager. Using this new intent, however, has the
benefit of adding the outgoing message to a thread so the user will
be able to see what was sent. In addition, sending a message via the
Messaging app compare to the SmsManager will add automatica retry when
there's no connection, etc. This new feature could be used by the phone
app so the user could easily respond to an incoming phone call by sending a canned sms that
reads, "I'm busy, but I'll call you right back." A caller of this new
intent must have android.permission.SEND_SMS_NO_CONFIRMATION. An
accompanying CL adds the private permission to the framework.
An included test app tests the feature. Bug 4563486
Change-Id: I9292ea6d52e135cdabcfe68091d4d24d15524c97
Signed-off-by: Tom Taylor <tomtaylor@google.com>
Diffstat (limited to 'apptests/res')
-rw-r--r-- | apptests/res/layout/sms_send_intent_test.xml | 66 | ||||
-rw-r--r-- | apptests/res/values/strings.xml | 33 |
2 files changed, 99 insertions, 0 deletions
diff --git a/apptests/res/layout/sms_send_intent_test.xml b/apptests/res/layout/sms_send_intent_test.xml new file mode 100644 index 0000000..43ac45e --- /dev/null +++ b/apptests/res/layout/sms_send_intent_test.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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. +--> + +<!-- Demonstrates sending and receiving SMS messages. + See corresponding Java code SmsMessagingDemo.java +--> + +<ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + <LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="6dip"> + <TableLayout + android:padding="6dip" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:stretchColumns="1"> + <TableRow android:layout_width="match_parent"> + <TextView android:text="@string/sms_recipient_label" /> + <EditText android:id="@+id/sms_recipient" /> + </TableRow> + <TableRow> + <TextView android:text="@string/sms_content_label" /> + <EditText android:id="@+id/sms_content" + android:scrollHorizontally="true" /> + </TableRow> + </TableLayout> + <Button + android:id="@+id/sms_send_message" + android:text="@string/sms_send_message" + android:layout_width="150dip" + android:layout_height="wrap_content" /> + <Button + android:id="@+id/sms_send_multi_message" + android:text="@string/sms_send_multi_message" + android:layout_width="150dip" + android:layout_height="wrap_content" /> + <Button + android:id="@+id/sms_send_long_message" + android:text="@string/sms_send_long_message" + android:layout_width="150dip" + android:layout_height="wrap_content" /> + <Button + android:id="@+id/sms_prime_message" + android:text="@string/sms_prime_message" + android:layout_width="150dip" + android:layout_height="wrap_content" /> + </LinearLayout> +</ScrollView> diff --git a/apptests/res/values/strings.xml b/apptests/res/values/strings.xml new file mode 100644 index 0000000..ef4a45a --- /dev/null +++ b/apptests/res/values/strings.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright (C) 2011 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. + */ +--> + +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="sms_recipient_label">Recipient #</string> + <string name="sms_content_label">Message Body</string> + <string name="sms_send_message">Send</string> + <string name="sms_send_multi_message">Send five messages</string> + <string name="sms_send_long_message">Send a long message</string> + <string name="sms_prime_message">Prime a long message</string> + <string name="sms_long_message">Now is the time for all good men to come to the aid of their country.</string> + <string name="reply">Reply</string> + <string name="dismiss">Dismiss</string> + <string name="activity_label">Sms Tester</string> + +</resources> + |