From 1ab48a3666118e40cf56142c886a7217b92d0d4a Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Tue, 19 Jul 2016 13:48:35 -0700 Subject: SystemUI: avoid null tile creation Don't add a tile spec if creation throws an exception. Change-Id: I0625caef1cd4060bcc59aae2bf433d2b38512e0d Signed-off-by: Roman Birg --- .../src/com/android/systemui/statusbar/phone/QSTileHost.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'packages/SystemUI') 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); -- cgit v1.1