1 /*
2  * Copyright 2020 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.uwb;
18 
19 /**
20  * @hide
21  * TODO(b/211025367): Remove this class and use direct API values.
22  */
23 @Backing(type="int")
24 enum RangingChangeReason {
25   /**
26    * Unknown reason
27    */
28   UNKNOWN,
29 
30   /**
31    * A local API call triggered the change, such as a call to
32    * IUwbAdapter.closeRanging.
33    */
34   LOCAL_API,
35 
36   /**
37    * The maximum number of sessions has been reached. This may be generated for
38    * an active session if a higher priority session begins.
39    */
40   MAX_SESSIONS_REACHED,
41 
42   /**
43    * The system state has changed by user or system action resulting in the
44    * session changing (e.g. the user disables UWB).
45    */
46   SYSTEM_POLICY,
47 
48   /**
49    * The remote device has requested to change the session
50    */
51   REMOTE_REQUEST,
52 
53   /**
54    * The session changed for a protocol specific reason
55    */
56   PROTOCOL_SPECIFIC,
57 
58   /**
59    * The provided parameters were invalid
60    */
61   BAD_PARAMETERS,
62 
63   /**
64    * Max ranging round retries reached.
65    */
66   MAX_RR_RETRY_REACHED,
67 
68   /**
69    * Insufficient slot per rr.
70    */
71   INSUFFICIENT_SLOTS_PER_RR,
72 
73   /**
74    * The system state has changed resulting in the session changing (eg: the
75    * user's locale changes and an active channel is no longer permitted to be
76    * used).
77    */
78   SYSTEM_REGULATION,
79 
80   /**
81    * When ranging is suspended due to Suspend Ranging bit is set to 1 in the received RCM at
82    * responder, UWBS will report this reason code with Session State set to SESSION_STATE_ACTIVE.
83    */
84   SESSION_SUSPENDED,
85 
86   /**
87    * When ranging is resumed due to Suspend Ranging bit is set to 0 in the received RCM at
88    * responder, UWBS will report this reason code with Session State set to SESSION_STATE_ACTIVE.
89    */
90   SESSION_RESUMED,
91 
92   /**
93   *  Session was stopped due to inband signal.
94   */
95   INBAND_SESSION_STOP,
96 }
97