• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CustomProfileConnector {
27 
28   /** A type of profile supported by the SDK. */
29   enum ProfileType {
30     UNKNOWN,
31     NONE,
32     WORK,
33     PERSONAL;
34   }
35 
36   /**
37    * The service that will be generated by the SDK.
38    *
39    * <p>If set to empty string, this defaults to the name of the connector suffixed with _Service.
40    */
serviceClassName()41   String serviceClassName() default "";
42 
43   /**
44    * The "primary" profile used by {@code .primary()}, {@code .secondary()}, and {@code
45    * .suppliers()} calls.
46    *
47    * <p>This should typically be the profile which displays a combined experience, if any.
48    *
49    * <p>If this is not set, or is set to {@link ProfileType#NONE}, then methods which depend on the
50    * existence of a primary profile will not be accessible.
51    */
primaryProfile()52   ProfileType primaryProfile() default ProfileType.NONE;
53 
54   /** Custom parcelable wrappers to be accessible to all users of this connector */
parcelableWrappers()55   Class<?>[] parcelableWrappers() default {};
56 
57   /** Custom future wrappers to be accessible to all users of this connector */
futureWrappers()58   Class<?>[] futureWrappers() default {};
59 
60   /**
61    * Other {@link CustomProfileConnector} annotated types which we can import configuration from.
62    *
63    * <p>This will import {@link #parcelableWrappers()} and {@link #futureWrappers()}.
64    */
imports()65   Class<?>[] imports() default {};
66 
67   /**
68    * Which set of restrictions should be applied to checking availability.
69    *
70    * <p>By default, this will require that a user be running, unlocked, and not in quiet mode.
71    */
availabilityRestrictions()72   AvailabilityRestrictions availabilityRestrictions() default AvailabilityRestrictions.DEFAULT;
73 }
74