diff --git a/api/current.txt b/api/current.txt index e7d1d54f9384f..ac576b13584b4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -101,6 +101,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"; @@ -21075,6 +21076,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 e5aca48484077..5783bf6105d27 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -196,7 +196,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 aae509edcdfc6..22f4e2e036b56 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -601,12 +601,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 cd2a60012a9b7..cee66d7aa5ef0 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -125,6 +125,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.