qksms icon indicating copy to clipboard operation
qksms copied to clipboard

Xiaomi dual SIM devices evade detection of the second SIM

Open paulsnar opened this issue 3 years ago • 0 comments

DESCRIPTION

On a Xiaomi Redmi Note 7 (MIUI 12.5.1 EU), in dual SIM mode the second SIM is not detected, and QKSMS works as though only one SIM is available. I have investigated and determined that this is technically an OS bug because of MIUI peculiarities (see the discussion below), though I believe this can be worked around to an extent.

STEPS

  1. Get an Xiaomi device running MIUI 12.5 (SDK level 29.) (Presumably this affects all dual-SIM MIUI devices and not only the one listed.) Install two SIM cards.
  2. Open QKSMS. Try composing a message.

EXPECTED

The text compose field displays the SIM switcher and allows picking whether to use SIM 1 or SIM 2 to send the message.

OBSERVATIONS

The SIM switcher doesn't appear, and it's impossible to send messages using the non-default SIM card.

DISCUSSION

At the present, the way QKSMS discovers multi-SIM availability hinges on Android's SubscriptionManager#getActiveSubscriptionInfoList to faithfully return multiple subscriptions that are available to use for sending messages. On MIUI devices, presumably for privacy reasons, this never returns any subscriptions even when a multi-SIM setup is being used.

Unfortunately I don't believe there is a canonical way to fix this (apart from asking Xiaomi to reconsider censoring subscription info from apps even if the user explicitly allows access to them), but a partial brute-force workaround could be to query the results of SubscriptionManager#getSubscriptionIds with slot indices from 1 up to, say, 3 (given that the current docs indicate support for up to 3 SIM cards,) and merging the results therein. The problem is that this is only supported in SDK 29+, and the only other alternative for SDK <29, getActiveSubscriptionInfoForSimSlotIndex, also likewise returns nothing on MIUI, so I guess there's no real solution which wouldn't involve brute-force attempting to send messages over every subscription available, or a settings toggle to explicitly override subscription info detection (which I also understand could be unwelcome.)

paulsnar avatar Dec 11 '21 21:12 paulsnar