diff options
author | Roman Birg <roman@cyngn.com> | 2016-07-19 13:48:35 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-08-01 14:28:38 -0700 |
commit | 1ab48a3666118e40cf56142c886a7217b92d0d4a (patch) | |
tree | 3f3a949f7417896e1d279d36b70875de3775d9bf /packages | |
parent | 75864c61c11068aab8f00e0925ba293a4ac70313 (diff) | |
download | frameworks_base-1ab48a3666118e40cf56142c886a7217b92d0d4a.zip frameworks_base-1ab48a3666118e40cf56142c886a7217b92d0d4a.tar.gz frameworks_base-1ab48a3666118e40cf56142c886a7217b92d0d4a.tar.bz2 |
SystemUI: avoid null tile creation
Don't add a tile spec if creation throws an exception.
Change-Id: I0625caef1cd4060bcc59aae2bf433d2b38512e0d
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java index 53310dd..e88ed73 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java @@ -318,10 +318,12 @@ public class QSTileHost implements QSTile.Host, Tunable { if (DEBUG) Log.d(TAG, "Creating tile: " + tileSpec); try { if (mCustomTileData.get(tileSpec) != null) { - newTiles.put(tileSpec, new CustomQSTile(this, - mCustomTileData.get(tileSpec).sbc)); + final CustomQSTile value = new CustomQSTile(this, + mCustomTileData.get(tileSpec).sbc); + newTiles.put(tileSpec, value); } else { - newTiles.put(tileSpec, createTile(tileSpec)); + final QSTile<?> tile = createTile(tileSpec); + newTiles.put(tileSpec, tile); } } catch (Throwable t) { Log.w(TAG, "Error creating tile for spec: " + tileSpec, t); |