Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f38f72a authored by Diego Pontoriero's avatar Diego Pontoriero Committed by Android (Google) Code Review
Browse files

Merge "Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API...

Merge "Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API for determining carrier app instead of MCC/MNC." into lmp-dev
parents 23ad2790 d45afac2
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -3490,10 +3490,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            mIsProvisioningNetwork.set(false);
            // Check for  apps that can handle provisioning first
            Intent provisioningIntent = new Intent(TelephonyIntents.ACTION_CARRIER_SETUP);
            provisioningIntent.addCategory(TelephonyIntents.CATEGORY_MCCMNC_PREFIX
                    + mTelephonyManager.getSimOperator());
            if (mContext.getPackageManager().resolveActivity(provisioningIntent, 0 /* flags */)
                    != null) {
            List<String> carrierPackages =
                    mTelephonyManager.getCarrierPackageNamesForBroadcastIntent(provisioningIntent);
            if (carrierPackages != null && !carrierPackages.isEmpty()) {
                if (carrierPackages.size() != 1) {
                    if (DBG) log("Multiple matching carrier apps found, launching the first.");
                }
                provisioningIntent.setPackage(carrierPackages.get(0));
                provisioningIntent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
                        Intent.FLAG_ACTIVITY_NEW_TASK);
                mContext.startActivity(provisioningIntent);