• 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.processor;
17 
18 import com.squareup.javapoet.ClassName;
19 
20 /**
21  * {@link ClassName} instances shared across the processor.
22  *
23  * <p>This is required as most classes are not available to the processor so need to be referenced
24  * through {@link ClassName}
25  */
26 public class CommonClassNames {
27   static final ClassName CONTEXT_CLASSNAME = ClassName.get("android.content", "Context");
28   static final ClassName PARCEL_CLASSNAME = ClassName.get("android.os", "Parcel");
29   static final ClassName PARCELABLE_CLASSNAME = ClassName.get("android.os", "Parcelable");
30   static final ClassName CROSS_PROFILE_FUTURE_RESULT_WRITER =
31       ClassName.get(
32           "com.google.android.enterprise.connectedapps.internal", "CrossProfileFutureResultWriter");
33   static final ClassName IF_AVAILABLE_FUTURE_RESULT_WRITER =
34       ClassName.get(
35           "com.google.android.enterprise.connectedapps.internal", "IfAvailableFutureResultWriter");
36   static final ClassName PARCELABLE_CREATOR_CLASSNAME =
37       ClassName.get("android.os.Parcelable", "Creator");
38   static final ClassName UNAVAILABLE_PROFILE_EXCEPTION_CLASSNAME =
39       ClassName.get(
40           "com.google.android.enterprise.connectedapps.exceptions", "UnavailableProfileException");
41   static final ClassName AVAILABILITY_RESTRICTIONS_CLASSNAME =
42       ClassName.get(
43           "com.google.android.enterprise.connectedapps.annotations", "AvailabilityRestrictions");
44   static final ClassName PROFILE_RUNTIME_EXCEPTION_CLASSNAME =
45       ClassName.get(
46           "com.google.android.enterprise.connectedapps.exceptions", "ProfileRuntimeException");
47   static final ClassName PROFILE_AWARE_UTILS_CLASSNAME =
48       ClassName.get("com.google.android.enterprise.connectedapps", "ConnectedAppsUtils");
49   static final ClassName BACKGROUND_EXCEPTION_THROWER_CLASSNAME =
50       ClassName.get(
51           "com.google.android.enterprise.connectedapps.internal", "BackgroundExceptionThrower");
52   static final ClassName PARCEL_UTILITIES_CLASSNAME =
53       ClassName.get("com.google.android.enterprise.connectedapps.internal", "ParcelUtilities");
54   static final ClassName METHOD_RUNNER_CLASSNAME =
55       ClassName.get("com.google.android.enterprise.connectedapps.internal", "MethodRunner");
56   static final ClassName BUNDLER_CLASSNAME =
57       ClassName.get("com.google.android.enterprise.connectedapps.internal", "Bundler");
58   static final ClassName BUNDLER_TYPE_CLASSNAME =
59       ClassName.get("com.google.android.enterprise.connectedapps.internal", "BundlerType");
60   static final ClassName PARCEL_CALL_RECEIVER_CLASSNAME =
61       ClassName.get("com.google.android.enterprise.connectedapps.internal", "ParcelCallReceiver");
62   public static final ClassName BINDER_CLASSNAME = ClassName.get("android.os", "Binder");
63   public static final ClassName INTENT_CLASSNAME = ClassName.get("android.content", "Intent");
64   static final ClassName CROSS_PROFILE_SENDER_CLASSNAME =
65       ClassName.get("com.google.android.enterprise.connectedapps", "CrossProfileSender");
66   public static final ClassName CROSSPROFILESERVICE_STUB_CLASSNAME =
67       ClassName.get("com.google.android.enterprise.connectedapps.ICrossProfileService", "Stub");
68   static final ClassName INVALID_PROTOCOL_BUFFER_EXCEPTION_CLASSNAME =
69       ClassName.get("com.google.protobuf", "InvalidProtocolBufferException");
70   static final ClassName PROFILE_CLASSNAME =
71       ClassName.get("com.google.android.enterprise.connectedapps", "Profile");
72   static final ClassName LOCAL_CALLBACK_CLASSNAME =
73       ClassName.get("com.google.android.enterprise.connectedapps", "LocalCallback");
74   public static final ClassName CROSS_PROFILE_CALLBACK_CLASSNAME =
75       ClassName.get("com.google.android.enterprise.connectedapps", "ICrossProfileCallback");
76   static final ClassName ASYNC_CALLBACK_PARAM_MULTIMERGER_CLASSNAME =
77       ClassName.get(
78           "com.google.android.enterprise.connectedapps.internal",
79           "CrossProfileCallbackMultiMerger");
80   static final ClassName CROSS_PROFILE_CALLBACK_PARCEL_CALL_SENDER_CLASSNAME =
81       ClassName.get(
82           "com.google.android.enterprise.connectedapps.internal",
83           "CrossProfileCallbackParcelCallSender");
84   static final ClassName CROSS_PROFILE_CALLBACK_EXCEPTION_PARCEL_CALL_SENDER_CLASSNAME =
85       ClassName.get(
86           "com.google.android.enterprise.connectedapps.internal",
87           "CrossProfileCallbackExceptionParcelCallSender");
88   static final ClassName ASYNC_CALLBACK_PARAM_MULTIMERGER_COMPLETE_LISTENER_CLASSNAME =
89       ClassName.get(
90           "com.google.android.enterprise.connectedapps.internal.CrossProfileCallbackMultiMerger",
91           "CrossProfileCallbackMultiMergerCompleteListener");
92 
93   public static final ClassName SERVICE_CLASSNAME = ClassName.get("android.app", "Service");
94   public static final ClassName EXCEPTION_CALLBACK_CLASSNAME =
95       ClassName.get("com.google.android.enterprise.connectedapps", "ExceptionCallback");
96   public static final ClassName CALLBACK_MERGER_EXCEPTION_CALLBACK_CLASSNAME =
97       ClassName.get(
98           "com.google.android.enterprise.connectedapps.internal",
99           "CallbackMergerExceptionCallback");
100   public static final ClassName PROFILE_CONNECTOR_CLASSNAME =
101       ClassName.get("com.google.android.enterprise.connectedapps", "ProfileConnector");
102   public static final ClassName ABSTRACT_PROFILE_CONNECTOR_CLASSNAME =
103       ClassName.get("com.google.android.enterprise.connectedapps", "AbstractProfileConnector");
104   public static final ClassName ABSTRACT_USER_CONNECTOR_CLASSNAME =
105       ClassName.get("com.google.android.enterprise.connectedapps", "AbstractUserConnector");
106   public static final ClassName ABSTRACT_PROFILE_CONNECTOR_BUILDER_CLASSNAME =
107       ClassName.get(
108           "com.google.android.enterprise.connectedapps.AbstractProfileConnector", "Builder");
109   public static final ClassName ABSTRACT_USER_CONNECTOR_BUILDER_CLASSNAME =
110       ClassName.get("com.google.android.enterprise.connectedapps.AbstractUserConnector", "Builder");
111   public static final ClassName CONNECTION_BINDER_CLASSNAME =
112       ClassName.get("com.google.android.enterprise.connectedapps", "ConnectionBinder");
113   public static final ClassName SCHEDULED_EXECUTOR_SERVICE_CLASSNAME =
114       ClassName.get("java.util.concurrent", "ScheduledExecutorService");
115   public static final ClassName ABSTRACT_FAKE_PROFILE_CONNECTOR_CLASSNAME =
116       ClassName.get(
117           "com.google.android.enterprise.connectedapps.testing", "AbstractFakeProfileConnector");
118 
119   public static final ClassName VERSION_CLASSNAME = ClassName.get("android.os.Build", "VERSION");
120   public static final ClassName VERSION_CODES_CLASSNAME =
121       ClassName.get("android.os.Build", "VERSION_CODES");
122 
CommonClassNames()123   private CommonClassNames() {}
124 }
125