blob: c22ff8ba594b65c224193c63b5f62c1816bd4a9d [file] [log] [blame]
Joe Onoratofd52b182010-11-10 18:00:52 -08001/*
2 * Copyright (C) 2008 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
17package com.android.systemui.statusbar.policy;
18
19import com.android.systemui.R;
Jason Monkda68f592015-01-07 10:55:58 -050020import com.android.systemui.statusbar.policy.MobileSignalController.MobileIconGroup;
Joe Onoratofd52b182010-11-10 18:00:52 -080021
Pengquan Menga62d32b2018-12-06 17:38:38 -080022import java.util.HashMap;
23import java.util.Map;
24
Joe Onoratofd52b182010-11-10 18:00:52 -080025class TelephonyIcons {
Joe Onoratofd52b182010-11-10 18:00:52 -080026 //***** Data connection icons
Jorim Jaggic737b9b2014-09-08 23:57:20 +020027 static final int FLIGHT_MODE_ICON = R.drawable.stat_sys_airplane_mode;
Jason Monk48edc0c2017-04-10 15:01:27 -040028
Amin Shaikhd64e6262018-03-08 10:08:13 -050029 static final int ICON_LTE = R.drawable.ic_lte_mobiledata;
30 static final int ICON_LTE_PLUS = R.drawable.ic_lte_plus_mobiledata;
31 static final int ICON_G = R.drawable.ic_g_mobiledata;
32 static final int ICON_E = R.drawable.ic_e_mobiledata;
33 static final int ICON_H = R.drawable.ic_h_mobiledata;
Amin Shaikhd64e6262018-03-08 10:08:13 -050034 static final int ICON_H_PLUS = R.drawable.ic_h_plus_mobiledata;
35 static final int ICON_3G = R.drawable.ic_3g_mobiledata;
36 static final int ICON_4G = R.drawable.ic_4g_mobiledata;
37 static final int ICON_4G_PLUS = R.drawable.ic_4g_plus_mobiledata;
SongFerngWang3cbcf752019-03-21 23:14:20 +080038 static final int ICON_5G_E = R.drawable.ic_5g_e_mobiledata;
Amin Shaikhd64e6262018-03-08 10:08:13 -050039 static final int ICON_1X = R.drawable.ic_1x_mobiledata;
Pengquan Menga62d32b2018-12-06 17:38:38 -080040 static final int ICON_5G = R.drawable.ic_5g_mobiledata;
41 static final int ICON_5G_PLUS = R.drawable.ic_5g_plus_mobiledata;
Jorim Jaggic737b9b2014-09-08 23:57:20 +020042
Andrew Flynna478d702015-04-14 23:33:45 -040043 static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup(
44 "CARRIER_NETWORK_CHANGE",
Jason Monk48edc0c2017-04-10 15:01:27 -040045 null,
46 null,
Andrew Flynna478d702015-04-14 23:33:45 -040047 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
48 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -040049 0,
50 0,
Andrew Flynna478d702015-04-14 23:33:45 -040051 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -050052 R.string.carrier_network_change_mode,
Andrew Flynna478d702015-04-14 23:33:45 -040053 0,
Amin Shaikhd64e6262018-03-08 10:08:13 -050054 false);
Jason Monkd2263cd2014-11-10 14:22:56 -050055
56 static final MobileIconGroup THREE_G = new MobileIconGroup(
57 "3G",
Jason Monk48edc0c2017-04-10 15:01:27 -040058 null,
59 null,
Jason Monkd2263cd2014-11-10 14:22:56 -050060 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
61 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -040062 0,
63 0,
Jason Monkd2263cd2014-11-10 14:22:56 -050064 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -050065 R.string.data_connection_3g,
Jason Monkd2263cd2014-11-10 14:22:56 -050066 TelephonyIcons.ICON_3G,
Amin Shaikhd64e6262018-03-08 10:08:13 -050067 true);
Jason Monkd2263cd2014-11-10 14:22:56 -050068
Jason Monk7150d7f2015-07-09 10:14:12 -040069 static final MobileIconGroup WFC = new MobileIconGroup(
70 "WFC",
Jason Monk48edc0c2017-04-10 15:01:27 -040071 null,
72 null,
Jason Monk7150d7f2015-07-09 10:14:12 -040073 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
74 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -040075 0,
76 0,
Jason Monk7150d7f2015-07-09 10:14:12 -040077 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikhd64e6262018-03-08 10:08:13 -050078 0, 0, false);
Jason Monk7150d7f2015-07-09 10:14:12 -040079
Jason Monkd2263cd2014-11-10 14:22:56 -050080 static final MobileIconGroup UNKNOWN = new MobileIconGroup(
81 "Unknown",
Jason Monk48edc0c2017-04-10 15:01:27 -040082 null,
83 null,
Jason Monkd2263cd2014-11-10 14:22:56 -050084 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
85 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -040086 0,
87 0,
Jason Monkd2263cd2014-11-10 14:22:56 -050088 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikhd64e6262018-03-08 10:08:13 -050089 0, 0, false);
Jason Monkd2263cd2014-11-10 14:22:56 -050090
91 static final MobileIconGroup E = new MobileIconGroup(
92 "E",
Jason Monk48edc0c2017-04-10 15:01:27 -040093 null,
94 null,
Jason Monkd2263cd2014-11-10 14:22:56 -050095 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
96 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -040097 0,
98 0,
Jason Monkd2263cd2014-11-10 14:22:56 -050099 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500100 R.string.data_connection_edge,
Jason Monkd2263cd2014-11-10 14:22:56 -0500101 TelephonyIcons.ICON_E,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500102 false);
Jason Monkd2263cd2014-11-10 14:22:56 -0500103
104 static final MobileIconGroup ONE_X = new MobileIconGroup(
105 "1X",
Jason Monk48edc0c2017-04-10 15:01:27 -0400106 null,
107 null,
Jason Monkd2263cd2014-11-10 14:22:56 -0500108 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
109 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400110 0,
111 0,
Jason Monkd2263cd2014-11-10 14:22:56 -0500112 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500113 R.string.data_connection_cdma,
Jason Monkd2263cd2014-11-10 14:22:56 -0500114 TelephonyIcons.ICON_1X,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500115 true);
Jason Monkd2263cd2014-11-10 14:22:56 -0500116
117 static final MobileIconGroup G = new MobileIconGroup(
118 "G",
Jason Monk48edc0c2017-04-10 15:01:27 -0400119 null,
120 null,
Jason Monkd2263cd2014-11-10 14:22:56 -0500121 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
122 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400123 0,
124 0,
Jason Monkd2263cd2014-11-10 14:22:56 -0500125 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500126 R.string.data_connection_gprs,
Jason Monkd2263cd2014-11-10 14:22:56 -0500127 TelephonyIcons.ICON_G,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500128 false);
Jason Monkd2263cd2014-11-10 14:22:56 -0500129
130 static final MobileIconGroup H = new MobileIconGroup(
131 "H",
Jason Monk48edc0c2017-04-10 15:01:27 -0400132 null,
133 null,
Jason Monkd2263cd2014-11-10 14:22:56 -0500134 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
135 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400136 0,
137 0,
Jason Monkd2263cd2014-11-10 14:22:56 -0500138 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500139 R.string.data_connection_3_5g,
Jason Monkd2263cd2014-11-10 14:22:56 -0500140 TelephonyIcons.ICON_H,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500141 false);
Jason Monkd2263cd2014-11-10 14:22:56 -0500142
Amin Shaikhf5830ca2018-03-09 14:06:50 -0500143 static final MobileIconGroup H_PLUS = new MobileIconGroup(
144 "H+",
145 null,
146 null,
147 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
148 0, 0,
149 0,
150 0,
151 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
152 R.string.data_connection_3_5g_plus,
153 TelephonyIcons.ICON_H_PLUS,
154 false);
155
Jason Monkd2263cd2014-11-10 14:22:56 -0500156 static final MobileIconGroup FOUR_G = new MobileIconGroup(
157 "4G",
Jason Monk48edc0c2017-04-10 15:01:27 -0400158 null,
159 null,
Jason Monkd2263cd2014-11-10 14:22:56 -0500160 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
161 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400162 0,
163 0,
Jason Monkd2263cd2014-11-10 14:22:56 -0500164 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500165 R.string.data_connection_4g,
Jason Monkd2263cd2014-11-10 14:22:56 -0500166 TelephonyIcons.ICON_4G,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500167 true);
Jason Monkd2263cd2014-11-10 14:22:56 -0500168
Ajay Nambi7965fa42015-05-14 18:48:33 -0700169 static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup(
170 "4G+",
Jason Monk48edc0c2017-04-10 15:01:27 -0400171 null,
172 null,
Ajay Nambi7965fa42015-05-14 18:48:33 -0700173 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
174 0,0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400175 0,
176 0,
Ajay Nambi7965fa42015-05-14 18:48:33 -0700177 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500178 R.string.data_connection_4g_plus,
Ajay Nambi7965fa42015-05-14 18:48:33 -0700179 TelephonyIcons.ICON_4G_PLUS,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500180 true);
Ajay Nambi7965fa42015-05-14 18:48:33 -0700181
Jason Monkd2263cd2014-11-10 14:22:56 -0500182 static final MobileIconGroup LTE = new MobileIconGroup(
183 "LTE",
Jason Monk48edc0c2017-04-10 15:01:27 -0400184 null,
185 null,
Jason Monkd2263cd2014-11-10 14:22:56 -0500186 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
187 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400188 0,
189 0,
Jason Monkd2263cd2014-11-10 14:22:56 -0500190 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500191 R.string.data_connection_lte,
Jason Monkd2263cd2014-11-10 14:22:56 -0500192 TelephonyIcons.ICON_LTE,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500193 true);
Jason Monkd2263cd2014-11-10 14:22:56 -0500194
Jason Monkaa730be2016-07-13 14:22:52 -0400195 static final MobileIconGroup LTE_PLUS = new MobileIconGroup(
196 "LTE+",
Jason Monk48edc0c2017-04-10 15:01:27 -0400197 null,
198 null,
Jason Monkaa730be2016-07-13 14:22:52 -0400199 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
200 0, 0,
Jason Monk48edc0c2017-04-10 15:01:27 -0400201 0,
202 0,
Jason Monkaa730be2016-07-13 14:22:52 -0400203 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Amin Shaikh43ad7fe2018-03-05 14:34:44 -0500204 R.string.data_connection_lte_plus,
Jason Monkaa730be2016-07-13 14:22:52 -0400205 TelephonyIcons.ICON_LTE_PLUS,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500206 true);
Jason Monk7e6c83c2017-04-26 14:35:24 -0400207
SongFerngWang3cbcf752019-03-21 23:14:20 +0800208 static final MobileIconGroup LTE_CA_5G_E = new MobileIconGroup(
209 "5Ge",
210 null,
211 null,
212 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
213 0, 0,
214 0,
215 0,
216 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
217 R.string.data_connection_5ge,
218 TelephonyIcons.ICON_5G_E,
219 true);
220
Pengquan Menga62d32b2018-12-06 17:38:38 -0800221 static final MobileIconGroup NR_5G = new MobileIconGroup(
222 "5G",
223 null,
224 null,
225 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
226 0,
227 0,
228 0,
229 0,
230 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
231 R.string.data_connection_5g,
232 TelephonyIcons.ICON_5G,
233 true);
234
235 static final MobileIconGroup NR_5G_PLUS = new MobileIconGroup(
236 "5G_PLUS",
237 null,
238 null,
239 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
240 0,
241 0,
242 0,
243 0,
244 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
245 R.string.data_connection_5g_plus,
246 TelephonyIcons.ICON_5G_PLUS,
247 true);
248
Jason Monk7e6c83c2017-04-26 14:35:24 -0400249 static final MobileIconGroup DATA_DISABLED = new MobileIconGroup(
250 "DataDisabled",
251 null,
252 null,
253 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
254 0, 0,
255 0,
256 0,
257 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
Rohan Shah7bc37442018-04-10 00:34:50 -0400258 R.string.cell_data_off_content_description,
Amin Shaikhaf4c1932018-03-08 10:29:56 -0500259 0,
Amin Shaikhd64e6262018-03-08 10:08:13 -0500260 false);
Pengquan Menga62d32b2018-12-06 17:38:38 -0800261
Fabian Kozynskic7bc84b2019-03-11 13:57:31 -0400262 static final MobileIconGroup NOT_DEFAULT_DATA = new MobileIconGroup(
263 "NotDefaultData",
264 null,
265 null,
266 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH,
267 0, 0,
268 0,
269 0,
270 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0],
271 R.string.not_default_data_content_description,
272 0,
273 false);
274
275 // When adding a new MobileIconGround, check if the dataContentDescription has to be filtered
276 // in QSCarrier#hasValidTypeContentDescription
277
Pengquan Menga62d32b2018-12-06 17:38:38 -0800278 /** Mapping icon name(lower case) to the icon object. */
279 static final Map<String, MobileIconGroup> ICON_NAME_TO_ICON;
280 static {
281 ICON_NAME_TO_ICON = new HashMap<>();
282 ICON_NAME_TO_ICON.put("carrier_network_change", CARRIER_NETWORK_CHANGE);
283 ICON_NAME_TO_ICON.put("3g", THREE_G);
284 ICON_NAME_TO_ICON.put("wfc", WFC);
285 ICON_NAME_TO_ICON.put("unknown", UNKNOWN);
286 ICON_NAME_TO_ICON.put("e", E);
287 ICON_NAME_TO_ICON.put("1x", ONE_X);
288 ICON_NAME_TO_ICON.put("g", G);
289 ICON_NAME_TO_ICON.put("h", H);
290 ICON_NAME_TO_ICON.put("h+", H_PLUS);
291 ICON_NAME_TO_ICON.put("4g", FOUR_G);
292 ICON_NAME_TO_ICON.put("4g+", FOUR_G_PLUS);
SongFerngWang3cbcf752019-03-21 23:14:20 +0800293 ICON_NAME_TO_ICON.put("5ge", LTE_CA_5G_E);
Pengquan Menga62d32b2018-12-06 17:38:38 -0800294 ICON_NAME_TO_ICON.put("lte", LTE);
295 ICON_NAME_TO_ICON.put("lte+", LTE_PLUS);
296 ICON_NAME_TO_ICON.put("5g", NR_5G);
297 ICON_NAME_TO_ICON.put("5g_plus", NR_5G_PLUS);
298 ICON_NAME_TO_ICON.put("datadisable", DATA_DISABLED);
Fabian Kozynskic7bc84b2019-03-11 13:57:31 -0400299 ICON_NAME_TO_ICON.put("notdefaultdata", NOT_DEFAULT_DATA);
Pengquan Menga62d32b2018-12-06 17:38:38 -0800300 }
Joe Onoratofd52b182010-11-10 18:00:52 -0800301}
302