1 /* 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 17 package com.android.systemui.statusbar.policy; 18 19 import com.android.systemui.R; 20 import com.android.systemui.statusbar.policy.MobileSignalController.MobileIconGroup; 21 22 class TelephonyIcons { 23 //***** Signal strength icons 24 25 static final int TELEPHONY_NUM_LEVELS = 5; 26 27 //GSM/UMTS 28 static final int TELEPHONY_NO_NETWORK = R.drawable.stat_sys_signal_null; 29 30 static final int[][] TELEPHONY_SIGNAL_STRENGTH = { 31 { R.drawable.stat_sys_signal_0, 32 R.drawable.stat_sys_signal_1, 33 R.drawable.stat_sys_signal_2, 34 R.drawable.stat_sys_signal_3, 35 R.drawable.stat_sys_signal_4 }, 36 { R.drawable.stat_sys_signal_0_fully, 37 R.drawable.stat_sys_signal_1_fully, 38 R.drawable.stat_sys_signal_2_fully, 39 R.drawable.stat_sys_signal_3_fully, 40 R.drawable.stat_sys_signal_4_fully } 41 }; 42 43 static final int QS_TELEPHONY_NO_NETWORK = R.drawable.ic_qs_signal_no_signal; 44 45 static final int[][] QS_TELEPHONY_SIGNAL_STRENGTH = { 46 { R.drawable.ic_qs_signal_0, 47 R.drawable.ic_qs_signal_1, 48 R.drawable.ic_qs_signal_2, 49 R.drawable.ic_qs_signal_3, 50 R.drawable.ic_qs_signal_4 }, 51 { R.drawable.ic_qs_signal_full_0, 52 R.drawable.ic_qs_signal_full_1, 53 R.drawable.ic_qs_signal_full_2, 54 R.drawable.ic_qs_signal_full_3, 55 R.drawable.ic_qs_signal_full_4 } 56 }; 57 58 static final int[][] TELEPHONY_SIGNAL_STRENGTH_ROAMING = { 59 { R.drawable.stat_sys_signal_0, 60 R.drawable.stat_sys_signal_1, 61 R.drawable.stat_sys_signal_2, 62 R.drawable.stat_sys_signal_3, 63 R.drawable.stat_sys_signal_4 }, 64 { R.drawable.stat_sys_signal_0_fully, 65 R.drawable.stat_sys_signal_1_fully, 66 R.drawable.stat_sys_signal_2_fully, 67 R.drawable.stat_sys_signal_3_fully, 68 R.drawable.stat_sys_signal_4_fully } 69 }; 70 71 //CarrierNetworkChange 72 static final int[][] TELEPHONY_CARRIER_NETWORK_CHANGE = { 73 { R.drawable.stat_sys_signal_carrier_network_change_animation, 74 R.drawable.stat_sys_signal_carrier_network_change_animation, 75 R.drawable.stat_sys_signal_carrier_network_change_animation, 76 R.drawable.stat_sys_signal_carrier_network_change_animation, 77 R.drawable.stat_sys_signal_carrier_network_change_animation }, 78 { R.drawable.stat_sys_signal_carrier_network_change_animation, 79 R.drawable.stat_sys_signal_carrier_network_change_animation, 80 R.drawable.stat_sys_signal_carrier_network_change_animation, 81 R.drawable.stat_sys_signal_carrier_network_change_animation, 82 R.drawable.stat_sys_signal_carrier_network_change_animation } 83 }; 84 85 static final int[][] QS_TELEPHONY_CARRIER_NETWORK_CHANGE = { 86 { R.drawable.ic_qs_signal_carrier_network_change_animation, 87 R.drawable.ic_qs_signal_carrier_network_change_animation, 88 R.drawable.ic_qs_signal_carrier_network_change_animation, 89 R.drawable.ic_qs_signal_carrier_network_change_animation, 90 R.drawable.ic_qs_signal_carrier_network_change_animation }, 91 { R.drawable.ic_qs_signal_carrier_network_change_animation, 92 R.drawable.ic_qs_signal_carrier_network_change_animation, 93 R.drawable.ic_qs_signal_carrier_network_change_animation, 94 R.drawable.ic_qs_signal_carrier_network_change_animation, 95 R.drawable.ic_qs_signal_carrier_network_change_animation } 96 }; 97 98 static final int QS_DATA_R = R.drawable.ic_qs_signal_r; 99 100 //***** Data connection icons 101 102 //GSM/UMTS 103 static final int[][] DATA_G = { 104 { R.drawable.stat_sys_data_fully_connected_g, 105 R.drawable.stat_sys_data_fully_connected_g, 106 R.drawable.stat_sys_data_fully_connected_g, 107 R.drawable.stat_sys_data_fully_connected_g }, 108 { R.drawable.stat_sys_data_fully_connected_g, 109 R.drawable.stat_sys_data_fully_connected_g, 110 R.drawable.stat_sys_data_fully_connected_g, 111 R.drawable.stat_sys_data_fully_connected_g } 112 }; 113 114 static final int QS_DATA_G = R.drawable.ic_qs_signal_g; 115 116 static final int[][] DATA_3G = { 117 { R.drawable.stat_sys_data_fully_connected_3g, 118 R.drawable.stat_sys_data_fully_connected_3g, 119 R.drawable.stat_sys_data_fully_connected_3g, 120 R.drawable.stat_sys_data_fully_connected_3g }, 121 { R.drawable.stat_sys_data_fully_connected_3g, 122 R.drawable.stat_sys_data_fully_connected_3g, 123 R.drawable.stat_sys_data_fully_connected_3g, 124 R.drawable.stat_sys_data_fully_connected_3g } 125 }; 126 127 static final int QS_DATA_3G = R.drawable.ic_qs_signal_3g; 128 129 static final int[][] DATA_E = { 130 { R.drawable.stat_sys_data_fully_connected_e, 131 R.drawable.stat_sys_data_fully_connected_e, 132 R.drawable.stat_sys_data_fully_connected_e, 133 R.drawable.stat_sys_data_fully_connected_e }, 134 { R.drawable.stat_sys_data_fully_connected_e, 135 R.drawable.stat_sys_data_fully_connected_e, 136 R.drawable.stat_sys_data_fully_connected_e, 137 R.drawable.stat_sys_data_fully_connected_e } 138 }; 139 140 static final int QS_DATA_E = R.drawable.ic_qs_signal_e; 141 142 //3.5G 143 static final int[][] DATA_H = { 144 { R.drawable.stat_sys_data_fully_connected_h, 145 R.drawable.stat_sys_data_fully_connected_h, 146 R.drawable.stat_sys_data_fully_connected_h, 147 R.drawable.stat_sys_data_fully_connected_h }, 148 { R.drawable.stat_sys_data_fully_connected_h, 149 R.drawable.stat_sys_data_fully_connected_h, 150 R.drawable.stat_sys_data_fully_connected_h, 151 R.drawable.stat_sys_data_fully_connected_h } 152 }; 153 154 static final int QS_DATA_H = R.drawable.ic_qs_signal_h; 155 156 //CDMA 157 // Use 3G icons for EVDO data and 1x icons for 1XRTT data 158 static final int[][] DATA_1X = { 159 { R.drawable.stat_sys_data_fully_connected_1x, 160 R.drawable.stat_sys_data_fully_connected_1x, 161 R.drawable.stat_sys_data_fully_connected_1x, 162 R.drawable.stat_sys_data_fully_connected_1x }, 163 { R.drawable.stat_sys_data_fully_connected_1x, 164 R.drawable.stat_sys_data_fully_connected_1x, 165 R.drawable.stat_sys_data_fully_connected_1x, 166 R.drawable.stat_sys_data_fully_connected_1x } 167 }; 168 169 static final int QS_DATA_1X = R.drawable.ic_qs_signal_1x; 170 171 // LTE and eHRPD 172 static final int[][] DATA_4G = { 173 { R.drawable.stat_sys_data_fully_connected_4g, 174 R.drawable.stat_sys_data_fully_connected_4g, 175 R.drawable.stat_sys_data_fully_connected_4g, 176 R.drawable.stat_sys_data_fully_connected_4g }, 177 { R.drawable.stat_sys_data_fully_connected_4g, 178 R.drawable.stat_sys_data_fully_connected_4g, 179 R.drawable.stat_sys_data_fully_connected_4g, 180 R.drawable.stat_sys_data_fully_connected_4g } 181 }; 182 183 static final int QS_DATA_4G = R.drawable.ic_qs_signal_4g; 184 185 static final int[][] DATA_4G_PLUS = { 186 { R.drawable.stat_sys_data_fully_connected_4g_plus, 187 R.drawable.stat_sys_data_fully_connected_4g_plus, 188 R.drawable.stat_sys_data_fully_connected_4g_plus, 189 R.drawable.stat_sys_data_fully_connected_4g_plus }, 190 { R.drawable.stat_sys_data_fully_connected_4g_plus, 191 R.drawable.stat_sys_data_fully_connected_4g_plus, 192 R.drawable.stat_sys_data_fully_connected_4g_plus, 193 R.drawable.stat_sys_data_fully_connected_4g_plus } 194 }; 195 196 static final int QS_DATA_4G_PLUS = R.drawable.ic_qs_signal_4g_plus; 197 198 // LTE branded "LTE" 199 static final int[][] DATA_LTE = { 200 { R.drawable.stat_sys_data_fully_connected_lte, 201 R.drawable.stat_sys_data_fully_connected_lte, 202 R.drawable.stat_sys_data_fully_connected_lte, 203 R.drawable.stat_sys_data_fully_connected_lte }, 204 { R.drawable.stat_sys_data_fully_connected_lte, 205 R.drawable.stat_sys_data_fully_connected_lte, 206 R.drawable.stat_sys_data_fully_connected_lte, 207 R.drawable.stat_sys_data_fully_connected_lte } 208 }; 209 210 static final int QS_DATA_LTE = R.drawable.ic_qs_signal_lte; 211 static final int QS_DATA_LTE_PLUS = R.drawable.ic_qs_signal_lte_plus; 212 213 static final int FLIGHT_MODE_ICON = R.drawable.stat_sys_airplane_mode; 214 static final int ROAMING_ICON = R.drawable.stat_sys_data_fully_connected_roam; 215 static final int ICON_LTE = R.drawable.stat_sys_data_fully_connected_lte; 216 static final int ICON_LTE_PLUS = R.drawable.stat_sys_data_fully_connected_lte_plus; 217 static final int ICON_G = R.drawable.stat_sys_data_fully_connected_g; 218 static final int ICON_E = R.drawable.stat_sys_data_fully_connected_e; 219 static final int ICON_H = R.drawable.stat_sys_data_fully_connected_h; 220 static final int ICON_3G = R.drawable.stat_sys_data_fully_connected_3g; 221 static final int ICON_4G = R.drawable.stat_sys_data_fully_connected_4g; 222 static final int ICON_4G_PLUS = R.drawable.stat_sys_data_fully_connected_4g_plus; 223 static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x; 224 static final int ICON_CARRIER_NETWORK_CHANGE = 225 R.drawable.stat_sys_signal_carrier_network_change_animation; 226 227 static final int ICON_DATA_DISABLED = R.drawable.stat_sys_data_disabled; 228 229 static final int QS_ICON_LTE = R.drawable.ic_qs_signal_lte; 230 static final int QS_ICON_3G = R.drawable.ic_qs_signal_3g; 231 static final int QS_ICON_4G = R.drawable.ic_qs_signal_4g; 232 static final int QS_ICON_4G_PLUS = R.drawable.ic_qs_signal_4g_plus; 233 static final int QS_ICON_1X = R.drawable.ic_qs_signal_1x; 234 static final int QS_ICON_CARRIER_NETWORK_CHANGE = 235 R.drawable.ic_qs_signal_carrier_network_change_animation; 236 237 static final int QS_ICON_DATA_DISABLED = R.drawable.ic_qs_data_disabled; 238 239 static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup( 240 "CARRIER_NETWORK_CHANGE", 241 TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE, 242 TelephonyIcons.QS_TELEPHONY_CARRIER_NETWORK_CHANGE, 243 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 244 0, 0, 245 TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE, 246 TelephonyIcons.QS_ICON_CARRIER_NETWORK_CHANGE, 247 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 248 R.string.accessibility_carrier_network_change_mode, 249 0, 250 false, 251 0 252 ); 253 254 static final MobileIconGroup THREE_G = new MobileIconGroup( 255 "3G", 256 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 257 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 258 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 259 0, 0, 260 TelephonyIcons.TELEPHONY_NO_NETWORK, 261 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 262 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 263 R.string.accessibility_data_connection_3g, 264 TelephonyIcons.ICON_3G, 265 true, 266 TelephonyIcons.QS_DATA_3G 267 ); 268 269 static final MobileIconGroup WFC = new MobileIconGroup( 270 "WFC", 271 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 272 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 273 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 274 0, 0, 275 TelephonyIcons.TELEPHONY_NO_NETWORK, 276 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 277 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 278 0, 0, false, 0 279 ); 280 281 static final MobileIconGroup UNKNOWN = new MobileIconGroup( 282 "Unknown", 283 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 284 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 285 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 286 0, 0, 287 TelephonyIcons.TELEPHONY_NO_NETWORK, 288 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 289 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 290 0, 0, false, 0 291 ); 292 293 static final MobileIconGroup E = new MobileIconGroup( 294 "E", 295 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 296 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 297 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 298 0, 0, 299 TelephonyIcons.TELEPHONY_NO_NETWORK, 300 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 301 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 302 R.string.accessibility_data_connection_edge, 303 TelephonyIcons.ICON_E, 304 false, 305 TelephonyIcons.QS_DATA_E 306 ); 307 308 static final MobileIconGroup ONE_X = new MobileIconGroup( 309 "1X", 310 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 311 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 312 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 313 0, 0, 314 TelephonyIcons.TELEPHONY_NO_NETWORK, 315 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 316 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 317 R.string.accessibility_data_connection_cdma, 318 TelephonyIcons.ICON_1X, 319 true, 320 TelephonyIcons.QS_DATA_1X 321 ); 322 323 static final MobileIconGroup G = new MobileIconGroup( 324 "G", 325 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 326 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 327 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 328 0, 0, 329 TelephonyIcons.TELEPHONY_NO_NETWORK, 330 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 331 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 332 R.string.accessibility_data_connection_gprs, 333 TelephonyIcons.ICON_G, 334 false, 335 TelephonyIcons.QS_DATA_G 336 ); 337 338 static final MobileIconGroup H = new MobileIconGroup( 339 "H", 340 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 341 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 342 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 343 0, 0, 344 TelephonyIcons.TELEPHONY_NO_NETWORK, 345 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 346 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 347 R.string.accessibility_data_connection_3_5g, 348 TelephonyIcons.ICON_H, 349 false, 350 TelephonyIcons.QS_DATA_H 351 ); 352 353 static final MobileIconGroup FOUR_G = new MobileIconGroup( 354 "4G", 355 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 356 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 357 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 358 0, 0, 359 TelephonyIcons.TELEPHONY_NO_NETWORK, 360 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 361 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 362 R.string.accessibility_data_connection_4g, 363 TelephonyIcons.ICON_4G, 364 true, 365 TelephonyIcons.QS_DATA_4G 366 ); 367 368 static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup( 369 "4G+", 370 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 371 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 372 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 373 0,0, 374 TelephonyIcons.TELEPHONY_NO_NETWORK, 375 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 376 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 377 R.string.accessibility_data_connection_4g_plus, 378 TelephonyIcons.ICON_4G_PLUS, 379 true, 380 TelephonyIcons.QS_DATA_4G_PLUS 381 ); 382 383 static final MobileIconGroup LTE = new MobileIconGroup( 384 "LTE", 385 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 386 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 387 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 388 0, 0, 389 TelephonyIcons.TELEPHONY_NO_NETWORK, 390 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 391 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 392 R.string.accessibility_data_connection_lte, 393 TelephonyIcons.ICON_LTE, 394 true, 395 TelephonyIcons.QS_DATA_LTE 396 ); 397 398 static final MobileIconGroup LTE_PLUS = new MobileIconGroup( 399 "LTE+", 400 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 401 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 402 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 403 0, 0, 404 TelephonyIcons.TELEPHONY_NO_NETWORK, 405 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 406 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 407 R.string.accessibility_data_connection_lte_plus, 408 TelephonyIcons.ICON_LTE_PLUS, 409 true, 410 TelephonyIcons.QS_DATA_LTE_PLUS 411 ); 412 413 static final MobileIconGroup ROAMING = new MobileIconGroup( 414 "Roaming", 415 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING, 416 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 417 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 418 0, 0, 419 TelephonyIcons.TELEPHONY_NO_NETWORK, 420 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 421 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 422 R.string.accessibility_data_connection_roaming, 423 TelephonyIcons.ROAMING_ICON, 424 false, 425 TelephonyIcons.QS_DATA_R 426 ); 427 428 static final MobileIconGroup DATA_DISABLED = new MobileIconGroup( 429 "DataDisabled", 430 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 431 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 432 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 433 0, 0, 434 TelephonyIcons.TELEPHONY_NO_NETWORK, 435 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 436 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 437 R.string.accessibility_cell_data_off, 438 TelephonyIcons.ICON_DATA_DISABLED, 439 false, 440 TelephonyIcons.QS_ICON_DATA_DISABLED 441 ); 442 } 443 444