After Long Time of trying, Got MI SMS permission(Through SMS Provider).
Add this Method (content provider method) with your activity or fragment.
you will able to get permission.
private void displaySmsLog() {
Uri allMessages = Uri.parse("content://sms/");
//Cursor cursor = managedQuery(allMessages, null, null, null, null); Both are same
Cursor cursor = this.getContentResolver().query(allMessages, null,
null, null, null);
while (cursor.moveToNext()) {
for (int i = 0; i < cursor.getColumnCount(); i++) {
Log.d(cursor.getColumnName(i) + "", cursor.getString(i) + "");
}
Log.d("One row finished",
"**************************************************");
}
}
Give it try , It worked for me.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…