1 /*
2  * Copyright (C) 2019 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.android.cellbroadcastservice;
18 
19 /**
20  * Constants used in SMS Cell Broadcast messages (see 3GPP TS 23.041).
21  */
22 public class SmsCbConstants {
23 
24     /** Private constructor for utility class. */
SmsCbConstants()25     private SmsCbConstants() { }
26 
27     /** Start of PWS Message Identifier range (includes ETWS and CMAS). */
28     public static final int MESSAGE_ID_PWS_FIRST_IDENTIFIER =
29             0x1100; // 4352
30 
31     /** Bitmask for messages of ETWS type (including future extensions). */
32     public static final int MESSAGE_ID_ETWS_TYPE_MASK =
33             0xFFF8;
34 
35     /** Value for messages of ETWS type after applying {@link #MESSAGE_ID_ETWS_TYPE_MASK}. */
36     public static final int MESSAGE_ID_ETWS_TYPE =
37             0x1100; // 4352
38 
39     /** ETWS Message Identifier for earthquake warning message. */
40     public static final int MESSAGE_ID_ETWS_EARTHQUAKE_WARNING =
41             0x1100; // 4352
42 
43     /** ETWS Message Identifier for tsunami warning message. */
44     public static final int MESSAGE_ID_ETWS_TSUNAMI_WARNING =
45             0x1101; // 4353
46 
47     /** ETWS Message Identifier for earthquake and tsunami combined warning message. */
48     public static final int MESSAGE_ID_ETWS_EARTHQUAKE_AND_TSUNAMI_WARNING =
49             0x1102; // 4354
50 
51     /** ETWS Message Identifier for test message. */
52     public static final int MESSAGE_ID_ETWS_TEST_MESSAGE =
53             0x1103; // 4355
54 
55     /** ETWS Message Identifier for messages related to other emergency types. */
56     public static final int MESSAGE_ID_ETWS_OTHER_EMERGENCY_TYPE =
57             0x1104; // 4356
58 
59     /** Start of CMAS Message Identifier range. */
60     public static final int MESSAGE_ID_CMAS_FIRST_IDENTIFIER =
61             0x1112; // 4370
62 
63     /** CMAS Message Identifier for Presidential Level alerts. */
64     public static final int MESSAGE_ID_CMAS_ALERT_PRESIDENTIAL_LEVEL =
65             0x1112; // 4370
66 
67     /** CMAS Message Identifier for Extreme alerts, Urgency=Immediate, Certainty=Observed. */
68     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_OBSERVED =
69             0x1113; // 4371
70 
71     /** CMAS Message Identifier for Extreme alerts, Urgency=Immediate, Certainty=Likely. */
72     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_LIKELY =
73             0x1114; // 4372
74 
75     /** CMAS Message Identifier for Extreme alerts, Urgency=Expected, Certainty=Observed. */
76     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_OBSERVED =
77             0x1115; // 4373
78 
79     /** CMAS Message Identifier for Extreme alerts, Urgency=Expected, Certainty=Likely. */
80     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_LIKELY =
81             0x1116; // 4374
82 
83     /** CMAS Message Identifier for Severe alerts, Urgency=Immediate, Certainty=Observed. */
84     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_OBSERVED =
85             0x1117; // 4375
86 
87     /** CMAS Message Identifier for Severe alerts, Urgency=Immediate, Certainty=Likely. */
88     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_LIKELY =
89             0x1118; // 4376
90 
91     /** CMAS Message Identifier for Severe alerts, Urgency=Expected, Certainty=Observed. */
92     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_OBSERVED =
93             0x1119; // 4377
94 
95     /** CMAS Message Identifier for Severe alerts, Urgency=Expected, Certainty=Likely. */
96     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_LIKELY =
97             0x111A; // 4378
98 
99     /** CMAS Message Identifier for Child Abduction Emergency (Amber Alert). */
100     public static final int MESSAGE_ID_CMAS_ALERT_CHILD_ABDUCTION_EMERGENCY =
101             0x111B; // 4379
102 
103     /** CMAS Message Identifier for the Required Monthly Test. */
104     public static final int MESSAGE_ID_CMAS_ALERT_REQUIRED_MONTHLY_TEST =
105             0x111C; // 4380
106 
107     /** CMAS Message Identifier for CMAS Exercise. */
108     public static final int MESSAGE_ID_CMAS_ALERT_EXERCISE =
109             0x111D; // 4381
110 
111     /** CMAS Message Identifier for operator defined use. */
112     public static final int MESSAGE_ID_CMAS_ALERT_OPERATOR_DEFINED_USE =
113             0x111E; // 4382
114 
115     /** CMAS Message Identifier for Presidential Level alerts for additional languages. */
116     public static final int MESSAGE_ID_CMAS_ALERT_PRESIDENTIAL_LEVEL_LANGUAGE =
117             0x111F; // 4383
118 
119     /**
120      * CMAS Message Identifier for Extreme alerts, Urgency=Immediate, Certainty=Observed
121      * for additional languages.
122      */
123     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_OBSERVED_LANGUAGE =
124             0x1120; // 4384
125 
126     /**
127      * CMAS Message Identifier for Extreme alerts, Urgency=Immediate, Certainty=Likely
128      * for additional languages.
129      */
130     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_IMMEDIATE_LIKELY_LANGUAGE =
131             0x1121; // 4385
132 
133     /**
134      * CMAS Message Identifier for Extreme alerts, Urgency=Expected, Certainty=Observed
135      * for additional languages.
136      */
137     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_OBSERVED_LANGUAGE =
138             0x1122; // 4386
139 
140     /**
141      * CMAS Message Identifier for Extreme alerts, Urgency=Expected, Certainty=Likely
142      * for additional languages.
143      */
144     public static final int MESSAGE_ID_CMAS_ALERT_EXTREME_EXPECTED_LIKELY_LANGUAGE =
145             0x1123; // 4387
146 
147     /**
148      * CMAS Message Identifier for Severe alerts, Urgency=Immediate, Certainty=Observed
149      * for additional languages.
150      */
151     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_OBSERVED_LANGUAGE =
152             0x1124; // 4388
153 
154     /**
155      * CMAS Message Identifier for Severe alerts, Urgency=Immediate, Certainty=Likely
156      * for additional languages.
157      */
158     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_IMMEDIATE_LIKELY_LANGUAGE =
159             0x1125; // 4389
160 
161     /**
162      * CMAS Message Identifier for Severe alerts, Urgency=Expected, Certainty=Observed
163      * for additional languages.
164      */
165     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_OBSERVED_LANGUAGE =
166             0x1126; // 4390
167 
168     /**
169      * CMAS Message Identifier for Severe alerts, Urgency=Expected, Certainty=Likely
170      * for additional languages.
171      */
172     public static final int MESSAGE_ID_CMAS_ALERT_SEVERE_EXPECTED_LIKELY_LANGUAGE =
173             0x1127; // 4391
174 
175     /**
176      * CMAS Message Identifier for Child Abduction Emergency (Amber Alert)
177      * for additional languages.
178      */
179     public static final int MESSAGE_ID_CMAS_ALERT_CHILD_ABDUCTION_EMERGENCY_LANGUAGE =
180             0x1128; // 4392
181 
182     /** CMAS Message Identifier for the Required Monthly Test  for additional languages. */
183     public static final int MESSAGE_ID_CMAS_ALERT_REQUIRED_MONTHLY_TEST_LANGUAGE =
184             0x1129; // 4393
185 
186     /** CMAS Message Identifier for CMAS Exercise for additional languages. */
187     public static final int MESSAGE_ID_CMAS_ALERT_EXERCISE_LANGUAGE =
188             0x112A; // 4394
189 
190     /** CMAS Message Identifier for operator defined use for additional languages. */
191     public static final int MESSAGE_ID_CMAS_ALERT_OPERATOR_DEFINED_USE_LANGUAGE =
192             0x112B; // 4395
193 
194     /** CMAS Message Identifier for CMAS Public Safety Alerts. */
195     public static final int MESSAGE_ID_CMAS_ALERT_PUBLIC_SAFETY =
196             0x112C; // 4396
197 
198     /** CMAS Message Identifier for CMAS Public Safety Alerts for additional languages. */
199     public static final int MESSAGE_ID_CMAS_ALERT_PUBLIC_SAFETY_LANGUAGE =
200             0x112D; // 4397
201 
202     /** CMAS Message Identifier for CMAS State/Local Test. */
203     public static final int MESSAGE_ID_CMAS_ALERT_STATE_LOCAL_TEST =
204             0x112E; // 4398
205 
206     /** CMAS Message Identifier for CMAS State/Local Test for additional languages. */
207     public static final int MESSAGE_ID_CMAS_ALERT_STATE_LOCAL_TEST_LANGUAGE =
208             0x112F; // 4399
209 
210     /** CMAS Message Identifier for CMAS geo fencing trigger message. */
211     public static final int MESSAGE_ID_CMAS_GEO_FENCING_TRIGGER =
212             0x1130; // 4400
213 
214     /** End of CMAS Message Identifier range. */
215     public static final int MESSAGE_ID_CMAS_LAST_IDENTIFIER = MESSAGE_ID_CMAS_GEO_FENCING_TRIGGER;
216 
217     /** End of PWS Message Identifier range (includes ETWS, CMAS, and future extensions). */
218     public static final int MESSAGE_ID_PWS_LAST_IDENTIFIER =
219             0x18FF; // 6399
220 
221     /** ETWS serial number flag to activate the popup display. */
222     public static final int SERIAL_NUMBER_ETWS_ACTIVATE_POPUP =
223             0x1000; // 4096
224 
225     /** ETWS serial number flag to activate the emergency user alert. */
226     public static final int SERIAL_NUMBER_ETWS_EMERGENCY_USER_ALERT =
227             0x2000; // 8192
228 }
229