opermission/src/main/java/co/omkar/utility/opermission/dialog/PermissionDialogFragment.java
@Override
    public void onResume() {
        super.onResume();
        getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent keyEvent) {
                return keyCode != KeyEvent.ACTION_DOWN;
            }
        });
    }
@Override
    public void onResume() {
        super.onResume();
        getDialog().setOnKeyListener(new DialogInterface.OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent keyEvent) {
                return keyCode != KeyEvent.ACTION_DOWN;
            }
        });
    }
Work around for dialog not to dismiss on back button press.