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

Commit 9a761e72 authored by Nathan Harold's avatar Nathan Harold Committed by android-build-merger
Browse files

Merge "Clear calling identity in getCarrierImsPackage()" into oc-dev

am: 7c8a759e

Change-Id: I7f38a9849b3ed8abff69d0a97f00fbe008cba176
parents f8f9bc4b 7c8a759e
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() {}