Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 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; |
Jason Monk | da68f59 | 2015-01-07 10:55:58 -0500 | [diff] [blame] | 20 | import com.android.systemui.statusbar.policy.MobileSignalController.MobileIconGroup; |
Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 21 | |
| 22 | class TelephonyIcons { |
Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 23 | //***** Data connection icons |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 24 | static final int FLIGHT_MODE_ICON = R.drawable.stat_sys_airplane_mode; |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 25 | |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 26 | static final int ICON_LTE = R.drawable.ic_lte_mobiledata; |
| 27 | static final int ICON_LTE_PLUS = R.drawable.ic_lte_plus_mobiledata; |
| 28 | static final int ICON_G = R.drawable.ic_g_mobiledata; |
| 29 | static final int ICON_E = R.drawable.ic_e_mobiledata; |
| 30 | static final int ICON_H = R.drawable.ic_h_mobiledata; |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 31 | static final int ICON_H_PLUS = R.drawable.ic_h_plus_mobiledata; |
| 32 | static final int ICON_3G = R.drawable.ic_3g_mobiledata; |
| 33 | static final int ICON_4G = R.drawable.ic_4g_mobiledata; |
| 34 | static final int ICON_4G_PLUS = R.drawable.ic_4g_plus_mobiledata; |
| 35 | static final int ICON_1X = R.drawable.ic_1x_mobiledata; |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 36 | |
Andrew Flynn | a478d70 | 2015-04-14 23:33:45 -0400 | [diff] [blame] | 37 | static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup( |
| 38 | "CARRIER_NETWORK_CHANGE", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 39 | null, |
| 40 | null, |
Andrew Flynn | a478d70 | 2015-04-14 23:33:45 -0400 | [diff] [blame] | 41 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 42 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 43 | 0, |
| 44 | 0, |
Andrew Flynn | a478d70 | 2015-04-14 23:33:45 -0400 | [diff] [blame] | 45 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 46 | R.string.carrier_network_change_mode, |
Andrew Flynn | a478d70 | 2015-04-14 23:33:45 -0400 | [diff] [blame] | 47 | 0, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 48 | false); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 49 | |
| 50 | static final MobileIconGroup THREE_G = new MobileIconGroup( |
| 51 | "3G", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 52 | null, |
| 53 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 54 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 55 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 56 | 0, |
| 57 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 58 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 59 | R.string.data_connection_3g, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 60 | TelephonyIcons.ICON_3G, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 61 | true); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 62 | |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 63 | static final MobileIconGroup WFC = new MobileIconGroup( |
| 64 | "WFC", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 65 | null, |
| 66 | null, |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 67 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 68 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 69 | 0, |
| 70 | 0, |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 71 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 72 | 0, 0, false); |
Jason Monk | 7150d7f | 2015-07-09 10:14:12 -0400 | [diff] [blame] | 73 | |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 74 | static final MobileIconGroup UNKNOWN = new MobileIconGroup( |
| 75 | "Unknown", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 76 | null, |
| 77 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 78 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 79 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 80 | 0, |
| 81 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 82 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 83 | 0, 0, false); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 84 | |
| 85 | static final MobileIconGroup E = new MobileIconGroup( |
| 86 | "E", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 87 | null, |
| 88 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 89 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 90 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 91 | 0, |
| 92 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 93 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 94 | R.string.data_connection_edge, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 95 | TelephonyIcons.ICON_E, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 96 | false); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 97 | |
| 98 | static final MobileIconGroup ONE_X = new MobileIconGroup( |
| 99 | "1X", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 100 | null, |
| 101 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 102 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 103 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 104 | 0, |
| 105 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 106 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 107 | R.string.data_connection_cdma, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 108 | TelephonyIcons.ICON_1X, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 109 | true); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 110 | |
| 111 | static final MobileIconGroup G = new MobileIconGroup( |
| 112 | "G", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 113 | null, |
| 114 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 115 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 116 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 117 | 0, |
| 118 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 119 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 120 | R.string.data_connection_gprs, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 121 | TelephonyIcons.ICON_G, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 122 | false); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 123 | |
| 124 | static final MobileIconGroup H = new MobileIconGroup( |
| 125 | "H", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 126 | null, |
| 127 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 128 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 129 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 130 | 0, |
| 131 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 132 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 133 | R.string.data_connection_3_5g, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 134 | TelephonyIcons.ICON_H, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 135 | false); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 136 | |
Amin Shaikh | f5830ca | 2018-03-09 14:06:50 -0500 | [diff] [blame] | 137 | static final MobileIconGroup H_PLUS = new MobileIconGroup( |
| 138 | "H+", |
| 139 | null, |
| 140 | null, |
| 141 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 142 | 0, 0, |
| 143 | 0, |
| 144 | 0, |
| 145 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
| 146 | R.string.data_connection_3_5g_plus, |
| 147 | TelephonyIcons.ICON_H_PLUS, |
| 148 | false); |
| 149 | |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 150 | static final MobileIconGroup FOUR_G = new MobileIconGroup( |
| 151 | "4G", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 152 | null, |
| 153 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 154 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 155 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 156 | 0, |
| 157 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 158 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 159 | R.string.data_connection_4g, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 160 | TelephonyIcons.ICON_4G, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 161 | true); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 162 | |
Ajay Nambi | 7965fa4 | 2015-05-14 18:48:33 -0700 | [diff] [blame] | 163 | static final MobileIconGroup FOUR_G_PLUS = new MobileIconGroup( |
| 164 | "4G+", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 165 | null, |
| 166 | null, |
Ajay Nambi | 7965fa4 | 2015-05-14 18:48:33 -0700 | [diff] [blame] | 167 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 168 | 0,0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 169 | 0, |
| 170 | 0, |
Ajay Nambi | 7965fa4 | 2015-05-14 18:48:33 -0700 | [diff] [blame] | 171 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 172 | R.string.data_connection_4g_plus, |
Ajay Nambi | 7965fa4 | 2015-05-14 18:48:33 -0700 | [diff] [blame] | 173 | TelephonyIcons.ICON_4G_PLUS, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 174 | true); |
Ajay Nambi | 7965fa4 | 2015-05-14 18:48:33 -0700 | [diff] [blame] | 175 | |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 176 | static final MobileIconGroup LTE = new MobileIconGroup( |
| 177 | "LTE", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 178 | null, |
| 179 | null, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 180 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 181 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 182 | 0, |
| 183 | 0, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 184 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 185 | R.string.data_connection_lte, |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 186 | TelephonyIcons.ICON_LTE, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 187 | true); |
Jason Monk | d2263cd | 2014-11-10 14:22:56 -0500 | [diff] [blame] | 188 | |
Jason Monk | aa730be | 2016-07-13 14:22:52 -0400 | [diff] [blame] | 189 | static final MobileIconGroup LTE_PLUS = new MobileIconGroup( |
| 190 | "LTE+", |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 191 | null, |
| 192 | null, |
Jason Monk | aa730be | 2016-07-13 14:22:52 -0400 | [diff] [blame] | 193 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 194 | 0, 0, |
Jason Monk | 48edc0c | 2017-04-10 15:01:27 -0400 | [diff] [blame] | 195 | 0, |
| 196 | 0, |
Jason Monk | aa730be | 2016-07-13 14:22:52 -0400 | [diff] [blame] | 197 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Amin Shaikh | 43ad7fe | 2018-03-05 14:34:44 -0500 | [diff] [blame] | 198 | R.string.data_connection_lte_plus, |
Jason Monk | aa730be | 2016-07-13 14:22:52 -0400 | [diff] [blame] | 199 | TelephonyIcons.ICON_LTE_PLUS, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 200 | true); |
Jason Monk | 7e6c83c | 2017-04-26 14:35:24 -0400 | [diff] [blame] | 201 | |
| 202 | static final MobileIconGroup DATA_DISABLED = new MobileIconGroup( |
| 203 | "DataDisabled", |
| 204 | null, |
| 205 | null, |
| 206 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, |
| 207 | 0, 0, |
| 208 | 0, |
| 209 | 0, |
| 210 | AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], |
Rohan Shah | 7bc3744 | 2018-04-10 00:34:50 -0400 | [diff] [blame] | 211 | R.string.cell_data_off_content_description, |
Amin Shaikh | af4c193 | 2018-03-08 10:29:56 -0500 | [diff] [blame] | 212 | 0, |
Amin Shaikh | d64e626 | 2018-03-08 10:08:13 -0500 | [diff] [blame] | 213 | false); |
Joe Onorato | fd52b18 | 2010-11-10 18:00:52 -0800 | [diff] [blame] | 214 | } |
| 215 | |