1 /*
2  * Copyright (C) 2021 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.net;
18 
19 import android.annotation.IntDef;
20 
21 import java.lang.annotation.Retention;
22 import java.lang.annotation.RetentionPolicy;
23 
24 /**
25  * Type annotations for constants used in the connectivity API surface.
26  *
27  * The annotations are maintained in a separate class so that it can be built as
28  * a separate library that other modules can build against, as Typedef should not
29  * be exposed as SystemApi.
30  *
31  * @hide
32  */
33 public final class ConnectivityAnnotations {
ConnectivityAnnotations()34     private ConnectivityAnnotations() {}
35 
36     @Retention(RetentionPolicy.SOURCE)
37     @IntDef(flag = true, value = {
38             ConnectivityManager.MULTIPATH_PREFERENCE_HANDOVER,
39             ConnectivityManager.MULTIPATH_PREFERENCE_RELIABILITY,
40             ConnectivityManager.MULTIPATH_PREFERENCE_PERFORMANCE,
41     })
42     public @interface MultipathPreference {}
43 
44     @Retention(RetentionPolicy.SOURCE)
45     @IntDef(flag = false, value = {
46             ConnectivityManager.RESTRICT_BACKGROUND_STATUS_DISABLED,
47             ConnectivityManager.RESTRICT_BACKGROUND_STATUS_WHITELISTED,
48             ConnectivityManager.RESTRICT_BACKGROUND_STATUS_ENABLED,
49     })
50     public @interface RestrictBackgroundStatus {}
51 }
52