OnReceiveContentListener: Handle IME insertion permissions release
For content insertion from the IME, the platform currently assumes that it can automatically revoke URI permissions (via InputContentUriTokenHandler.finalize) any time after the InputContentInfo instance is garbage collected and InputContentInfo.releasePermission() has not been called explicitly. This can cause permissions to be revoked before the receiving code has had a chance to read the content when using OnReceiveContentListener, since we did not keep a reference to InputContentInfo. This change does the following: * Sets the InputContentInfo instance in the ContentInfo payload passed to OnReceiveContentListener. * Exposes a hidden API on ContentInfo to allow system features to proactively release permissions for sources that allow this (IME and drag-and-drop). * Updates notifications direct-reply code to proactively release permissions as soon as they are no longer needed. Bug: 183643556 Test: Manual Change-Id: I1cbc55d53804810a3cd4b6b97c197f4dd2d7d8e6
Loading
Please register or sign in to comment