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

Commit 8acb1a75 authored by Yohei Yukawa's avatar Yohei Yukawa Committed by Android (Google) Code Review
Browse files

Merge "Revert "Remove InputContentInfo#requestPermission()"" into nyc-mr1-dev

parents 536a1a2a 79d1c75a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44923,6 +44923,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
@@ -48091,6 +48091,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
@@ -45003,6 +45003,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