• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 com.googlecode.android_scripting.facade;
18 
19 /**
20  * Constants to be used in the facade for ConnectivityManager/Service.
21  */
22 public class ConnectivityConstants {
23     /**
24      * Network callback master event name
25      */
26     public static final String EventNetworkCallback = "NetworkCallback";
27 
28     /**
29      * Connectivity events - sub-names
30      */
31     public static final String NetworkCallbackPreCheck = "PreCheck";
32     public static final String NetworkCallbackAvailable = "Available";
33     public static final String NetworkCallbackLosing = "Losing";
34     public static final String NetworkCallbackLost = "Lost";
35     public static final String NetworkCallbackUnavailable = "Unavailable";
36     public static final String NetworkCallbackCapabilitiesChanged = "CapabilitiesChanged";
37     public static final String NetworkCallbackSuspended = "Suspended";
38     public static final String NetworkCallbackResumed = "Resumed";
39     public static final String NetworkCallbackLinkPropertiesChanged = "LinkPropertiesChanged";
40     public static final String NetworkCallbackBlockedStatusChanged = "BlockedStatusChanged";
41     public static final String NetworkCallbackInvalid = "Invalid";
42 
43     /**
44      * Connectivity changed event
45      */
46     public static final String EventConnectivityChanged = "ConnectivityChanged";
47 
48     /**
49      * Socket keep-alive event
50      */
51     public static final String EventSocketKeepaliveCallback = "SocketKeepaliveCallback";
52 
53     /**
54      * Constants for SocketKeepaliveEvent.
55      */
56     public static class SocketKeepaliveContainer {
57         public static final String ID = "id";
58         public static final String SOCKET_KEEPALIVE_EVENT = "socketKeepaliveEvent";
59     }
60 
61     /**
62      * Constants for NetworkCallbackEvent.
63      */
64     public static class NetworkCallbackContainer {
65         public static final String ID = "id";
66         public static final String NETWORK_CALLBACK_EVENT = "networkCallbackEvent";
67         public static final String MAX_MS_TO_LIVE = "maxMsToLive";
68         public static final String RSSI = "rssi";
69         public static final String METERED = "metered";
70         public static final String INTERFACE_NAME = "interfaceName";
71         public static final String CREATE_TIMESTAMP = "creation_timestamp";
72         public static final String CURRENT_TIMESTAMP = "current_timestamp";
73     }
74 
75     /**
76      * Constants for OnStartTetheringCallback
77      */
78     public static final String TetheringStartedCallback = "ConnectivityManagerOnTetheringStarted";
79     public static final String TetheringFailedCallback = "ConnectivityManagerOnTetheringFailed";
80 
81     /**
82      * Constants for Meteredness
83      */
84     public static final Integer NET_CAPABILITY_TEMPORARILY_NOT_METERED = 25;
85 
86     /**
87      * Constants for PrivateDnsMode
88      */
89     public static final String PrivateDnsModeOff = "off";
90     public static final String PrivateDnsModeOpportunistic = "opportunistic";
91     public static final String PrivateDnsModeStrict = "hostname";
92 
93     /**
94      * Constants for NetworkCapabilties/NetworkRequest
95      */
96     public static final String NET_CAPABILITIES_TRANSPORT_TYPE = "TransportType";
97     public static final String NET_CAPABILITIES_CAPABILITIES = "Capability";
98 }
99