When app is default dialer I need a way of getting sim id (1 or 2) for incoming call (dual sim).
App is implementing InCallService.
When app is default dialer I need a way of getting sim id (1 or 2) for incoming call (dual sim).
App is implementing InCallService.
It looks like you can run
call.getDetails().getAccountHandle().getId(), which will return a string that is the identifier of that PhoneAccountHandle.Note that PhoneAccountHandle is also returned from getSimCallManager
Here's the note from the PhoneAccountHandle doc's:
You can also run getPhoneAccount(phoneAccountHandlerFromAbove) to get the address() i.e. phone number of the account.
If you want to compare it to the order of things in the system, you can retrieve the list of all PhoneAccountHandle's with getCallCapablePhoneAccounts