John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 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.qs; |
| 18 | |
Sudheer Shanka | b6fc931 | 2016-01-27 19:59:03 +0000 | [diff] [blame] | 19 | import android.app.ActivityManager; |
Adrian Roos | 62692b2 | 2015-09-11 17:46:23 -0700 | [diff] [blame] | 20 | import android.app.PendingIntent; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 21 | import android.content.Context; |
| 22 | import android.content.Intent; |
John Spurlock | 444eb2e | 2014-05-14 13:32:14 -0400 | [diff] [blame] | 23 | import android.graphics.drawable.Drawable; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 24 | import android.os.Handler; |
| 25 | import android.os.Looper; |
| 26 | import android.os.Message; |
Sudheer Shanka | 1c15e01 | 2016-03-29 21:12:08 -0700 | [diff] [blame] | 27 | import android.os.UserHandle; |
| 28 | import android.os.UserManager; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 29 | import android.util.Log; |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 30 | import android.util.SparseArray; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 31 | import android.view.View; |
| 32 | import android.view.ViewGroup; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 33 | |
Jason Monk | 96defbe | 2016-03-29 16:51:03 -0400 | [diff] [blame] | 34 | import com.android.internal.logging.MetricsLogger; |
| 35 | import com.android.internal.logging.MetricsProto.MetricsEvent; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 36 | import com.android.settingslib.RestrictedLockUtils; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 37 | import com.android.systemui.qs.QSTile.State; |
Jason Monk | 66c89c1 | 2016-01-06 08:51:26 -0500 | [diff] [blame] | 38 | import com.android.systemui.qs.external.TileServices; |
Jason Monk | c3f42c1 | 2016-02-05 12:33:13 -0500 | [diff] [blame] | 39 | import com.android.systemui.statusbar.phone.ManagedProfileController; |
Jason Monk | 66239fb | 2015-12-21 14:27:00 -0500 | [diff] [blame] | 40 | import com.android.systemui.statusbar.policy.BatteryController; |
| 41 | import com.android.systemui.statusbar.policy.BluetoothController; |
| 42 | import com.android.systemui.statusbar.policy.CastController; |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 43 | import com.android.systemui.statusbar.policy.NightModeController; |
Jason Monk | 66239fb | 2015-12-21 14:27:00 -0500 | [diff] [blame] | 44 | import com.android.systemui.statusbar.policy.FlashlightController; |
| 45 | import com.android.systemui.statusbar.policy.HotspotController; |
| 46 | import com.android.systemui.statusbar.policy.KeyguardMonitor; |
| 47 | import com.android.systemui.statusbar.policy.Listenable; |
| 48 | import com.android.systemui.statusbar.policy.LocationController; |
| 49 | import com.android.systemui.statusbar.policy.NetworkController; |
| 50 | import com.android.systemui.statusbar.policy.RotationLockController; |
| 51 | import com.android.systemui.statusbar.policy.UserInfoController; |
| 52 | import com.android.systemui.statusbar.policy.UserSwitcherController; |
| 53 | import com.android.systemui.statusbar.policy.ZenModeController; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 54 | |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 55 | import java.util.ArrayList; |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 56 | import java.util.Collection; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 57 | import java.util.Objects; |
| 58 | |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 59 | import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin; |
| 60 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 61 | /** |
| 62 | * Base quick-settings tile, extend this to create a new tile. |
| 63 | * |
| 64 | * State management done on a looper provided by the host. Tiles should update state in |
| 65 | * handleUpdateState. Callbacks affecting state should use refreshState to trigger another |
| 66 | * state update pass on tile looper. |
| 67 | */ |
John Spurlock | ccb6b9a | 2014-05-17 15:54:40 -0400 | [diff] [blame] | 68 | public abstract class QSTile<TState extends State> implements Listenable { |
Jason Monk | bbadff8 | 2015-11-06 15:47:26 -0500 | [diff] [blame] | 69 | protected final String TAG = "Tile." + getClass().getSimpleName(); |
| 70 | protected static final boolean DEBUG = Log.isLoggable("Tile", Log.DEBUG); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 71 | |
| 72 | protected final Host mHost; |
| 73 | protected final Context mContext; |
| 74 | protected final H mHandler; |
John Spurlock | 76c43b9 | 2014-05-13 21:10:51 -0400 | [diff] [blame] | 75 | protected final Handler mUiHandler = new Handler(Looper.getMainLooper()); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 76 | |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 77 | private final ArrayList<Callback> mCallbacks = new ArrayList<>(); |
Jason Monk | a758ba6 | 2015-07-14 12:29:28 -0400 | [diff] [blame] | 78 | protected TState mState = newTileState(); |
| 79 | private TState mTmpState = newTileState(); |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 80 | private boolean mAnnounceNextStateChange; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 81 | |
Jason Monk | bd6dbb0 | 2015-09-03 15:46:25 -0400 | [diff] [blame] | 82 | private String mTileSpec; |
| 83 | |
Jason Monk | 62b63a0 | 2016-02-02 15:15:31 -0500 | [diff] [blame] | 84 | public abstract TState newTileState(); |
Chris Wren | 9e7283f | 2015-05-08 17:23:47 -0400 | [diff] [blame] | 85 | abstract protected void handleClick(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 86 | abstract protected void handleUpdateState(TState state, Object arg); |
| 87 | |
Sudheer Shanka | 1c15e01 | 2016-03-29 21:12:08 -0700 | [diff] [blame] | 88 | private UserManager mUserManager; |
| 89 | |
Chris Wren | 457a21c | 2015-05-06 17:50:34 -0400 | [diff] [blame] | 90 | /** |
| 91 | * Declare the category of this tile. |
| 92 | * |
Chris Wren | f6e9228b | 2016-01-26 18:04:35 -0500 | [diff] [blame] | 93 | * Categories are defined in {@link com.android.internal.logging.MetricsProto.MetricsEvent} |
| 94 | * by editing frameworks/base/proto/src/metrics_constants.proto. |
Chris Wren | 457a21c | 2015-05-06 17:50:34 -0400 | [diff] [blame] | 95 | */ |
| 96 | abstract public int getMetricsCategory(); |
| 97 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 98 | protected QSTile(Host host) { |
| 99 | mHost = host; |
| 100 | mContext = host.getContext(); |
| 101 | mHandler = new H(host.getLooper()); |
Sudheer Shanka | 1c15e01 | 2016-03-29 21:12:08 -0700 | [diff] [blame] | 102 | mUserManager = UserManager.get(mContext); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 103 | } |
Jason Monk | bd6dbb0 | 2015-09-03 15:46:25 -0400 | [diff] [blame] | 104 | |
| 105 | public String getTileSpec() { |
| 106 | return mTileSpec; |
| 107 | } |
| 108 | |
| 109 | public void setTileSpec(String tileSpec) { |
| 110 | mTileSpec = tileSpec; |
| 111 | } |
| 112 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 113 | public Host getHost() { |
| 114 | return mHost; |
| 115 | } |
| 116 | |
Jason Monk | dc35dcb | 2015-12-04 16:36:15 -0500 | [diff] [blame] | 117 | public QSIconView createTileView(Context context) { |
| 118 | return new QSIconView(context); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 119 | } |
| 120 | |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 121 | public DetailAdapter getDetailAdapter() { |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 122 | return null; // optional |
| 123 | } |
| 124 | |
Jason Monk | c3f42c1 | 2016-02-05 12:33:13 -0500 | [diff] [blame] | 125 | /** |
| 126 | * Is a startup check whether this device currently supports this tile. |
| 127 | * Should not be used to conditionally hide tiles. Only checked on tile |
| 128 | * creation or whether should be shown in edit screen. |
| 129 | */ |
| 130 | public boolean isAvailable() { |
| 131 | return true; |
| 132 | } |
| 133 | |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 134 | public interface DetailAdapter { |
Jason Monk | c06fbb1 | 2016-01-08 14:12:18 -0500 | [diff] [blame] | 135 | CharSequence getTitle(); |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 136 | Boolean getToggleState(); |
| 137 | View createDetailView(Context context, View convertView, ViewGroup parent); |
| 138 | Intent getSettingsIntent(); |
| 139 | void setToggleState(boolean state); |
Chris Wren | 457a21c | 2015-05-06 17:50:34 -0400 | [diff] [blame] | 140 | int getMetricsCategory(); |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 141 | } |
| 142 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 143 | // safe to call from any thread |
| 144 | |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 145 | public void addCallback(Callback callback) { |
| 146 | mHandler.obtainMessage(H.ADD_CALLBACK, callback).sendToTarget(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 147 | } |
| 148 | |
Jason Monk | 9d02a43 | 2016-01-20 16:33:46 -0500 | [diff] [blame] | 149 | public void removeCallbacks() { |
| 150 | mHandler.sendEmptyMessage(H.REMOVE_CALLBACKS); |
| 151 | } |
| 152 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 153 | public void click() { |
| 154 | mHandler.sendEmptyMessage(H.CLICK); |
| 155 | } |
| 156 | |
| 157 | public void secondaryClick() { |
| 158 | mHandler.sendEmptyMessage(H.SECONDARY_CLICK); |
| 159 | } |
| 160 | |
John Spurlock | c247b8f | 2014-11-06 23:06:25 -0500 | [diff] [blame] | 161 | public void longClick() { |
| 162 | mHandler.sendEmptyMessage(H.LONG_CLICK); |
| 163 | } |
| 164 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 165 | public void showDetail(boolean show) { |
| 166 | mHandler.obtainMessage(H.SHOW_DETAIL, show ? 1 : 0, 0).sendToTarget(); |
| 167 | } |
| 168 | |
Jason Monk | 5db8a41 | 2015-10-21 15:16:23 -0700 | [diff] [blame] | 169 | public final void refreshState() { |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 170 | refreshState(null); |
| 171 | } |
| 172 | |
| 173 | protected final void refreshState(Object arg) { |
| 174 | mHandler.obtainMessage(H.REFRESH_STATE, arg).sendToTarget(); |
| 175 | } |
| 176 | |
Jason Monk | a758ba6 | 2015-07-14 12:29:28 -0400 | [diff] [blame] | 177 | public final void clearState() { |
| 178 | mHandler.sendEmptyMessage(H.CLEAR_STATE); |
| 179 | } |
| 180 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 181 | public void userSwitch(int newUserId) { |
Adrian Roos | 32d88e8 | 2014-09-24 17:08:22 +0200 | [diff] [blame] | 182 | mHandler.obtainMessage(H.USER_SWITCH, newUserId, 0).sendToTarget(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 183 | } |
| 184 | |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 185 | public void fireToggleStateChanged(boolean state) { |
| 186 | mHandler.obtainMessage(H.TOGGLE_STATE_CHANGED, state ? 1 : 0, 0).sendToTarget(); |
| 187 | } |
| 188 | |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 189 | public void fireScanStateChanged(boolean state) { |
| 190 | mHandler.obtainMessage(H.SCAN_STATE_CHANGED, state ? 1 : 0, 0).sendToTarget(); |
| 191 | } |
| 192 | |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 193 | public void destroy() { |
| 194 | mHandler.sendEmptyMessage(H.DESTROY); |
| 195 | } |
| 196 | |
| 197 | public TState getState() { |
| 198 | return mState; |
| 199 | } |
| 200 | |
Jason Monk | 0d6a1c4 | 2015-04-20 16:38:51 -0400 | [diff] [blame] | 201 | public void setDetailListening(boolean listening) { |
| 202 | // optional |
| 203 | } |
| 204 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 205 | // call only on tile worker looper |
| 206 | |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 207 | private void handleAddCallback(Callback callback) { |
| 208 | mCallbacks.add(callback); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 209 | handleRefreshState(null); |
| 210 | } |
| 211 | |
Jason Monk | 9d02a43 | 2016-01-20 16:33:46 -0500 | [diff] [blame] | 212 | private void handleRemoveCallbacks() { |
| 213 | mCallbacks.clear(); |
| 214 | } |
| 215 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 216 | protected void handleSecondaryClick() { |
Jason Monk | dc35dcb | 2015-12-04 16:36:15 -0500 | [diff] [blame] | 217 | // Default to normal click. |
| 218 | handleClick(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 219 | } |
| 220 | |
John Spurlock | c247b8f | 2014-11-06 23:06:25 -0500 | [diff] [blame] | 221 | protected void handleLongClick() { |
Jason Monk | 96defbe | 2016-03-29 16:51:03 -0400 | [diff] [blame] | 222 | MetricsLogger.action(mContext, MetricsEvent.ACTION_QS_LONG_PRESS, getTileSpec()); |
Jason Monk | 76c67aa | 2016-02-19 14:49:42 -0500 | [diff] [blame] | 223 | mHost.startActivityDismissingKeyguard(getLongClickIntent()); |
John Spurlock | c247b8f | 2014-11-06 23:06:25 -0500 | [diff] [blame] | 224 | } |
| 225 | |
Jason Monk | 76c67aa | 2016-02-19 14:49:42 -0500 | [diff] [blame] | 226 | public abstract Intent getLongClickIntent(); |
| 227 | |
Jason Monk | a758ba6 | 2015-07-14 12:29:28 -0400 | [diff] [blame] | 228 | protected void handleClearState() { |
| 229 | mTmpState = newTileState(); |
| 230 | mState = newTileState(); |
| 231 | } |
| 232 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 233 | protected void handleRefreshState(Object arg) { |
| 234 | handleUpdateState(mTmpState, arg); |
| 235 | final boolean changed = mTmpState.copyTo(mState); |
| 236 | if (changed) { |
| 237 | handleStateChanged(); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | private void handleStateChanged() { |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 242 | boolean delayAnnouncement = shouldAnnouncementBeDelayed(); |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 243 | if (mCallbacks.size() != 0) { |
| 244 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 245 | mCallbacks.get(i).onStateChanged(mState); |
| 246 | } |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 247 | if (mAnnounceNextStateChange && !delayAnnouncement) { |
| 248 | String announcement = composeChangeAnnouncement(); |
| 249 | if (announcement != null) { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 250 | mCallbacks.get(0).onAnnouncementRequested(announcement); |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 251 | } |
| 252 | } |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 253 | } |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 254 | mAnnounceNextStateChange = mAnnounceNextStateChange && delayAnnouncement; |
| 255 | } |
| 256 | |
| 257 | protected boolean shouldAnnouncementBeDelayed() { |
| 258 | return false; |
| 259 | } |
| 260 | |
| 261 | protected String composeChangeAnnouncement() { |
| 262 | return null; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | private void handleShowDetail(boolean show) { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 266 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 267 | mCallbacks.get(i).onShowDetail(show); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 268 | } |
| 269 | } |
| 270 | |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 271 | private void handleToggleStateChanged(boolean state) { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 272 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 273 | mCallbacks.get(i).onToggleStateChanged(state); |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 274 | } |
| 275 | } |
| 276 | |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 277 | private void handleScanStateChanged(boolean state) { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 278 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 279 | mCallbacks.get(i).onScanStateChanged(state); |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 283 | protected void handleUserSwitch(int newUserId) { |
| 284 | handleRefreshState(null); |
| 285 | } |
| 286 | |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 287 | protected void handleDestroy() { |
| 288 | setListening(false); |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 289 | mCallbacks.clear(); |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 290 | } |
| 291 | |
Sudheer Shanka | a8fbbb3 | 2016-02-11 17:17:57 +0000 | [diff] [blame] | 292 | protected void checkIfRestrictionEnforcedByAdminOnly(State state, String userRestriction) { |
Sudheer Shanka | 1c15e01 | 2016-03-29 21:12:08 -0700 | [diff] [blame] | 293 | UserHandle user = UserHandle.of(ActivityManager.getCurrentUser()); |
| 294 | if (mUserManager.hasUserRestriction(userRestriction, user) |
| 295 | && !mUserManager.hasBaseUserRestriction(userRestriction, user)) { |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 296 | state.disabledByPolicy = true; |
Sudheer Shanka | 1c15e01 | 2016-03-29 21:12:08 -0700 | [diff] [blame] | 297 | state.enforcedAdmin = EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 298 | } else { |
| 299 | state.disabledByPolicy = false; |
| 300 | state.enforcedAdmin = null; |
| 301 | } |
| 302 | } |
| 303 | |
Jason Monk | 39c98e6 | 2016-03-16 09:18:35 -0400 | [diff] [blame] | 304 | public abstract CharSequence getTileLabel(); |
| 305 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 306 | protected final class H extends Handler { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 307 | private static final int ADD_CALLBACK = 1; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 308 | private static final int CLICK = 2; |
| 309 | private static final int SECONDARY_CLICK = 3; |
John Spurlock | c247b8f | 2014-11-06 23:06:25 -0500 | [diff] [blame] | 310 | private static final int LONG_CLICK = 4; |
| 311 | private static final int REFRESH_STATE = 5; |
| 312 | private static final int SHOW_DETAIL = 6; |
| 313 | private static final int USER_SWITCH = 7; |
| 314 | private static final int TOGGLE_STATE_CHANGED = 8; |
| 315 | private static final int SCAN_STATE_CHANGED = 9; |
| 316 | private static final int DESTROY = 10; |
Jason Monk | a758ba6 | 2015-07-14 12:29:28 -0400 | [diff] [blame] | 317 | private static final int CLEAR_STATE = 11; |
Jason Monk | 9d02a43 | 2016-01-20 16:33:46 -0500 | [diff] [blame] | 318 | private static final int REMOVE_CALLBACKS = 12; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 319 | |
| 320 | private H(Looper looper) { |
| 321 | super(looper); |
| 322 | } |
| 323 | |
| 324 | @Override |
| 325 | public void handleMessage(Message msg) { |
| 326 | String name = null; |
| 327 | try { |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 328 | if (msg.what == ADD_CALLBACK) { |
| 329 | name = "handleAddCallback"; |
Jason Monk | 9d02a43 | 2016-01-20 16:33:46 -0500 | [diff] [blame] | 330 | handleAddCallback((QSTile.Callback) msg.obj); |
| 331 | } else if (msg.what == REMOVE_CALLBACKS) { |
| 332 | name = "handleRemoveCallbacks"; |
| 333 | handleRemoveCallbacks(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 334 | } else if (msg.what == CLICK) { |
| 335 | name = "handleClick"; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 336 | if (mState.disabledByPolicy) { |
| 337 | Intent intent = RestrictedLockUtils.getShowAdminSupportDetailsIntent( |
| 338 | mContext, mState.enforcedAdmin); |
| 339 | mHost.startActivityDismissingKeyguard(intent); |
| 340 | } else { |
| 341 | mAnnounceNextStateChange = true; |
| 342 | handleClick(); |
| 343 | } |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 344 | } else if (msg.what == SECONDARY_CLICK) { |
| 345 | name = "handleSecondaryClick"; |
| 346 | handleSecondaryClick(); |
John Spurlock | c247b8f | 2014-11-06 23:06:25 -0500 | [diff] [blame] | 347 | } else if (msg.what == LONG_CLICK) { |
| 348 | name = "handleLongClick"; |
| 349 | handleLongClick(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 350 | } else if (msg.what == REFRESH_STATE) { |
| 351 | name = "handleRefreshState"; |
| 352 | handleRefreshState(msg.obj); |
| 353 | } else if (msg.what == SHOW_DETAIL) { |
| 354 | name = "handleShowDetail"; |
| 355 | handleShowDetail(msg.arg1 != 0); |
| 356 | } else if (msg.what == USER_SWITCH) { |
| 357 | name = "handleUserSwitch"; |
| 358 | handleUserSwitch(msg.arg1); |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 359 | } else if (msg.what == TOGGLE_STATE_CHANGED) { |
| 360 | name = "handleToggleStateChanged"; |
| 361 | handleToggleStateChanged(msg.arg1 != 0); |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 362 | } else if (msg.what == SCAN_STATE_CHANGED) { |
| 363 | name = "handleScanStateChanged"; |
| 364 | handleScanStateChanged(msg.arg1 != 0); |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 365 | } else if (msg.what == DESTROY) { |
| 366 | name = "handleDestroy"; |
| 367 | handleDestroy(); |
Jason Monk | a758ba6 | 2015-07-14 12:29:28 -0400 | [diff] [blame] | 368 | } else if (msg.what == CLEAR_STATE) { |
| 369 | name = "handleClearState"; |
| 370 | handleClearState(); |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 371 | } else { |
| 372 | throw new IllegalArgumentException("Unknown msg: " + msg.what); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 373 | } |
| 374 | } catch (Throwable t) { |
| 375 | final String error = "Error in " + name; |
| 376 | Log.w(TAG, error, t); |
| 377 | mHost.warn(error, t); |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | public interface Callback { |
| 383 | void onStateChanged(State state); |
| 384 | void onShowDetail(boolean show); |
John Spurlock | 7f8f22a | 2014-07-02 18:54:17 -0400 | [diff] [blame] | 385 | void onToggleStateChanged(boolean state); |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 386 | void onScanStateChanged(boolean state); |
Selim Cinek | 4fda7b2 | 2014-08-18 22:07:25 +0200 | [diff] [blame] | 387 | void onAnnouncementRequested(CharSequence announcement); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 388 | } |
| 389 | |
| 390 | public interface Host { |
Jason Monk | ee43cdf | 2015-06-19 14:20:46 -0400 | [diff] [blame] | 391 | void startActivityDismissingKeyguard(Intent intent); |
Adrian Roos | 62692b2 | 2015-09-11 17:46:23 -0700 | [diff] [blame] | 392 | void startActivityDismissingKeyguard(PendingIntent intent); |
Jason Monk | ba2318e | 2015-12-08 09:04:23 -0500 | [diff] [blame] | 393 | void startRunnableDismissingKeyguard(Runnable runnable); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 394 | void warn(String message, Throwable t); |
| 395 | void collapsePanels(); |
Jason Monk | ca894a0 | 2016-01-12 15:30:22 -0500 | [diff] [blame] | 396 | void animateExpandQS(); |
Jason Monk | ba2318e | 2015-12-08 09:04:23 -0500 | [diff] [blame] | 397 | void openPanels(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 398 | Looper getLooper(); |
| 399 | Context getContext(); |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 400 | Collection<QSTile<?>> getTiles(); |
Jason Monk | bbadff8 | 2015-11-06 15:47:26 -0500 | [diff] [blame] | 401 | void addCallback(Callback callback); |
Jason Monk | 46dbfb4 | 2016-02-25 14:59:20 -0500 | [diff] [blame] | 402 | void removeCallback(Callback callback); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 403 | BluetoothController getBluetoothController(); |
| 404 | LocationController getLocationController(); |
| 405 | RotationLockController getRotationLockController(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 406 | NetworkController getNetworkController(); |
| 407 | ZenModeController getZenModeController(); |
Jason Monk | 51e4dc0 | 2014-07-22 12:00:47 -0400 | [diff] [blame] | 408 | HotspotController getHotspotController(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 409 | CastController getCastController(); |
Adrian Roos | b83777b | 2014-06-30 15:11:53 +0200 | [diff] [blame] | 410 | FlashlightController getFlashlightController(); |
John Spurlock | 657c62c | 2014-07-22 12:18:09 -0400 | [diff] [blame] | 411 | KeyguardMonitor getKeyguardMonitor(); |
Jason Monk | abe1974 | 2015-09-29 09:47:06 -0400 | [diff] [blame] | 412 | UserSwitcherController getUserSwitcherController(); |
| 413 | UserInfoController getUserInfoController(); |
| 414 | BatteryController getBatteryController(); |
Jason Monk | 66c89c1 | 2016-01-06 08:51:26 -0500 | [diff] [blame] | 415 | TileServices getTileServices(); |
Jason Monk | 5dbd4aa | 2016-02-07 13:13:39 -0500 | [diff] [blame] | 416 | NightModeController getNightModeController(); |
Jason Monk | ba2318e | 2015-12-08 09:04:23 -0500 | [diff] [blame] | 417 | void removeTile(String tileSpec); |
Jason Monk | c3f42c1 | 2016-02-05 12:33:13 -0500 | [diff] [blame] | 418 | ManagedProfileController getManagedProfileController(); |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 419 | |
Jason Monk | 66c89c1 | 2016-01-06 08:51:26 -0500 | [diff] [blame] | 420 | |
John Spurlock | bceed06 | 2014-08-10 18:04:16 -0400 | [diff] [blame] | 421 | public interface Callback { |
| 422 | void onTilesChanged(); |
| 423 | } |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 424 | } |
| 425 | |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 426 | public static abstract class Icon { |
| 427 | abstract public Drawable getDrawable(Context context); |
| 428 | |
Jason Monk | 1aec93f | 2016-03-01 09:39:30 -0500 | [diff] [blame] | 429 | public Drawable getInvisibleDrawable(Context context) { |
| 430 | return getDrawable(context); |
| 431 | } |
| 432 | |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 433 | @Override |
| 434 | public int hashCode() { |
| 435 | return Icon.class.hashCode(); |
| 436 | } |
Jason Monk | b53b6c5 | 2016-02-24 17:25:49 -0500 | [diff] [blame] | 437 | |
| 438 | public int getPadding() { |
| 439 | return 0; |
| 440 | } |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 441 | } |
| 442 | |
Jason Monk | 5db8a41 | 2015-10-21 15:16:23 -0700 | [diff] [blame] | 443 | public static class DrawableIcon extends Icon { |
| 444 | protected final Drawable mDrawable; |
| 445 | |
| 446 | public DrawableIcon(Drawable drawable) { |
| 447 | mDrawable = drawable; |
| 448 | } |
| 449 | |
| 450 | @Override |
| 451 | public Drawable getDrawable(Context context) { |
| 452 | return mDrawable; |
| 453 | } |
Jason Monk | 1aec93f | 2016-03-01 09:39:30 -0500 | [diff] [blame] | 454 | |
| 455 | @Override |
| 456 | public Drawable getInvisibleDrawable(Context context) { |
| 457 | return mDrawable; |
| 458 | } |
Jason Monk | 5db8a41 | 2015-10-21 15:16:23 -0700 | [diff] [blame] | 459 | } |
| 460 | |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 461 | public static class ResourceIcon extends Icon { |
| 462 | private static final SparseArray<Icon> ICONS = new SparseArray<Icon>(); |
| 463 | |
Andrew Flynn | a478d70 | 2015-04-14 23:33:45 -0400 | [diff] [blame] | 464 | protected final int mResId; |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 465 | |
| 466 | private ResourceIcon(int resId) { |
| 467 | mResId = resId; |
| 468 | } |
| 469 | |
| 470 | public static Icon get(int resId) { |
| 471 | Icon icon = ICONS.get(resId); |
| 472 | if (icon == null) { |
| 473 | icon = new ResourceIcon(resId); |
| 474 | ICONS.put(resId, icon); |
| 475 | } |
| 476 | return icon; |
| 477 | } |
| 478 | |
| 479 | @Override |
| 480 | public Drawable getDrawable(Context context) { |
Jason Monk | 66239fb | 2015-12-21 14:27:00 -0500 | [diff] [blame] | 481 | return context.getDrawable(mResId); |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 482 | } |
| 483 | |
| 484 | @Override |
Jason Monk | 1aec93f | 2016-03-01 09:39:30 -0500 | [diff] [blame] | 485 | public Drawable getInvisibleDrawable(Context context) { |
| 486 | return context.getDrawable(mResId); |
| 487 | } |
| 488 | |
| 489 | @Override |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 490 | public boolean equals(Object o) { |
| 491 | return o instanceof ResourceIcon && ((ResourceIcon) o).mResId == mResId; |
| 492 | } |
| 493 | |
| 494 | @Override |
| 495 | public String toString() { |
| 496 | return String.format("ResourceIcon[resId=0x%08x]", mResId); |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | protected class AnimationIcon extends ResourceIcon { |
Jason Monk | 1aec93f | 2016-03-01 09:39:30 -0500 | [diff] [blame] | 501 | private final int mAnimatedResId; |
| 502 | |
| 503 | public AnimationIcon(int resId, int staticResId) { |
| 504 | super(staticResId); |
| 505 | mAnimatedResId = resId; |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 506 | } |
| 507 | |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 508 | @Override |
| 509 | public Drawable getDrawable(Context context) { |
| 510 | // workaround: get a clean state for every new AVD |
Jason Monk | 1aec93f | 2016-03-01 09:39:30 -0500 | [diff] [blame] | 511 | return context.getDrawable(mAnimatedResId).getConstantState().newDrawable(); |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 512 | } |
| 513 | } |
| 514 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 515 | public static class State { |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 516 | public Icon icon; |
Jason Monk | bbadff8 | 2015-11-06 15:47:26 -0500 | [diff] [blame] | 517 | public CharSequence label; |
| 518 | public CharSequence contentDescription; |
| 519 | public CharSequence dualLabelContentDescription; |
Selim Cinek | 06d3bca | 2014-08-26 17:29:20 +0200 | [diff] [blame] | 520 | public boolean autoMirrorDrawable = true; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 521 | public boolean disabledByPolicy; |
| 522 | public EnforcedAdmin enforcedAdmin; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 523 | |
| 524 | public boolean copyTo(State other) { |
| 525 | if (other == null) throw new IllegalArgumentException(); |
| 526 | if (!other.getClass().equals(getClass())) throw new IllegalArgumentException(); |
Jason Monk | ba2318e | 2015-12-08 09:04:23 -0500 | [diff] [blame] | 527 | final boolean changed = !Objects.equals(other.icon, icon) |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 528 | || !Objects.equals(other.label, label) |
Selim Cinek | e5557a9 | 2014-08-15 19:59:23 +0200 | [diff] [blame] | 529 | || !Objects.equals(other.contentDescription, contentDescription) |
Selim Cinek | 06d3bca | 2014-08-26 17:29:20 +0200 | [diff] [blame] | 530 | || !Objects.equals(other.autoMirrorDrawable, autoMirrorDrawable) |
Selim Cinek | e5557a9 | 2014-08-15 19:59:23 +0200 | [diff] [blame] | 531 | || !Objects.equals(other.dualLabelContentDescription, |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 532 | dualLabelContentDescription) |
| 533 | || !Objects.equals(other.disabledByPolicy, disabledByPolicy) |
| 534 | || !Objects.equals(other.enforcedAdmin, enforcedAdmin); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 535 | other.icon = icon; |
| 536 | other.label = label; |
| 537 | other.contentDescription = contentDescription; |
Selim Cinek | e5557a9 | 2014-08-15 19:59:23 +0200 | [diff] [blame] | 538 | other.dualLabelContentDescription = dualLabelContentDescription; |
Selim Cinek | 06d3bca | 2014-08-26 17:29:20 +0200 | [diff] [blame] | 539 | other.autoMirrorDrawable = autoMirrorDrawable; |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 540 | other.disabledByPolicy = disabledByPolicy; |
Sudheer Shanka | 1c09db2 | 2016-01-18 11:18:35 +0000 | [diff] [blame] | 541 | if (enforcedAdmin == null) { |
| 542 | other.enforcedAdmin = null; |
| 543 | } else if (other.enforcedAdmin == null) { |
| 544 | other.enforcedAdmin = new EnforcedAdmin(enforcedAdmin); |
| 545 | } else { |
| 546 | enforcedAdmin.copyTo(other.enforcedAdmin); |
| 547 | } |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 548 | return changed; |
| 549 | } |
| 550 | |
| 551 | @Override |
| 552 | public String toString() { |
| 553 | return toStringBuilder().toString(); |
| 554 | } |
| 555 | |
| 556 | protected StringBuilder toStringBuilder() { |
John Spurlock | 2d69581 | 2014-10-30 13:25:21 -0400 | [diff] [blame] | 557 | final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append('['); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 558 | sb.append(",icon=").append(icon); |
| 559 | sb.append(",label=").append(label); |
| 560 | sb.append(",contentDescription=").append(contentDescription); |
Selim Cinek | e5557a9 | 2014-08-15 19:59:23 +0200 | [diff] [blame] | 561 | sb.append(",dualLabelContentDescription=").append(dualLabelContentDescription); |
Selim Cinek | 06d3bca | 2014-08-26 17:29:20 +0200 | [diff] [blame] | 562 | sb.append(",autoMirrorDrawable=").append(autoMirrorDrawable); |
Sudheer Shanka | 1c7cda8 | 2015-12-31 14:46:02 +0000 | [diff] [blame] | 563 | sb.append(",disabledByPolicy=").append(disabledByPolicy); |
| 564 | sb.append(",enforcedAdmin=").append(enforcedAdmin); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 565 | return sb.append(']'); |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | public static class BooleanState extends State { |
| 570 | public boolean value; |
| 571 | |
| 572 | @Override |
| 573 | public boolean copyTo(State other) { |
| 574 | final BooleanState o = (BooleanState) other; |
| 575 | final boolean changed = super.copyTo(other) || o.value != value; |
| 576 | o.value = value; |
| 577 | return changed; |
| 578 | } |
| 579 | |
| 580 | @Override |
| 581 | protected StringBuilder toStringBuilder() { |
| 582 | final StringBuilder rt = super.toStringBuilder(); |
| 583 | rt.insert(rt.length() - 1, ",value=" + value); |
| 584 | return rt; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | public static final class SignalState extends State { |
| 589 | public boolean enabled; |
| 590 | public boolean connected; |
| 591 | public boolean activityIn; |
| 592 | public boolean activityOut; |
| 593 | public int overlayIconId; |
John Spurlock | 899f439 | 2014-06-11 10:59:11 -0400 | [diff] [blame] | 594 | public boolean filter; |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 595 | public boolean isOverlayIconWide; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 596 | |
| 597 | @Override |
| 598 | public boolean copyTo(State other) { |
| 599 | final SignalState o = (SignalState) other; |
| 600 | final boolean changed = o.enabled != enabled |
| 601 | || o.connected != connected || o.activityIn != activityIn |
| 602 | || o.activityOut != activityOut |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 603 | || o.overlayIconId != overlayIconId |
| 604 | || o.isOverlayIconWide != isOverlayIconWide; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 605 | o.enabled = enabled; |
| 606 | o.connected = connected; |
| 607 | o.activityIn = activityIn; |
| 608 | o.activityOut = activityOut; |
| 609 | o.overlayIconId = overlayIconId; |
John Spurlock | 899f439 | 2014-06-11 10:59:11 -0400 | [diff] [blame] | 610 | o.filter = filter; |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 611 | o.isOverlayIconWide = isOverlayIconWide; |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 612 | return super.copyTo(other) || changed; |
| 613 | } |
| 614 | |
| 615 | @Override |
| 616 | protected StringBuilder toStringBuilder() { |
| 617 | final StringBuilder rt = super.toStringBuilder(); |
| 618 | rt.insert(rt.length() - 1, ",enabled=" + enabled); |
| 619 | rt.insert(rt.length() - 1, ",connected=" + connected); |
| 620 | rt.insert(rt.length() - 1, ",activityIn=" + activityIn); |
| 621 | rt.insert(rt.length() - 1, ",activityOut=" + activityOut); |
| 622 | rt.insert(rt.length() - 1, ",overlayIconId=" + overlayIconId); |
John Spurlock | 899f439 | 2014-06-11 10:59:11 -0400 | [diff] [blame] | 623 | rt.insert(rt.length() - 1, ",filter=" + filter); |
Jorim Jaggi | c737b9b | 2014-09-08 23:57:20 +0200 | [diff] [blame] | 624 | rt.insert(rt.length() - 1, ",wideOverlayIcon=" + isOverlayIconWide); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 625 | return rt; |
| 626 | } |
| 627 | } |
| 628 | } |