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

Commit 601a3869 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Added @IntDef for DATA_SHARE_ERROR_ constants" into rvc-dev am: 4a4e1e45

Change-Id: Id10297c278b8b7195b589553f4465489370e9cf5
parents 63d7b375 4a4e1e45
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.os.ParcelFileDescriptor;
import android.view.contentcapture.ContentCaptureManager.DataShareError;

/**
 * Adapter class to be used for the Content Capture Service app to propagate the status of the
@@ -46,5 +47,5 @@ public interface DataShareReadAdapter {
     * these 2 events is not defined, and it's important that the service treats end of stream
     * correctly in this situation.
     **/
    void onError(int errorCode);
    void onError(@DataShareError int errorCode);
}
+9 −0
Original line number Diff line number Diff line
@@ -216,6 +216,15 @@ public final class ContentCaptureManager {
    /** Request has been interrupted because of data share session timeout. */
    public static final int DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 3;

    /** @hide */
    @IntDef(flag = false, value = {
            DATA_SHARE_ERROR_UNKNOWN,
            DATA_SHARE_ERROR_CONCURRENT_REQUEST,
            DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface DataShareError {}

    /** @hide */
    public static final int RESULT_CODE_OK = 0;
    /** @hide */
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.view.contentcapture;

import android.annotation.NonNull;
import android.os.ParcelFileDescriptor;
import android.view.contentcapture.ContentCaptureManager.DataShareError;

/** Adapter class used by apps to share data with the Content Capture service. */
public interface DataShareWriteAdapter {
@@ -42,7 +43,7 @@ public interface DataShareWriteAdapter {
     *
     * @param errorCode the error code corresponding to an ERROR_* value.
     */
    default void onError(int errorCode) {
    default void onError(@DataShareError int errorCode) {
        /* do nothing - stub */
    }
}