Get Active SIM(s) only from dual sim phones

328 Views Asked by At

I've seen many similar questions on StackOverFlow almost addressing the same issue i.e. Ability to get Active Sim information "only" from a dual sim phone.

By Active SIM it is meant that any SIM that has been disabled from Device Dual Sim settings shouldn't be treated as an active SIM.

Following APIs/Methods I've tried already and they all return both the SIMs as Active:

  1. TelecomManager.getCallCapablePhoneAccounts() // Returns both the accounts as active accounts
  2. SubscriptionManager.getActiveSubscriptionInfoList() // Returns both the subscriptions as active subscriptions
  3. TelephonyManager.getSimState(0/1) // Returns 5, SIM_STATE_READY for both the SIMS

Note:

1: I've 2 valid SIMS in my phone. One is disabled by Dual Sim Manager in device.

2: I'm testing currently on Huawei Y9 2019.

3: Default Dialer App and True Caller app somehow are able to detect the changes in SIM active status and update their functionality/view accordingly.

Any idea, how to get this information reliably and accurately?

0

There are 0 best solutions below