My app sent home this stack trace which seems as though something very wrong is going on under the hood.
phone_model=SKY IM-A630K, android_version=2.1-update1
I had the same problem with an HTC phone (Desire 728G) Dual Sim and I had to include "READ_PHONE_STATE" but now Google is asking for a privacy policy, and because I am too lazy to do it :) I did some research and I found a better way without the use of "READ_PHONE_STATE". The problem is that some devices (mainly dual sim) need the "READ_PHONE_STATE" permission to look for the default "SubscriptionId" that is what happens when you call "SmsManager.getDefault()". Below is the code I am using to avoid this issue by assigning the value (1) to SubscriptionId if any exception accrued:
SmsManager smsManager = SmsManager.getDefault();
if (android.os.Build.VERSION.SDK_INT >= 22){
Log.e("Alert","Checking SubscriptionId");
try {
Log.e("Alert","SubscriptionId is " + smsManager.getSubscriptionId());
} catch (Exception e) {
Log.e("Alert",e.getMessage());
Log.e("Alert","Fixed SubscriptionId to 1");
smsManager = SmsManager.getSmsManagerForSubscriptionId(1);
}
}
smsManager.sendTextMessage(mobileNumber, null, msgStr, null, null);