1// Signature format: 2.0 2package android.provider { 3 4 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public interface MediaCognitionGetVersionsCallback { 5 method public void onFailure(@NonNull String); 6 method public void onSuccess(@NonNull android.provider.MediaCognitionProcessingVersions); 7 } 8 9 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public interface MediaCognitionProcessingCallback { 10 method public void onFailure(@NonNull String); 11 method public void onSuccess(@NonNull java.util.List<android.provider.MediaCognitionProcessingResponse>); 12 } 13 14 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public final class MediaCognitionProcessingRequest implements android.os.Parcelable { 15 method public boolean checkProcessingRequired(int); 16 method public int describeContents(); 17 method public int getProcessingCombination(); 18 method @NonNull public android.net.Uri getUri(); 19 method public void writeToParcel(@NonNull android.os.Parcel, int); 20 field @NonNull public static final android.os.Parcelable.Creator<android.provider.MediaCognitionProcessingRequest> CREATOR; 21 } 22 23 public static final class MediaCognitionProcessingRequest.Builder { 24 ctor public MediaCognitionProcessingRequest.Builder(@NonNull android.net.Uri); 25 method @NonNull public android.provider.MediaCognitionProcessingRequest.Builder addProcessingRequest(int); 26 method @NonNull public android.provider.MediaCognitionProcessingRequest build(); 27 method @NonNull public android.provider.MediaCognitionProcessingRequest.Builder setProcessingCombination(int); 28 } 29 30 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public class MediaCognitionProcessingResponse { 31 method @Nullable public java.util.List<java.lang.String> getImageLabels(); 32 method @Nullable public String getImageOcrLatin(); 33 method @NonNull public android.provider.MediaCognitionProcessingRequest getRequest(); 34 } 35 36 public static final class MediaCognitionProcessingResponse.Builder { 37 ctor public MediaCognitionProcessingResponse.Builder(@NonNull android.provider.MediaCognitionProcessingRequest); 38 method @NonNull public android.provider.MediaCognitionProcessingResponse build(); 39 method @NonNull public android.provider.MediaCognitionProcessingResponse.Builder setImageLabels(@Nullable java.util.List<java.lang.String>); 40 method @NonNull public android.provider.MediaCognitionProcessingResponse.Builder setImageOcrLatin(@Nullable String); 41 } 42 43 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public final class MediaCognitionProcessingVersions implements android.os.Parcelable { 44 ctor public MediaCognitionProcessingVersions(); 45 method public int describeContents(); 46 method public int getProcessingVersion(int); 47 method public void setProcessingVersion(int, int); 48 method public void writeToParcel(@NonNull android.os.Parcel, int); 49 field @NonNull public static final android.os.Parcelable.Creator<android.provider.MediaCognitionProcessingVersions> CREATOR; 50 } 51 52 @FlaggedApi("com.android.providers.media.flags.media_cognition_service") public abstract class MediaCognitionService extends android.app.Service { 53 ctor public MediaCognitionService(); 54 method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent); 55 method public abstract void onGetProcessingVersions(@NonNull android.provider.MediaCognitionGetVersionsCallback); 56 method public abstract void onProcessMedia(@NonNull java.util.List<android.provider.MediaCognitionProcessingRequest>, @Nullable android.os.CancellationSignal, @NonNull android.provider.MediaCognitionProcessingCallback); 57 field public static final String BIND_MEDIA_COGNITION_SERVICE = "com.android.providers.media.permission.BIND_MEDIA_COGNITION_SERVICE"; 58 field public static final String SERVICE_INTERFACE = "android.provider.MediaCognitionService"; 59 } 60 61 public static interface MediaCognitionService.ProcessingTypes { 62 field public static final int IMAGE_LABEL = 2; // 0x2 63 field public static final int IMAGE_OCR_LATIN = 1; // 0x1 64 } 65 66 public final class MediaStore { 67 method @NonNull public static android.net.Uri rewriteToLegacy(@NonNull android.net.Uri); 68 method @NonNull @WorkerThread public static android.net.Uri scanFile(@NonNull android.content.ContentResolver, @NonNull java.io.File); 69 method @WorkerThread public static void scanVolume(@NonNull android.content.ContentResolver, @NonNull String); 70 method @WorkerThread public static void waitForIdle(@NonNull android.content.ContentResolver); 71 field public static final String ACTION_USER_SELECT_IMAGES_FOR_APP = "android.provider.action.USER_SELECT_IMAGES_FOR_APP"; 72 field public static final String AUTHORITY_LEGACY = "media_legacy"; 73 field @NonNull public static final android.net.Uri AUTHORITY_LEGACY_URI; 74 field public static final String QUERY_ARG_DEFER_SCAN = "android:query-arg-defer-scan"; 75 } 76 77} 78 79