The catch, sometime, the result is not valid on device reboot.
Meaning, if you change from one SIM to another and check, it will give you the correct preferred SIM set in the phone. But if you reboot the phone and check, it will not give you the correctly displayed preference.
I managed to find a solution which works partially. You can use the
TelephonyManagerto obtain the preferred SIM.The catch, sometime, the result is not valid on device reboot.
Meaning, if you change from one SIM to another and check, it will give you the correct preferred SIM set in the phone. But if you reboot the phone and check, it will not give you the correctly displayed preference.
I will post an update if I find another way.
Reference: Sim Management setting Programmatically in android