Thanks a lot for your lightning fast response. I tried your code and it worked! However, the return code is always 0 or 1 depending on whether DnD is Off/On. This is good enough for me. My android version is 5.1.1, may be on latest version it returns other codes based on "alarm" and "Total Silence" options.