From 01ec76347257f37cc3cba0ed16603c1122885310 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Mon, 8 May 2023 18:04:54 +0000 Subject: [PATCH] Add logging when tile cannot be found This will help understand why is that tile null Bug: 279388069 Test: build Change-Id: I03cbcaf4c88c6bfcf796cf2cffe8ccbadcbedea0 --- .../systemui/qs/external/TileServices.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java index 121955cced1a5..f7b21428dd001 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java +++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServices.java @@ -339,9 +339,26 @@ public class TileServices extends IQSService.Stub { verifyCaller(customTile); return customTile.getQsTile(); } + Log.e(TAG, "Tile for token " + token + "not found. " + + "Tiles in map: " + availableTileComponents()); return null; } + private String availableTileComponents() { + StringBuilder sb = new StringBuilder("["); + synchronized (mServices) { + mTokenMap.forEach((iBinder, customTile) -> + sb.append(iBinder.toString()) + .append(":") + .append(customTile.getComponent().flattenToShortString()) + .append(":") + .append(customTile.getUser()) + .append(",")); + } + sb.append("]"); + return sb.toString(); + } + @Override public void startUnlockAndRun(IBinder token) { CustomTile customTile = getTileForToken(token);