Loading services/core/java/com/android/server/MmsServiceBroker.java +13 −9 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.SystemClock; import android.os.UserHandle; import android.service.carrier.CarrierMessagingService; import android.telephony.SmsManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.Slog; Loading Loading @@ -341,7 +342,8 @@ public class MmsServiceBroker extends SystemService { } contentUri = adjustUriForUserAndGrantPermission(contentUri, CarrierMessagingService.SERVICE_INTERFACE, Intent.FLAG_GRANT_READ_URI_PERMISSION); Intent.FLAG_GRANT_READ_URI_PERMISSION, subId); getServiceGuarded().sendMessage(subId, callingPkg, contentUri, locationUrl, configOverrides, sentIntent); } Loading @@ -360,7 +362,8 @@ public class MmsServiceBroker extends SystemService { } contentUri = adjustUriForUserAndGrantPermission(contentUri, CarrierMessagingService.SERVICE_INTERFACE, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION, subId); getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, contentUri, configOverrides, downloadedIntent); Loading Loading @@ -501,7 +504,7 @@ public class MmsServiceBroker extends SystemService { * @return The adjusted Uri containing the calling userId. */ private Uri adjustUriForUserAndGrantPermission(Uri contentUri, String action, int permission) { int permission, int subId) { final Intent grantIntent = new Intent(); grantIntent.setData(contentUri); grantIntent.setFlags(permission); Loading @@ -522,8 +525,9 @@ public class MmsServiceBroker extends SystemService { Intent intent = new Intent(action); TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); List<String> carrierPackages = telephonyManager.getCarrierPackageNamesForIntent( intent); List<String> carrierPackages = telephonyManager.getCarrierPackageNamesForIntentAndPhone( intent, SubscriptionManager.getPhoneId(subId)); if (carrierPackages != null && carrierPackages.size() == 1) { LocalServices.getService(UriGrantsManagerInternal.class) .grantUriPermissionFromIntent(callingUid, carrierPackages.get(0), Loading Loading
services/core/java/com/android/server/MmsServiceBroker.java +13 −9 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.SystemClock; import android.os.UserHandle; import android.service.carrier.CarrierMessagingService; import android.telephony.SmsManager; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.Slog; Loading Loading @@ -341,7 +342,8 @@ public class MmsServiceBroker extends SystemService { } contentUri = adjustUriForUserAndGrantPermission(contentUri, CarrierMessagingService.SERVICE_INTERFACE, Intent.FLAG_GRANT_READ_URI_PERMISSION); Intent.FLAG_GRANT_READ_URI_PERMISSION, subId); getServiceGuarded().sendMessage(subId, callingPkg, contentUri, locationUrl, configOverrides, sentIntent); } Loading @@ -360,7 +362,8 @@ public class MmsServiceBroker extends SystemService { } contentUri = adjustUriForUserAndGrantPermission(contentUri, CarrierMessagingService.SERVICE_INTERFACE, Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION, subId); getServiceGuarded().downloadMessage(subId, callingPkg, locationUrl, contentUri, configOverrides, downloadedIntent); Loading Loading @@ -501,7 +504,7 @@ public class MmsServiceBroker extends SystemService { * @return The adjusted Uri containing the calling userId. */ private Uri adjustUriForUserAndGrantPermission(Uri contentUri, String action, int permission) { int permission, int subId) { final Intent grantIntent = new Intent(); grantIntent.setData(contentUri); grantIntent.setFlags(permission); Loading @@ -522,8 +525,9 @@ public class MmsServiceBroker extends SystemService { Intent intent = new Intent(action); TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); List<String> carrierPackages = telephonyManager.getCarrierPackageNamesForIntent( intent); List<String> carrierPackages = telephonyManager.getCarrierPackageNamesForIntentAndPhone( intent, SubscriptionManager.getPhoneId(subId)); if (carrierPackages != null && carrierPackages.size() == 1) { LocalServices.getService(UriGrantsManagerInternal.class) .grantUriPermissionFromIntent(callingUid, carrierPackages.get(0), Loading