Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79d1c75a authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Revert "Remove InputContentInfo#requestPermission()"

This reverts commit c4b8f36d.

Having InputContentInfo#requestPermission() should not hurt developers,
but we can polish the behavior in a subsequent CL without changing
the API.

Bug: 29450031
Bug: 29892936
Change-Id: I1b43c19417b643d0c269af860db2d309b73a90d5
parent c4b8f36d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44921,6 +44921,7 @@ package android.view.inputmethod {
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void releasePermission();
    method public void requestPermission();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
+1 −0
Original line number Diff line number Diff line
@@ -48049,6 +48049,7 @@ package android.view.inputmethod {
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void releasePermission();
    method public void requestPermission();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
+1 −0
Original line number Diff line number Diff line
@@ -45001,6 +45001,7 @@ package android.view.inputmethod {
    method public android.content.ClipDescription getDescription();
    method public android.net.Uri getLinkUri();
    method public void releasePermission();
    method public void requestPermission();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.view.inputmethod.InputContentInfo> CREATOR;
  }
+4 −5
Original line number Diff line number Diff line
@@ -840,16 +840,15 @@ public interface InputConnection {
    public void closeConnection();

    /**
     * When this flag is used in {@link #commitContent(InputContentInfo, int, Bundle)}, the editor
     * will be able to request read access to the content URI contained in the
     * {@link InputContentInfo} object.
     * When this flag is used, the editor will be able to request read access to the content URI
     * contained in the {@link InputContentInfo} object.
     *
     * <p>Make sure that the content provider owning the Uri sets the
     * {@link android.R.styleable#AndroidManifestProvider_grantUriPermissions
     * grantUriPermissions} attribute in its manifest or included the
     * {@link android.R.styleable#AndroidManifestGrantUriPermission
     * &lt;grant-uri-permissions&gt;} tag. Otherwise
     * {@link #commitContent(InputContentInfo, int, Bundle)} can fail.</p>
     * &lt;grant-uri-permissions&gt;} tag. Otherwise {@link InputContentInfo#requestPermission()}
     * can fail.</p>
     *
     * <p>Although calling this API is allowed only for the IME that is currently selected, the
     * client is able to request a temporary read-only access even after the current IME is switched
+16 −0
Original line number Diff line number Diff line
@@ -162,6 +162,22 @@ public final class InputContentInfo implements Parcelable {
        mUriToken = token;
    }

    /**
     * Requests a temporary read-only access permission for content URI associated with this object.
     *
     * <p>Does nothing if the temporary permission is already granted.</p>
     */
    public void requestPermission() {
        if (mUriToken == null) {
            return;
        }
        try {
            mUriToken.take();
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /**
     * Releases a temporary read-only access permission for content URI associated with this object.
     *
Loading