Below are my code getting security exception from Android version 7 and onwards. I have added android.permission.READ_PHONE_STATE
permission in manifest file and also added in runtime permissions also.
TelephonyManager tManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imeiNum= tManager.getDeviceId();