UPDATE: I just found this thread, basically saying to set your APN Type as just "mms". Then when your data is enabled, it will only allow mms data. Not sure on how the battery is affected by this.
Enable Data for Incoming MMS
There are two Intent actions that can help us here.
The first is android.provider.Telephony.WAP_PUSH_RECEIVED
, which is triggered when an MMS is first received.
The other is android.intent.action.TRANSACTION_COMPLETED_ACTION
, which triggers when an MMS has finished downloading its content.
The following receiver definition in my AndroidManifest.xml worked on my phone when receiving and downloading an MMS:
<receiver android:name="com.freek.mmsdataenabler.MMSReceiver" >
<intent-filter android:priority="999" >
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
<data android:mimeType="application/vnd.wap.mms-message" />
</intent-filter>
<intent-filter android:priority="999" >
<action android:name="android.intent.action.TRANSACTION_COMPLETED_ACTION" />
</intent-filter>
</receiver>
All you need to do then is implement MMSReceiver and then have it enable and disable data appropriately.
Using Tasker
Alternatively, you can very easily implement enabling data for incoming MMS using the information above in Tasker.
- Create two tasks. One that turns Mobile Data on and one that turns it off. (Net > Mobile Data)
- Create a profile called MMS Received, and for the trigger pick Event > Phone > Received Text. Set the type to MMS. Set this profile to run the task that turns Mobile Data on.
- Create a profile called MMS Downloaded, and for the trigger pick Event > System > Intent Received. Set the Action to
android.intent.action.TRANSACTION_COMPLETED_ACTION
and Priority to highest. Set this profile to run the task that turns Mobile Data off.
I have yet to figure out how to tell when an MMS is being sent from the phone.