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 although the null head revision id has been reported fixed. Another thing I tried was setEtag() on the file before update(). It should have given me error on update, but the upload was successful even the file had been changed remotely! Is this the correct way to use ETag?