Merge "Added @IntDef for DATA_SHARE_ERROR_ constants" into rvc-dev am: 4a4e1e45d0 am: 279f3dcc8b
Change-Id: I59c4eaf2e7ac6455f2415cfc955274df0a371bd9
This commit is contained in:
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
|||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.os.ParcelFileDescriptor;
|
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
|
* 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
|
* these 2 events is not defined, and it's important that the service treats end of stream
|
||||||
* correctly in this situation.
|
* correctly in this situation.
|
||||||
**/
|
**/
|
||||||
void onError(int errorCode);
|
void onError(@DataShareError int errorCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,15 @@ public final class ContentCaptureManager {
|
|||||||
/** Request has been interrupted because of data share session timeout. */
|
/** Request has been interrupted because of data share session timeout. */
|
||||||
public static final int DATA_SHARE_ERROR_TIMEOUT_INTERRUPTED = 3;
|
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 */
|
/** @hide */
|
||||||
public static final int RESULT_CODE_OK = 0;
|
public static final int RESULT_CODE_OK = 0;
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package android.view.contentcapture;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
|
import android.view.contentcapture.ContentCaptureManager.DataShareError;
|
||||||
|
|
||||||
/** Adapter class used by apps to share data with the Content Capture service. */
|
/** Adapter class used by apps to share data with the Content Capture service. */
|
||||||
public interface DataShareWriteAdapter {
|
public interface DataShareWriteAdapter {
|
||||||
@@ -42,7 +43,7 @@ public interface DataShareWriteAdapter {
|
|||||||
*
|
*
|
||||||
* @param errorCode the error code corresponding to an ERROR_* value.
|
* @param errorCode the error code corresponding to an ERROR_* value.
|
||||||
*/
|
*/
|
||||||
default void onError(int errorCode) {
|
default void onError(@DataShareError int errorCode) {
|
||||||
/* do nothing - stub */
|
/* do nothing - stub */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user