My Android app updates a Google Drive document. The file can be modified also elsewhere (e.g. through Drive web interface), so there may be a conflict on file upload. However, this should rarely happen. That's why I don't want my app to first query the revision history (since this is in most cases unnecessary) and only after that, update the file. *How can I detect that there is a conflict when updating the file?*

My investigation so far reveals that [getHeadRevisionId() returns null](https://stackoverflow.com/a/20056153/1097104) although the [null head revision id has been reported fixed](https://stackoverflow.com/a/13426735/1097104).
Another thing I tried was setEtag() on the file before update(). [It should have given me error on update](https://stackoverflow.com/a/11320975/1097104), but the upload was successful even the file had been changed remotely! Is this the correct way to use ETag?