• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Copyright (C) 2024 The Android Open Source Project
2#
3#  Licensed under the Apache License, Version 2.0 (the "License");
4#  you may not use this file except in compliance with the License.
5#  You may obtain a copy of the License at
6#
7#       http://www.apache.org/licenses/LICENSE-2.0
8#
9#  Unless required by applicable law or agreed to in writing, software
10#  distributed under the License is distributed on an "AS IS" BASIS,
11#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#  See the License for the specific language governing permissions and
13#  limitations under the License.
14
15# Lint as: python3
16"""Constants for Wifi-Aware Mobly test"""
17
18import dataclasses
19import datetime
20import enum
21import operator
22
23from mobly import utils
24
25# Package name for the Wi-Fi Aware snippet application
26WIFI_AWARE_SNIPPET_PACKAGE_NAME = 'com.google.snippet.wifi.aware'
27WIFI_SNIPPET_PACKAGE_NAME = 'com.google.snippet.wifi'
28# Timeout duration for Wi-Fi state change operations
29WAIT_WIFI_STATE_TIME_OUT = datetime.timedelta(seconds=30)
30AWARE_NETWORK_INFO_CLASS_NAME = 'android.net.wifi.aware.WifiAwareNetworkInfo'
31
32SERVICE_NAME = 'service_name'
33SERVICE_SPECIFIC_INFO = 'service_specific_info'
34MATCH_FILTER = 'match_filter'
35MATCH_FILTER_LIST = 'MatchFilterList'
36SUBSCRIBE_TYPE = 'subscribe_type'
37PUBLISH_TYPE = 'publish_type'
38TERMINATE_NOTIFICATION_ENABLED = 'terminate_notification_enabled'
39MAX_DISTANCE_MM = 'max_distance_mm'
40PAIRING_CONFIG = 'pairing_config'
41AWARE_NETWORK_INFO_CLASS_NAME = 'android.net.wifi.aware.WifiAwareNetworkInfo'
42TTL_SEC = 'TtlSec'
43INSTANTMODE_ENABLE = 'InstantModeEnabled'
44FEATURE_WIFI_AWARE = 'feature:android.hardware.wifi.aware'
45DISCOVERY_KEY_RANGING_ENABLED = 'ranging_enabled'
46DISCOVERY_KEY_MIN_DISTANCE_MM = 'MinDistanceMm'
47DISCOVERY_KEY_MAX_DISTANCE_MM = 'MaxDistanceMm'
48
49
50# onServiceLost reason code
51EASON_PEER_NOT_VISIBLE = 1
52
53
54class WifiAwareTestConstants:
55    """Constants for Wi-Fi Aware test."""
56
57    SERVICE_NAME = 'CtsVerifierTestService'
58    MATCH_FILTER_BYTES = 'bytes used for matching'.encode('utf-8')
59    PUB_SSI = 'Extra bytes in the publisher discovery'.encode('utf-8')
60    SUB_SSI = 'Arbitrary bytes for the subscribe discovery'.encode('utf-8')
61    LARGE_ENOUGH_DISTANCE_MM = 100000
62    PASSWORD = 'Some super secret password'
63    ALIAS_PUBLISH = 'publisher'
64    ALIAS_SUBSCRIBE = 'subscriber'
65    TEST_WAIT_DURATION_MS = 10000
66    TEST_MESSAGE = 'test message!'
67    MESSAGE_ID = 1234
68    MSG_CLIENT_TO_SERVER = (
69        'GET SOME BYTES [Random Identifier: %s]' % utils.rand_ascii_str(5)
70    )
71    MSG_SERVER_TO_CLIENT = (
72        'PUT SOME OTHER BYTES [Random Identifier: %s]' % utils.rand_ascii_str(5)
73    )
74    PMK = '01234567890123456789012345678901'
75    # 6 == TCP
76    TRANSPORT_PROTOCOL_TCP = 6
77    CHANNEL_IN_MHZ = 5745
78
79
80@enum.unique
81class WifiAwareSnippetEventName(enum.StrEnum):
82    """Represents event names for Wi-Fi Aware snippet operations."""
83
84    GET_PAIRED_DEVICE = 'getPairedDevices'
85    ON_AVAILABLE = 'onAvailable'
86    ON_LOST = 'onLost'
87
88
89@enum.unique
90class WifiAwareSnippetParams(enum.StrEnum):
91    """Represents parameters for Wi-Fi Aware snippet events."""
92
93    ALIAS_LIST = 'getPairedDevices'
94
95
96@enum.unique
97class DiscoverySessionCallbackMethodType(enum.StrEnum):
98    """Represents the types of callback methods for Wi-Fi Aware discovery sessions.
99
100    These callbacks are correspond to DiscoverySessionCallback in the Android documentation:
101    https://developer.android.com/reference/android/net/wifi/aware/DiscoverySessionCallback
102    """
103
104    PUBLISH_STARTED = 'onPublishStarted'
105    SUBSCRIBE_STARTED = 'onSubscribeStarted'
106    SESSION_CONFIG_UPDATED = 'onSessionConfigUpdated'
107    SESSION_CONFIG_FAILED = 'onSessionConfigFailed'
108    SESSION_TERMINATED = 'onSessionTerminated'
109    SERVICE_DISCOVERED = 'onServiceDiscovered'
110    SERVICE_DISCOVERED_WITHIN_RANGE = 'onServiceDiscoveredWithinRange'
111    MESSAGE_SEND_SUCCEEDED = 'onMessageSendSucceeded'
112    MESSAGE_SEND_FAILED = 'onMessageSendFailed'
113    MESSAGE_RECEIVED = 'onMessageReceived'
114    PAIRING_REQUEST_RECEIVED = 'onPairingSetupRequestReceived'
115    PAIRING_SETUP_SUCCEEDED = 'onPairingSetupSucceeded'
116    PAIRING_SETUP_FAILED = 'onPairingSetupFailed'
117    PAIRING_VERIFICATION_SUCCEEDED = 'onPairingVerificationSucceed'
118    PAIRING_VERIFICATION_FAILED = 'onPairingVerificationFailed'
119    BOOTSTRAPPING_SUCCEEDED = 'onBootstrappingSucceeded'
120    BOOTSTRAPPING_FAILED = 'onBootstrappingFailed'
121    # Event for the publish or subscribe step: triggered by onPublishStarted or SUBSCRIBE_STARTED or
122    # onSessionConfigFailed
123    DISCOVER_RESULT = 'discoveryResult'
124    # Event for the message send result.
125    MESSAGE_SEND_RESULT = 'messageSendResult'
126    SESSION_CB_ON_SERVICE_LOST = 'WifiAwareSessionOnServiceLost'
127    SESSION_CB_KEY_LOST_REASON = 'lostReason'
128
129
130@enum.unique
131class DiscoverySessionCallbackParamsType(enum.StrEnum):
132    CALLBACK_NAME = 'callbackName'
133    IS_SESSION_INIT = 'isSessionInitialized'
134    MESSAGE_ID = 'messageId'
135    RECEIVE_MESSAGE = 'receivedMessage'
136
137
138@enum.unique
139class NetworkCbEventName(enum.StrEnum):
140    """Represents the event name for ConnectivityManager network callbacks."""
141
142    NETWORK_CALLBACK = 'NetworkCallback'
143    NETWORK_CB_LOST = 'CallbackLost'
144
145
146@enum.unique
147class NetworkCbEventKey(enum.StrEnum):
148    """Represents event data keys for ConnectivityManager network callbacks."""
149
150    NETWORK = 'network'
151    CALLBACK_NAME = 'callbackName'
152    NETWORK_CAPABILITIES = 'networkCapabilities'
153    TRANSPORT_INFO_CLASS_NAME = 'transportInfoClassName'
154    CHANNEL_IN_MHZ = 'channelInMhz'
155    NETWORK_INTERFACE_NAME = 'interfaceName'
156
157
158@enum.unique
159class NetworkCbName(enum.StrEnum):
160    """Represents the name of network callback for ConnectivityManager.
161
162    These callbacks are correspond to DiscoverySessionCallback in the Android documentation:
163    https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback
164    """
165
166    ON_UNAVAILABLE = 'onUnavailable'
167    ON_CAPABILITIES_CHANGED = 'onCapabilitiesChanged'
168    ON_PROPERTIES_CHANGED = 'onLinkPropertiesChanged'
169    NET_CAP_IPV6 = 'aware_ipv6'
170    NET_CAP_PORT = 'port'
171    NET_CAP_TRANSPORT_PROTOCOL = 'aware_transport_protocol'
172
173
174@enum.unique
175class RangingResultCb(enum.StrEnum):
176    """Constant for handling callback of snippet RPC wifiAwareStartRanging."""
177
178    # Callback methods related to RangingResultCallback:
179    # https://developer.android.com/reference/android/net/wifi/rtt/RangingResultCallback
180    CB_METHOD_ON_RANGING_RESULT = 'onRangingResults'
181    CB_METHOD_ON_RANGING_FAILURE = 'onRangingFailure'
182
183    # Other constants related to snippet implementation.
184    EVENT_NAME_ON_RANGING_RESULT = 'WifiRttRangingOnRangingResult'
185    DATA_KEY_CALLBACK_NAME = 'callbackName'
186    DATA_KEY_RESULTS = 'results'
187    DATA_KEY_RESULT_STATUS = 'status'
188    DATA_KEY_RESULT_DISTANCE_MM = 'distanceMm'
189    DATA_KEY_RESULT_RSSI = 'rssi'
190    DATA_KEY_PEER_ID = 'peerId'
191    DATA_KEY_MAC = 'mac'
192    DATA_KEY_DISTANCE_STD_DEV_MM = 'distanceStdDevMm'
193    DATA_KEY_NUM_ATTEMPTED_MEASUREMENTS = 'numAttemptedMeasurements'
194    DATA_KEY_NUM_SUCCESSFUL_MEASUREMENTS = 'numSuccessfulMeasurements'
195    DATA_KEY_LCI = 'lci'
196    DATA_KEY_LCR = 'lcr'
197    DATA_KEY_TIMESTAMP = 'timestamp'
198    DATA_KEY_MAC_AS_STRING = 'macAsString'
199
200
201@enum.unique
202class RangingStatusCb(enum.IntEnum):
203    """Constant for handling RTT status."""
204
205    EVENT_CB_RANGING_STATUS_SUCCESS = 0
206    EVENT_CB_RANGING_STATUS_FAIL = 1
207    EVENT_CB_RANGING_STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC = 2
208
209
210@enum.unique
211class RangingResultStatusCode(enum.IntEnum):
212    """Ranging result status code.
213
214    This corresponds to status constants in RangingRequest:
215    https://developer.android.com/reference/android/net/wifi/rtt/RangingResult
216    """
217
218    SUCCESS = 0
219    FAIL = 1
220    RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC = 2
221
222
223@enum.unique
224class WifiAwareSnippetParams(enum.StrEnum):
225    """Represents parameters for Wi-Fi Aware snippet events."""
226
227    SERVICE_SPECIFIC_INFO = 'serviceSpecificInfo'
228    RECEIVED_MESSAGE = 'receivedMessage'
229    PEER_HANDLE = 'peerHandle'
230    MATCH_FILTER = 'matchFilter'
231    MATCH_FILTER_VALUE = 'value'
232    PAIRING_CONFIG = 'pairingConfig'
233    DISTANCE_MM = 'distanceMm'
234    LAST_MESSAGE_ID = 'lastMessageId'
235    PAIRING_REQUEST_ID = 'pairingRequestId'
236    BOOTSTRAPPING_METHOD = 'bootstrappingMethod'
237    PEER_ID = 'peerId'
238
239
240@enum.unique
241class SubscribeType(enum.IntEnum):
242    """Represents the types of subscriptions in Wi-Fi Aware.
243
244    These callbacks are correspond to SubscribeConfig in the Android documentation:
245    https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig#constants_1
246    """
247
248    PASSIVE = 0
249    ACTIVE = 1
250
251
252@enum.unique
253class PublishType(enum.IntEnum):
254    """Represents the types of publications in Wi-Fi Aware.
255
256    These publication types are correspond to PublishConfig in the Android documentation:
257    https://developer.android.com/reference/android/net/wifi/aware/PublishConfig#constants_1
258    """
259
260    UNSOLICITED = 0
261    SOLICITED = 1
262
263
264class BootstrappingMethod(enum.IntEnum):
265    """Represents bootstrapping methods for Wi-Fi Aware pairing.
266
267    These types are correspond to AwarePairingConfig bootstrapping methods in the Android
268    documentation:
269    https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig#summary
270    """
271
272    OPPORTUNISTIC = 1
273    PIN_CODE_DISPLAY = 2
274    PASSPHRASE_DISPLAY = 4
275    QR_DISPLAY = 8
276    NFC_TAG = 16
277    PIN_CODE_KEYPAD = 32
278    PASSPHRASE_KEYPAD = 64
279    QR_SCAN = 128
280    NFC_READER = 256
281
282
283@dataclasses.dataclass(frozen=True)
284class AwarePairingConfig:
285    """Config for Wi-Fi Aware Pairing.
286
287    These configurations correspond to AwarePairingConfig in the Android documentation:
288    https://developer.android.com/reference/android/net/wifi/aware/AwarePairingConfig?hl=en
289    """
290
291    pairing_cache_enabled: bool = False
292    pairing_setup_enabled: bool = False
293    pairing_verification_enabled: bool = False
294    bootstrapping_methods: BootstrappingMethod = (
295        BootstrappingMethod.OPPORTUNISTIC
296    )
297
298    def to_dict(self) -> dict[str, int | bool]:
299        result = dataclasses.asdict(self)
300        result['bootstrapping_methods'] = self.bootstrapping_methods.value
301        return result
302
303
304@dataclasses.dataclass(frozen=True)
305class SubscribeConfig:
306    """Config for Wi-Fi Aware Subscribe.
307
308    These configurations correspond to SubscribeConfig in the Android documentation:
309    https://developer.android.com/reference/android/net/wifi/aware/SubscribeConfig
310    """
311
312    subscribe_type: SubscribeType
313    service_specific_info: bytes = WifiAwareTestConstants.SUB_SSI
314    match_filter: list[bytes] | None = (
315        WifiAwareTestConstants.MATCH_FILTER_BYTES,
316    )
317    min_distance_mm: int | None = None
318    max_distance_mm: int | None = None
319    pairing_config: AwarePairingConfig | None = None
320    terminate_notification_enabled: bool = True
321    service_name: str = WifiAwareTestConstants.SERVICE_NAME
322
323    def to_dict(
324        self,
325    ) -> dict[str, str | bool | list[str] | int | dict[str, int | bool | None]]:
326        result = dataclasses.asdict(self)
327        result['subscribe_type'] = self.subscribe_type.value
328        result['service_specific_info'] = self.service_specific_info.decode(
329            'utf-8'
330        )
331
332        if self.match_filter is None:
333            del result['match_filter']
334        else:
335            result['match_filter'] = [
336                mf.decode('utf-8') for mf in self.match_filter
337            ]
338
339        if self.pairing_config is None:
340            del result['pairing_config']
341        else:
342            result['pairing_config'] = self.pairing_config.to_dict()
343
344        if self.max_distance_mm is None:
345            del result['max_distance_mm']
346
347        if self.min_distance_mm is None:
348            del result["min_distance_mm"]
349
350        return result
351
352
353@dataclasses.dataclass(frozen=True)
354class PublishConfig:
355    """Wi-Fi Aware Publish Config.
356
357    These configurations correspond to PublishConfig in the Android documentation:
358    https://developer.android.com/reference/android/net/wifi/aware/PublishConfig
359    """
360
361    publish_type: PublishType
362    service_specific_info: bytes = WifiAwareTestConstants.PUB_SSI
363    match_filter: list[bytes] | None = (
364        WifiAwareTestConstants.MATCH_FILTER_BYTES,
365    )
366    ranging_enabled: bool = False
367    terminate_notification_enabled: bool = True
368    pairing_config: AwarePairingConfig | None = None
369    service_name: str = WifiAwareTestConstants.SERVICE_NAME
370
371    def to_dict(
372        self,
373    ) -> dict:
374        """Convert PublishConfig to dict."""
375        result = dataclasses.asdict(self)
376        result['publish_type'] = self.publish_type.value
377        result['service_specific_info'] = self.service_specific_info.decode(
378            'utf-8'
379        )
380        if self.match_filter is None:
381            del result['match_filter']
382        else:
383            result['match_filter'] = [
384                mf.decode('utf-8') for mf in self.match_filter
385            ]
386
387        if self.pairing_config is None:
388            del result['pairing_config']
389        else:
390            result['pairing_config'] = self.pairing_config.to_dict()
391        return result
392
393
394@dataclasses.dataclass(frozen=True)
395class RangingRequest:
396    """Wi-Fi RTT Ranging request.
397
398    This class correspond to android.net.wifi.rtt.RangingRequest:
399    https://developer.android.com/reference/android/net/wifi/rtt/RangingRequest
400
401    Attributes:
402        peer_ids: A list of peer IDs that will be converted to peer Handles and
403            passed to RangingRequest on device.
404        peer_mac_addresses: A list of peer MAC addresses that will be passed to
405            RangingRequest on device.
406    """
407
408    peer_ids: list[int] = dataclasses.field(default_factory=list)
409    peer_mac_addresses: list[str] = dataclasses.field(default_factory=list)
410
411    def to_dict(self) -> dict:
412        result = {}
413        if self.peer_ids:
414            result['peer_ids'] = self.peer_ids
415        if self.peer_mac_addresses:
416            result['peer_mac_addresses'] = self.peer_mac_addresses
417        return result
418
419
420class NetworkCapabilities:
421    """Network Capabilities.
422
423    https://developer.android.com/reference/android/net/NetworkCapabilities?hl=en#summary
424    """
425
426    class Transport(enum.IntEnum):
427        """Transport type.
428
429        https://developer.android.com/reference/android/net/NetworkCapabilities#TRANSPORT_CELLULAR
430        """
431
432        TRANSPORT_CELLULAR = 0
433        TRANSPORT_WIFI = 1
434        TRANSPORT_BLUETOOTH = 2
435        TRANSPORT_ETHERNET = 3
436        TRANSPORT_VPN = 4
437        TRANSPORT_WIFI_AWARE = 5
438        TRANSPORT_LOWPAN = 6
439
440    class NetCapability(enum.IntEnum):
441        """Network Capability.
442
443        https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_MMS
444        """
445
446        NET_CAPABILITY_MMS = 0
447        NET_CAPABILITY_SUPL = 1
448        NET_CAPABILITY_DUN = 2
449        NET_CAPABILITY_FOTA = 3
450        NET_CAPABILITY_IMS = 4
451        NET_CAPABILITY_CBS = 5
452        NET_CAPABILITY_WIFI_P2P = 6
453        NET_CAPABILITY_IA = 7
454        NET_CAPABILITY_RCS = 8
455        NET_CAPABILITY_XCAP = 9
456        NET_CAPABILITY_EIMS = 10
457        NET_CAPABILITY_NOT_METERED = 11
458        NET_CAPABILITY_INTERNET = 12
459        NET_CAPABILITY_NOT_RESTRICTED = 13
460        NET_CAPABILITY_TRUSTED = 14
461        NET_CAPABILITY_NOT_VPN = 15
462        NET_CAPABILITY_VALIDATED = 16
463        NET_CAPABILITY_CAPTIVE_PORTAL = 17
464        NET_CAPABILITY_NOT_ROAMING = 18
465        NET_CAPABILITY_FOREGROUND = 19
466        NET_CAPABILITY_NOT_CONGESTED = 20
467        NET_CAPABILITY_NOT_SUSPENDED = 21
468        NET_CAPABILITY_OEM_PAID = 22
469        NET_CAPABILITY_MCX = 23
470        NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24
471        NET_CAPABILITY_TEMPORARILY_NOT_METERED = 25
472        NET_CAPABILITY_OEM_PRIVATE = 26
473        NET_CAPABILITY_VEHICLE_INTERNAL = 27
474        NET_CAPABILITY_NOT_VCN_MANAGED = 28
475        NET_CAPABILITY_ENTERPRISE = 29
476        NET_CAPABILITY_VSIM = 30
477        NET_CAPABILITY_BIP = 31
478        NET_CAPABILITY_HEAD_UNIT = 32
479        NET_CAPABILITY_MMTEL = 33
480        NET_CAPABILITY_PRIORITIZE_LATENCY = 34
481        NET_CAPABILITY_PRIORITIZE_BANDWIDTH = 35
482
483
484@dataclasses.dataclass(frozen=True)
485class NetworkRequest:
486    """Wi-Fi Aware Network Request.
487
488    https://developer.android.com/reference/android/net/NetworkRequest
489    """
490
491    transport_type: NetworkCapabilities.Transport
492    network_specifier_parcel: str
493
494    def to_dict(self) -> dict:
495        result = dataclasses.asdict(self)
496        if not self.network_specifier_parcel:
497            del result['network_specifier_parcel']
498        if self.transport_type:
499            result['transport_type'] = self.transport_type.value
500        return result
501
502
503class Characteristics(enum.IntEnum):
504    """The characteristics of the Wi-Fi Aware implementation.
505
506    https://developer.android.com/reference/android/net/wifi/aware/Characteristics
507    """
508
509    WIFI_AWARE_CIPHER_SUITE_NCS_SK_128 = 1
510
511
512@dataclasses.dataclass(frozen=False)
513class WifiAwareDataPathSecurityConfig:
514    """Wi-Fi Aware Network Specifier.
515
516    https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier
517    """
518
519    pmk: str | None = None
520    cipher_suite: Characteristics | None = (
521        Characteristics.WIFI_AWARE_CIPHER_SUITE_NCS_SK_128
522    )
523
524    def to_dict(self) -> dict:
525        result = dataclasses.asdict(self)
526        if not self.pmk:
527            del result['pmk']
528        if not self.cipher_suite:
529            del result['cipher_suite']
530        else:
531            result['cipher_suite'] = self.cipher_suite.value
532        return result
533
534
535@dataclasses.dataclass(frozen=False)
536class WifiAwareNetworkSpecifier:
537    """Wi-Fi Aware Network Specifier.
538
539    https://developer.android.com/reference/android/net/wifi/aware/WifiAwareNetworkSpecifier
540    """
541
542    psk_passphrase: str | None = None
543    port: int | None = None
544    transport_protocol: int | None = None
545    pmk: str | None = None
546    data_path_security_config: WifiAwareDataPathSecurityConfig | None = None
547    channel_frequency_m_hz: int | None = None
548
549    def to_dict(self) -> dict:
550        result = dataclasses.asdict(self)
551        if not self.psk_passphrase:
552            del result['psk_passphrase']
553        if not self.port:
554            del result['port']
555        if not self.transport_protocol:
556            del result['transport_protocol']
557        if not self.pmk:
558            del result['pmk']
559        if not self.data_path_security_config:
560            del result['data_path_security_config']
561        else:
562            result['data_path_security_config'] = (
563                self.data_path_security_config.to_dict()
564            )
565        if not self.channel_frequency_m_hz:
566            del result['channel_frequency_m_hz']
567        return result
568
569
570class SnippetEventNames:
571    """Represents event names for Wi-Fi Aware snippet operations."""
572
573    SERVER_SOCKET_ACCEPT = 'ServerSocketAccept'
574
575
576class SnippetEventParams:
577    """Represents parameters for Wi-Fi Aware snippet events."""
578
579    IS_ACCEPT = 'isAccept'
580    ERROR = 'error'
581    LOCAL_PORT = 'localPort'
582
583
584@enum.unique
585class AttachCallBackMethodType(enum.StrEnum):
586    """Represents Attach Callback Method Type in Wi-Fi Aware.
587
588    https://developer.android.com/reference/android/net/wifi/aware/AttachCallback
589    """
590
591    ATTACHED = 'onAttached'
592    ATTACH_FAILED = 'onAttachFailed'
593    AWARE_SESSION_TERMINATED = 'onAwareSessionTerminated'
594    ID_CHANGED = 'WifiAwareAttachOnIdentityChanged'
595
596
597@enum.unique
598class WifiAwareBroadcast(enum.StrEnum):
599    WIFI_AWARE_AVAILABLE = 'WifiAwareStateAvailable'
600    WIFI_AWARE_NOT_AVAILABLE = 'WifiAwareStateNotAvailable'
601
602
603@enum.unique
604class DeviceidleState(enum.StrEnum):
605    ACTIVE = 'ACTIVE'
606    IDLE = 'IDLE'
607    INACTIVE = 'INACTIVE'
608    OVERRIDE = 'OVERRIDE'
609
610
611@enum.unique
612class Operator(enum.Enum):
613    """Operator used in the comparison."""
614
615    GREATER = operator.gt
616    GREATER_EQUAL = operator.ge
617    NOT_EQUAL = operator.ne
618    EQUAL = operator.eq
619    LESS = operator.lt
620    LESS_EQUAL = operator.le
621
622
623@enum.unique
624class AndroidVersion(enum.IntEnum):
625    """Android OS version."""
626
627    R = 11
628    S = 12
629    T = 13
630    U = 14
631
632
633@enum.unique
634class CountryCode(enum.StrEnum):
635    """Country Code abbreviation."""
636    AUSTRALIA = 'AU'
637    CHINA = 'CN'
638    GERMANY = 'DE'
639    JAPAN = 'JP'
640    UK = 'GB'
641    US = 'US'
642    UNKNOWN = 'UNKNOWN'
643
644