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 // LTE branded "LTE" 186 static final int[][] DATA_LTE = { 187 { R.drawable.stat_sys_data_fully_connected_lte, 188 R.drawable.stat_sys_data_fully_connected_lte, 189 R.drawable.stat_sys_data_fully_connected_lte, 190 R.drawable.stat_sys_data_fully_connected_lte }, 191 { R.drawable.stat_sys_data_fully_connected_lte, 192 R.drawable.stat_sys_data_fully_connected_lte, 193 R.drawable.stat_sys_data_fully_connected_lte, 194 R.drawable.stat_sys_data_fully_connected_lte } 195 }; 196 197 static final int QS_DATA_LTE = R.drawable.ic_qs_signal_lte; 198 199 static final int FLIGHT_MODE_ICON = R.drawable.stat_sys_airplane_mode; 200 static final int ROAMING_ICON = R.drawable.stat_sys_data_fully_connected_roam; 201 static final int ICON_LTE = R.drawable.stat_sys_data_fully_connected_lte; 202 static final int ICON_G = R.drawable.stat_sys_data_fully_connected_g; 203 static final int ICON_E = R.drawable.stat_sys_data_fully_connected_e; 204 static final int ICON_H = R.drawable.stat_sys_data_fully_connected_h; 205 static final int ICON_3G = R.drawable.stat_sys_data_fully_connected_3g; 206 static final int ICON_4G = R.drawable.stat_sys_data_fully_connected_4g; 207 static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x; 208 static final int ICON_CARRIER_NETWORK_CHANGE = 209 R.drawable.stat_sys_signal_carrier_network_change_animation; 210 211 static final int QS_ICON_LTE = R.drawable.ic_qs_signal_lte; 212 static final int QS_ICON_3G = R.drawable.ic_qs_signal_3g; 213 static final int QS_ICON_4G = R.drawable.ic_qs_signal_4g; 214 static final int QS_ICON_1X = R.drawable.ic_qs_signal_1x; 215 static final int QS_ICON_CARRIER_NETWORK_CHANGE = 216 R.drawable.ic_qs_signal_carrier_network_change_animation; 217 218 static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup( 219 "CARRIER_NETWORK_CHANGE", 220 TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE, 221 TelephonyIcons.QS_TELEPHONY_CARRIER_NETWORK_CHANGE, 222 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 223 0, 0, 224 TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE, 225 TelephonyIcons.QS_ICON_CARRIER_NETWORK_CHANGE, 226 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 227 R.string.accessibility_carrier_network_change_mode, 228 0, 229 false, 230 0 231 ); 232 233 static final MobileIconGroup THREE_G = new MobileIconGroup( 234 "3G", 235 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 236 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 237 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 238 0, 0, 239 TelephonyIcons.TELEPHONY_NO_NETWORK, 240 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 241 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 242 R.string.accessibility_data_connection_3g, 243 TelephonyIcons.ICON_3G, 244 true, 245 TelephonyIcons.QS_DATA_3G 246 ); 247 248 static final MobileIconGroup WFC = new MobileIconGroup( 249 "WFC", 250 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 251 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 252 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 253 0, 0, 254 TelephonyIcons.TELEPHONY_NO_NETWORK, 255 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 256 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 257 0, 0, false, 0 258 ); 259 260 static final MobileIconGroup UNKNOWN = new MobileIconGroup( 261 "Unknown", 262 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 263 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 264 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 265 0, 0, 266 TelephonyIcons.TELEPHONY_NO_NETWORK, 267 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 268 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 269 0, 0, false, 0 270 ); 271 272 static final MobileIconGroup E = new MobileIconGroup( 273 "E", 274 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 275 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 276 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 277 0, 0, 278 TelephonyIcons.TELEPHONY_NO_NETWORK, 279 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 280 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 281 R.string.accessibility_data_connection_edge, 282 TelephonyIcons.ICON_E, 283 false, 284 TelephonyIcons.QS_DATA_E 285 ); 286 287 static final MobileIconGroup ONE_X = new MobileIconGroup( 288 "1X", 289 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 290 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 291 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 292 0, 0, 293 TelephonyIcons.TELEPHONY_NO_NETWORK, 294 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 295 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 296 R.string.accessibility_data_connection_cdma, 297 TelephonyIcons.ICON_1X, 298 true, 299 TelephonyIcons.QS_DATA_1X 300 ); 301 302 static final MobileIconGroup G = new MobileIconGroup( 303 "G", 304 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 305 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 306 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 307 0, 0, 308 TelephonyIcons.TELEPHONY_NO_NETWORK, 309 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 310 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 311 R.string.accessibility_data_connection_gprs, 312 TelephonyIcons.ICON_G, 313 false, 314 TelephonyIcons.QS_DATA_G 315 ); 316 317 static final MobileIconGroup H = new MobileIconGroup( 318 "H", 319 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 320 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 321 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 322 0, 0, 323 TelephonyIcons.TELEPHONY_NO_NETWORK, 324 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 325 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 326 R.string.accessibility_data_connection_3_5g, 327 TelephonyIcons.ICON_H, 328 false, 329 TelephonyIcons.QS_DATA_H 330 ); 331 332 static final MobileIconGroup FOUR_G = new MobileIconGroup( 333 "4G", 334 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 335 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 336 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 337 0, 0, 338 TelephonyIcons.TELEPHONY_NO_NETWORK, 339 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 340 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 341 R.string.accessibility_data_connection_4g, 342 TelephonyIcons.ICON_4G, 343 true, 344 TelephonyIcons.QS_DATA_4G 345 ); 346 347 static final MobileIconGroup LTE = new MobileIconGroup( 348 "LTE", 349 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH, 350 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 351 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 352 0, 0, 353 TelephonyIcons.TELEPHONY_NO_NETWORK, 354 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 355 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 356 R.string.accessibility_data_connection_lte, 357 TelephonyIcons.ICON_LTE, 358 true, 359 TelephonyIcons.QS_DATA_LTE 360 ); 361 362 static final MobileIconGroup ROAMING = new MobileIconGroup( 363 "Roaming", 364 TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING, 365 TelephonyIcons.QS_TELEPHONY_SIGNAL_STRENGTH, 366 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 367 0, 0, 368 TelephonyIcons.TELEPHONY_NO_NETWORK, 369 TelephonyIcons.QS_TELEPHONY_NO_NETWORK, 370 AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], 371 R.string.accessibility_data_connection_roaming, 372 TelephonyIcons.ROAMING_ICON, 373 false, 374 TelephonyIcons.QS_DATA_R 375 ); 376 } 377 378