Require InputContentInfo.requestPermission()
This CL logically reverts my previous CL [1], which allowed the system
automatically grant a temporary URI permission to the target
application when the IME calls InputConnection#commitContent() with
InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION.
Based on conversations with application developers who have supported
Commit Content APIs, I concluded that my assumption that automatically
granting the permission without an explicit call of
InputContentInfo.requestPermission() would help application developers
was wrong. They anyway need to take care of the situation where the
app fails to read the data from the given content URI. Thus just
receiving SecurityException() because of not calling it is still one
of such cases that application developers cannot forget about.
Therefore with this CL InputContentInfo.requestPermission() becomes
mandatory when InputConnection#INPUT_CONTENT_GRANT_READ_URI_PERMISSION
is specified.
[1]: Id955435dd2e72549ee7134f46b3c6951581694ad
f3806f57a59ede663f3fa2ad1f5080bdbf20e372
Bug:
32315394
Test: By github.com/googlesamples/android-CommitContentSampleApp
Change-Id: I8a3cb79ae6d6c4113914734799b21bfc96e3ca3e