3

I need to create an Android application to set carrier configuration(VoLte e.g.). The application should fetch configs from our Back-End and apply them on the phone.

In Android documentation I found the following article: This article says, that I can create my own application and override CarrierService.

public class SampleCarrierConfigService extends CarrierService {

private static final String TAG = "SampleCarrierConfigService";

public SampleCarrierConfigService() {
    Log.d(TAG, "Service created");
}

@Override
public PersistableBundle onLoadConfig(CarrierIdentifier id) {
    Log.d(TAG, "Config being fetched");
    PersistableBundle config = new PersistableBundle();
    config.putBoolean(
        CarrierConfigManager.KEY_CARRIER_VOLTE_AVAILABLE_BOOL, true);
    config.putBoolean(
        CarrierConfigManager.KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL, false);
    config.putInt(CarrierConfigManager.KEY_VOLTE_REPLACEMENT_RAT_INT, 6);
    // Check CarrierIdentifier and add more config if needed…
    return config;
}

}

I created an app with this service, but the method onLoadConfig(CarrierIdentifier id) is never called by the system.

So what I want from the system to call my overridden method, not system's. What should I do?

Akshay
  • 2,506
  • 4
  • 34
  • 55
  • I think this might be the same problem I answered in https://stackoverflow.com/questions/63054337/carrier-privileges-not-provided-to-the-app/63513762#63513762 - the documentation for what to put in the manifest is (I think) incorrect. Bug reported at https://issuetracker.google.com/issues/165823769. – James Moore Aug 20 '20 at 22:16

1 Answers1

0

I found your question when researching how to do something similar.

In the article you linked it says:

The carrier app in question must be signed with the same certificate found on the SIM card, as documented in UICC Carrier Privileges.

Since we can't get the certificate from your carrier (they will never give it to you) I think we can't implement our own flavour sadly :-(

kabadisha
  • 670
  • 4
  • 15
  • 1
    Except that the person asking the question probably does work at a carrier, since they're the most likely to implement this. (Don't forget the world has _many_ carriers, most of them very small.) – James Moore Jun 15 '20 at 00:45
  • Very good point. I was looking at this because my carrier forces the handset to prefer cell service, which means that in a poor reception area, but where I do have WiFi coverage, the phone keeps swapping to cell every time it gets a sniff of coverage. It even does this mid call, which causes the call to drop! – kabadisha Jun 16 '20 at 13:45