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

Commit 4dbf14ac authored by nharold's avatar nharold Committed by Gerrit Code Review
Browse files

Merge "Clear calling identity in getCarrierImsPackage()"

parents 9f1c5080 02f1fc59
Loading
Loading
Loading
Loading
+11 −6
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ResolveInfo;
import android.os.Binder;
import android.os.PersistableBundle;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.CarrierConfigManager;
import android.telephony.Rlog;
import android.telephony.Rlog;
@@ -78,13 +79,17 @@ public class CarrierSmsUtils {
            return null;
            return null;
        }
        }


        final long identity = Binder.clearCallingIdentity();
        try {
            PersistableBundle config = cm.getConfigForSubId(phone.getSubId());
            PersistableBundle config = cm.getConfigForSubId(phone.getSubId());
            if (config == null) {
            if (config == null) {
                if (VDBG) Rlog.v(TAG, "No CarrierConfig for subId:" + phone.getSubId());
                if (VDBG) Rlog.v(TAG, "No CarrierConfig for subId:" + phone.getSubId());
                return null;
                return null;
            }
            }

            return config.getString(CARRIER_IMS_PACKAGE_KEY, null);
            return config.getString(CARRIER_IMS_PACKAGE_KEY, null);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }
    }


    private CarrierSmsUtils() {}
    private CarrierSmsUtils() {}