Change CARRIER_SETUP hook in WirelessSettings to use aeroshell

for determining carrier app instead of MCC/MNC.

Related WirelessSettings change: http://ag/374330

Related Aeroshell change to SetupWizard: http://ag/520857

Bug: 16457806
Change-Id: I60277b27e9e205041eb3969a110a57da0fb62023
This commit is contained in:
Diego Pontoriero
2014-08-11 18:25:51 -07:00
parent 735219be8f
commit ff9f67dddd

View File

@@ -129,9 +129,13 @@ public class WirelessSettings extends SettingsPreferenceFragment
if (mTm.hasIccCard() && (ni != null)) {
// Check for carrier apps that can handle provisioning first
Intent provisioningIntent = new Intent(TelephonyIntents.ACTION_CARRIER_SETUP);
provisioningIntent.addCategory(TelephonyIntents.CATEGORY_MCCMNC_PREFIX
+ mTm.getSimOperator());
if (mPm.resolveActivity(provisioningIntent, 0 /* flags */) != null) {
List<String> carrierPackages =
mTm.getCarrierPackageNamesForBroadcastIntent(provisioningIntent);
if (carrierPackages != null && !carrierPackages.isEmpty()) {
if (carrierPackages.size() != 1) {
Log.w(TAG, "Multiple matching carrier apps found, launching the first.");
}
provisioningIntent.setPackage(carrierPackages.get(0));
startActivity(provisioningIntent);
return;
}