Commit a03a0595 authored by Bastien Le Querrec's avatar Bastien Le Querrec

fix SIM detection in upgrade

parent ef145c69
......@@ -157,7 +157,6 @@ public class DatabaseUpgradeActivity extends BaseActivity {
if (params[0] < MULTI_SIM_MULTI_KEYS_VERSION) {
if (Build.VERSION.SDK_INT >= 22) {
/*
* getDefaultSubscriptionId() is available for API 24+ only, so we
* move keys and sessions to SIM card in the first available slot,
......@@ -168,7 +167,10 @@ public class DatabaseUpgradeActivity extends BaseActivity {
int eligibleDeviceSubscriptionId = -1;
for (SubscriptionInfoCompat subscriptionInfo : subscriptionInfoList) {
if (smallerSlot == -1 || subscriptionInfo.getIccSlot() < smallerSlot) eligibleDeviceSubscriptionId = subscriptionInfo.getDeviceSubscriptionId();
if (smallerSlot == -1 || subscriptionInfo.getIccSlot() < smallerSlot) {
smallerSlot = subscriptionInfo.getIccSlot();
eligibleDeviceSubscriptionId = subscriptionInfo.getDeviceSubscriptionId();
}
}
DualSimUtil.moveIdentityKeysAndSessionsToSubscriptionId(context, -1, eligibleDeviceSubscriptionId);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment