Q:

Cancel a Runtime Permission request?

In the android documentation for Runtime permissions for Marshmallow the following code comment refers to cancellation of a permission request: 
case MY_PERMISSIONS_REQUEST_READ_CONTACTS: {
        // If request is cancelled, the result arrays are empty.
        if (grantResults.length > 0
            && grantResults[0] == PackageManager.PERMISSION_GRANTED) {

I have not been able to determine how to actually cancel a request for a permission such that the grantResults array returns with a length == 0.  The dialog asking for the permission only lets the user allow or deny the request, so cancelling the request by user action isn't obvious.
However, I ran monkey and it managed to accomplish this at least once.
The documentation for onRequestPermissionResult indicates that cancellation is possible.
How can I reproduce the case where grantResults will have a length of 0, which indicates it is a cancelled request?  (The String[] grantResults is not null, but has length 0)

A:

Was testing runtime permissions on another application and managed to create a cancel permissions request rather simply. 
In the instance of a screen rotation, Android will cancel a permissions request dialog that is currently being displayed and then recreate it.

