1 /* 2 * Copyright 2021 Google LLC 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 * https://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 package com.google.android.enterprise.connectedapps.annotations; 17 18 import java.lang.annotation.ElementType; 19 import java.lang.annotation.Retention; 20 import java.lang.annotation.RetentionPolicy; 21 import java.lang.annotation.Target; 22 23 /** Annotate the connector which manages connections between processes. */ 24 @Target(ElementType.TYPE) 25 @Retention(RetentionPolicy.RUNTIME) 26 public @interface CustomUserConnector { 27 28 /** 29 * The service that will be generated by the SDK. 30 * 31 * <p>If set to empty string, this defaults to the name of the connector suffixed with _Service. 32 */ serviceClassName()33 String serviceClassName() default ""; 34 35 /** Custom parcelable wrappers to be accessible to all users of this connector */ parcelableWrappers()36 Class<?>[] parcelableWrappers() default {}; 37 38 /** Custom future wrappers to be accessible to all users of this connector */ futureWrappers()39 Class<?>[] futureWrappers() default {}; 40 41 /** 42 * Other {@link CustomUserConnector} annotated types which we can import configuration from. 43 * 44 * <p>This will import {@link #parcelableWrappers()} and {@link #futureWrappers()}. 45 */ imports()46 Class<?>[] imports() default {}; 47 48 /** 49 * Which set of restrictions should be applied to checking availability. 50 * 51 * <p>By default, this will require that a user be running, unlocked, and not in quiet mode. 52 */ availabilityRestrictions()53 AvailabilityRestrictions availabilityRestrictions() default AvailabilityRestrictions.DEFAULT; 54 55 /** 56 * A list of additional used types 57 * 58 * <p>This argument can only be passed when annotating types, not methods. 59 */ additionalUsedTypes()60 Class<?>[] additionalUsedTypes() default {}; 61 } 62