diff --git a/api/current.txt b/api/current.txt index 454e5da9a0809..ee2a1cfa48cc8 100644 --- a/api/current.txt +++ b/api/current.txt @@ -98,6 +98,7 @@ package android { field public static final java.lang.String RECORD_AUDIO = "android.permission.RECORD_AUDIO"; field public static final java.lang.String REORDER_TASKS = "android.permission.REORDER_TASKS"; field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES"; + field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE"; field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS"; field public static final java.lang.String SET_ACTIVITY_WATCHER = "android.permission.SET_ACTIVITY_WATCHER"; field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM"; @@ -20997,6 +20998,7 @@ package android.telephony { method public boolean isNetworkRoaming(); method public void listen(android.telephony.PhoneStateListener, int); field public static final java.lang.String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; + field public static final java.lang.String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final int CALL_STATE_IDLE = 0; // 0x0 field public static final int CALL_STATE_OFFHOOK = 2; // 0x2 field public static final int CALL_STATE_RINGING = 1; // 0x1 diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 2a357afc28ef8..ce1372ded398c 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -220,7 +220,7 @@ android:permissionGroupFlags="personalInfo" android:priority="360"/> - + - - + + android:label="@string/permlab_sendRespondViaMessageRequest" + android:description="@string/permdesc_sendRespondViaMessageRequest" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index d1a7703d7138c..d17408166ea08 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -596,12 +596,12 @@ This may result in unexpected charges. Malicious apps may cost you money by sending messages without your confirmation. - - send SMS messages with no confirmation - - Allows the app to send SMS - messages. This may result in unexpected charges. Malicious apps may cost - you money by sending messages without your confirmation. + + send respond-via-message events + + Allows the app to send + requests to other messaging apps to handle respond-via-message events for incoming + calls. read your text messages (SMS or MMS) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2e8de3ba2f677..80aa778f5aeba 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -124,6 +124,28 @@ public class TelephonyManager { public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; + /** + * The Phone app sends this intent when a user opts to respond-via-message during an incoming + * call. By default, the MMS app consumes this message and sends a text message to the caller. A + * third party app can provide this functionality in lieu of MMS app by consuming this Intent + * and sending the message using their own messaging system. The intent contains a URI + * describing the recipient, and an EXTRA containg the message itself. + *

+ * The intent-filter which consumes this Intent needs to be in a service which requires the + * permission SEND_RESPOND_VIA_MESSAGE. + * + *

+ * {@link #getData} is a URI describing the recipient of the message. + *

+ * The {@link android.intent.Intent#EXTRA_TEXT} extra contains the message + * to send. + *

+ * Output: nothing. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_RESPOND_VIA_MESSAGE = + "android.intent.action.RESPOND_VIA_MESSAGE"; + /** * The lookup key used with the {@link #ACTION_PHONE_STATE_CHANGED} broadcast * for a String containing the new call state.