1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.app.appsearch.safeparcel; 18 19 /** 20 * This is here for the SafeParcelProcessor to link against and is intentionally not implementing a 21 * Parcelable, so that it is not necessary to link in the Android framework to compile this. 22 * 23 * @hide 24 */ 25 // Include the SafeParcel source code directly in AppSearch until it gets officially open-sourced. 26 public interface SafeParcelable { 27 String NULL = "SAFE_PARCELABLE_NULL_STRING"; 28 29 @interface Class { creator()30 String creator(); 31 creatorIsFinal()32 boolean creatorIsFinal() default true; 33 validate()34 boolean validate() default false; 35 doNotParcelTypeDefaultValues()36 boolean doNotParcelTypeDefaultValues() default false; 37 } 38 39 @interface Field { id()40 int id(); 41 getter()42 String getter() default NULL; 43 type()44 String type() default NULL; 45 defaultValue()46 String defaultValue() default NULL; 47 defaultValueUnchecked()48 String defaultValueUnchecked() default NULL; 49 } 50 51 @interface VersionField { id()52 int id(); 53 getter()54 String getter() default NULL; 55 type()56 String type() default NULL; 57 } 58 59 @interface Indicator { getter()60 String getter() default NULL; 61 } 62 63 @interface Constructor {} 64 65 @interface Param { id()66 int id(); 67 } 68 69 @interface RemovedParam { id()70 int id(); 71 defaultValue()72 String defaultValue() default NULL; 73 defaultValueUnchecked()74 String defaultValueUnchecked() default NULL; 75 } 76 77 @interface Reserved { value()78 int[] value(); 79 } 80 } 81