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

Commit 857072d6 authored by nharold's avatar nharold Committed by android-build-merger
Browse files

Merge "Clear calling identity in getCarrierImsPackage()" am: 4dbf14ac am: a46968e0

am: b741d6d3

Change-Id: I068f299a9ef28ccec0380281f72e57fd020b9c1b
parents 67a4ff42 b741d6d3
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Binder;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.Rlog;
@@ -78,13 +79,17 @@ public class CarrierSmsUtils {
            return null;
        }

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

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

    private CarrierSmsUtils() {}