summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Taylor <tomtaylor@google.com>2014-11-05 22:26:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-05 22:26:07 +0000
commit9180fdc1e8ad20207e34633f37a9066468952b0c (patch)
tree549aacf475b69cff40f8b09823830fcad2218d3b
parent136b22b5d8c3ed502e383f9424f10d270b200751 (diff)
parent3abe169b6236d57fd9e053d4329045acdf9c245b (diff)
downloadMms-9180fdc1e8ad20207e34633f37a9066468952b0c.tar.gz
Merge "Don't do anything when the Messaging app isn't the default sms app" into lmp-mr1-dev
-rw-r--r--src/com/android/mms/transaction/MessageStatusService.java6
-rw-r--r--src/com/android/mms/transaction/SmsReceiverService.java4
-rw-r--r--src/com/android/mms/transaction/TransactionService.java7
-rw-r--r--src/com/android/mms/ui/NoConfirmationSendService.java6
4 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/mms/transaction/MessageStatusService.java b/src/com/android/mms/transaction/MessageStatusService.java
index d69a8dce..c7253395 100644
--- a/src/com/android/mms/transaction/MessageStatusService.java
+++ b/src/com/android/mms/transaction/MessageStatusService.java
@@ -17,6 +17,7 @@
package com.android.mms.transaction;
import android.app.IntentService;
+import android.app.Service;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
@@ -30,6 +31,7 @@ import android.telephony.SmsMessage;
import android.util.Log;
import com.android.mms.LogTag;
+import com.android.mms.MmsConfig;
/**
* Service that gets started by the MessageStatusReceiver when a message status report is
@@ -50,6 +52,10 @@ public class MessageStatusService extends IntentService {
@Override
protected void onHandleIntent(Intent intent) {
+ if (!MmsConfig.isSmsEnabled()) {
+ Log.d(LOG_TAG, "MessageStatusService: is not the default sms app");
+ return;
+ }
// This method is called on a worker thread.
Uri messageUri = intent.getData();
diff --git a/src/com/android/mms/transaction/SmsReceiverService.java b/src/com/android/mms/transaction/SmsReceiverService.java
index 0f6c11b2..6e1edf08 100644
--- a/src/com/android/mms/transaction/SmsReceiverService.java
+++ b/src/com/android/mms/transaction/SmsReceiverService.java
@@ -134,6 +134,10 @@ public class SmsReceiverService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
+ if (!MmsConfig.isSmsEnabled()) {
+ Log.d(TAG, "SmsReceiverService: is not the default sms app");
+ return Service.START_NOT_STICKY;
+ }
// Temporarily removed for this duplicate message track down.
mResultCode = intent != null ? intent.getIntExtra("result", 0) : 0;
diff --git a/src/com/android/mms/transaction/TransactionService.java b/src/com/android/mms/transaction/TransactionService.java
index 4eac8480..b07d984c 100644
--- a/src/com/android/mms/transaction/TransactionService.java
+++ b/src/com/android/mms/transaction/TransactionService.java
@@ -53,9 +53,11 @@ import com.android.internal.telephony.PhoneConstants;
import com.android.mms.LogTag;
import com.android.mms.MmsConfig;
import com.android.mms.R;
+import com.android.mms.ui.ComposeMessageActivity;
import com.android.mms.util.DownloadManager;
import com.android.mms.util.RateController;
import com.android.mms.util.SubStatusResolver;
+
import com.google.android.mms.pdu.GenericPdu;
import com.google.android.mms.pdu.NotificationInd;
import com.google.android.mms.pdu.PduHeaders;
@@ -205,6 +207,11 @@ public class TransactionService extends Service implements Observer {
}
public void onNewIntent(Intent intent, int serviceId) {
+ if (!MmsConfig.isSmsEnabled()) {
+ Log.d(TAG, "TransactionService: is not the default sms app");
+ stopSelf(serviceId);
+ return;
+ }
mConnMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (mConnMgr == null || !SubStatusResolver.isMobileDataEnabledOnAnySub(getApplicationContext())
|| !MmsConfig.isSmsEnabled()) {
diff --git a/src/com/android/mms/ui/NoConfirmationSendService.java b/src/com/android/mms/ui/NoConfirmationSendService.java
index e9e65b34..8c752c42 100644
--- a/src/com/android/mms/ui/NoConfirmationSendService.java
+++ b/src/com/android/mms/ui/NoConfirmationSendService.java
@@ -27,6 +27,7 @@ import android.util.Log;
import com.android.internal.telephony.PhoneConstants;
import com.android.mms.LogTag;
+import com.android.mms.MmsConfig;
import com.android.mms.data.Conversation;
import com.android.mms.transaction.SmsMessageSender;
@@ -48,6 +49,11 @@ public class NoConfirmationSendService extends IntentService {
protected void onHandleIntent(Intent intent) {
ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent");
+ if (!MmsConfig.isSmsEnabled()) {
+ ComposeMessageActivity.log("NoConfirmationSendService is not the default sms app");
+ return;
+ }
+
String action = intent.getAction();
if (!TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(action)) {
ComposeMessageActivity.log("NoConfirmationSendService onHandleIntent wrong action: " +