diff options
author | Ye Wen <ywen@google.com> | 2015-02-27 14:21:18 -0800 |
---|---|---|
committer | Ye Wen <ywen@google.com> | 2015-02-27 14:21:18 -0800 |
commit | e03feaba8ca6d25163ff19e433a3a3c460e834e8 (patch) | |
tree | 1aa923d42f7bc454a3f2536aa5ad826a85744d2d /src | |
parent | fc80ae2fc8149e783e2dfaafb8aa9794cd639bc1 (diff) | |
download | android_packages_services_Mms-e03feaba8ca6d25163ff19e433a3a3c460e834e8.tar.gz android_packages_services_Mms-e03feaba8ca6d25163ff19e433a3a3c460e834e8.tar.bz2 android_packages_services_Mms-e03feaba8ca6d25163ff19e433a3a3c460e834e8.zip |
Remove airplane mode and mobile data check for MMS request execution
The check prevents MMS from being sent if wifi or other channel can be
used to send MMS. When there is an API in telephony allowing the check
of available MMS channels, the check should be added back
b/19519883
Change-Id: Ie90a4f3eabf3155159dd307bd613f669cda88ac6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/mms/service/MmsRequest.java | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/com/android/mms/service/MmsRequest.java b/src/com/android/mms/service/MmsRequest.java index 00aea57..27cb968 100644 --- a/src/com/android/mms/service/MmsRequest.java +++ b/src/com/android/mms/service/MmsRequest.java @@ -107,21 +107,6 @@ public abstract class MmsRequest { return mMmsConfig != null; } - private static boolean inAirplaneMode(final Context context) { - return Settings.System.getInt(context.getContentResolver(), - Settings.Global.AIRPLANE_MODE_ON, 0) != 0; - } - - private static boolean isMobileDataEnabled(final Context context, final int subId) { - final TelephonyManager telephonyManager = - (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); - return telephonyManager.getDataEnabled(subId); - } - - private static boolean isDataNetworkAvailable(final Context context, final int subId) { - return !inAirplaneMode(context) && isMobileDataEnabled(context, subId); - } - /** * Execute the request * @@ -132,15 +117,14 @@ public abstract class MmsRequest { int result = SmsManager.MMS_ERROR_UNSPECIFIED; int httpStatusCode = 0; byte[] response = null; + // TODO: add mms data channel check back to fast fail if no way to send mms, + // when telephony provides such API. if (!ensureMmsConfigLoaded()) { // Check mms config Log.e(MmsService.TAG, "MmsRequest: mms config is not loaded yet"); result = SmsManager.MMS_ERROR_CONFIGURATION_ERROR; } else if (!prepareForHttpRequest()) { // Prepare request, like reading pdu data from user Log.e(MmsService.TAG, "MmsRequest: failed to prepare for request"); result = SmsManager.MMS_ERROR_IO_ERROR; - } else if (!isDataNetworkAvailable(context, mSubId)) { - Log.e(MmsService.TAG, "MmsRequest: in airplane mode or mobile data disabled"); - result = SmsManager.MMS_ERROR_NO_DATA_NETWORK; } else { // Execute long retryDelaySecs = 2; // Try multiple times of MMS HTTP request |