Hide APN prefs if platform APIs are used

The APN prefs is available if legacy APIs are used with local APN db
only.

Test: Manual

Change-Id: I5883dcb2c406acc601787edd02e0d3272732e6d7
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
Taesu Lee
2020-05-04 19:30:12 +09:00
parent 116073d016
commit 95ceb12cdb
2 changed files with 26 additions and 14 deletions
+16 -7
View File
@@ -135,13 +135,13 @@ public class MmsManager {
*/
public static void sendMultimediaMessage(int subId, Context context, Uri contentUri,
String locationUrl, PendingIntent sentIntent) {
if (Utils.hasMmsApi() && !sForceLegacyMms) {
if (shouldUseLegacyMms()) {
MmsService.startRequest(context, new SendRequest(locationUrl, contentUri, sentIntent));
} else {
subId = Utils.getEffectiveSubscriptionId(subId);
final SmsManager smsManager = Utils.getSmsManager(subId);
smsManager.sendMultimediaMessage(context, contentUri, locationUrl,
getConfigOverrides(subId), sentIntent);
} else {
MmsService.startRequest(context, new SendRequest(locationUrl, contentUri, sentIntent));
}
}
@@ -157,17 +157,26 @@ public class MmsManager {
*/
public static void downloadMultimediaMessage(int subId, Context context, String locationUrl,
Uri contentUri, PendingIntent downloadedIntent) {
if (Utils.hasMmsApi() && !sForceLegacyMms) {
if (shouldUseLegacyMms()) {
MmsService.startRequest(context,
new DownloadRequest(locationUrl, contentUri, downloadedIntent));
} else {
subId = Utils.getEffectiveSubscriptionId(subId);
final SmsManager smsManager = Utils.getSmsManager(subId);
smsManager.downloadMultimediaMessage(context, locationUrl, contentUri,
getConfigOverrides(subId), downloadedIntent);
} else {
MmsService.startRequest(context,
new DownloadRequest(locationUrl, contentUri, downloadedIntent));
}
}
/**
* Checks if we should use legacy APIs for MMS.
*
* @return true if forced to use legacy APIs or platform doesn't supports MMS APIs.
*/
public static boolean shouldUseLegacyMms() {
return sForceLegacyMms || !Utils.hasMmsApi();
}
/**
* Get carrier configuration values overrides when platform MMS API is called.
* We only need to compute this if customized carrier config values loader or