Skip to content Skip to sidebar Skip to footer

Carrier Privileges Not Provided To The App

I am working on an application that is supposed to gain Carrier Privileges . We have an eSIM card, that already has a SHA-1 and fingerprint of a keystore used to sign application w

Solution 1:

I believe the documentation here is incorrect. It says to use:

<serviceandroid:name=".SampleCarrierConfigService"android:label="@string/service_name"android:permission="android.permission.BIND_CARRIER_SERVICES"><intent-filter><actionandroid:name="android.service.carrier.ConfigService"/></intent-filter></service>

but I think you need to use <action android:name="android.service.carrier.CarrierService"/> instead.

At least when we use the documented version, our onLoadConfig isn't called, and when we use android.service.carrier.ConfigService we do get the callback.

One other thing you can do is call something like this in your application (just in a regular activity, not in the service):

val telephonyManager =
        context?.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
    val haspriv = telephonyManager.hasCarrierPrivileges()
    Log.d(TAG, "priv: $haspriv")

If telephonyManager.hasCarrierPrivileges() returns true, you know the signature checking is correct. This has nothing to do with the service; you can have an application that has carrier privileges without implementing android.service.carrier.ConfigService. (I don't know why you'd do that, but it's possible.)

Post a Comment for "Carrier Privileges Not Provided To The App"