From e0876efb839d5fa7c8e5f3193b6305dd4a105a91 Mon Sep 17 00:00:00 2001 From: Julia Tuttle Date: Sat, 26 Mar 2022 17:06:43 -0400 Subject: [PATCH] PeopleSpaceWidgetManager: log exceptions For future debugging, log the full exceptions when things fail, instead of just the name of the exception. Bug: 225795387 Test: manual Change-Id: If94718137afbc88b52738763ed43de4aa4cd3995 --- .../systemui/people/PeopleSpaceUtils.java | 4 ++-- .../widget/PeopleSpaceWidgetManager.java | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java index c01d6dcd7d642..c6c9aca0b1614 100644 --- a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java +++ b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java @@ -466,7 +466,7 @@ public class PeopleSpaceUtils { } } } catch (SQLException e) { - Log.e(TAG, "Failed to query contact: " + e); + Log.e(TAG, "Failed to query contact", e); } finally { if (cursor != null) { cursor.close(); @@ -527,7 +527,7 @@ public class PeopleSpaceUtils { lookupKeysWithBirthdaysToday.add(lookupKey); } } catch (SQLException e) { - Log.e(TAG, "Failed to query birthdays: " + e); + Log.e(TAG, "Failed to query birthdays", e); } finally { if (cursor != null) { cursor.close(); diff --git a/packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java b/packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java index 08249a3d493e1..1a7bd8cb6cf91 100644 --- a/packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java +++ b/packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java @@ -275,7 +275,7 @@ public class PeopleSpaceWidgetManager { updateSingleConversationWidgets(widgetIds); } } catch (Exception e) { - Log.e(TAG, "Exception: " + e); + Log.e(TAG, "failed to update widgets", e); } } @@ -348,7 +348,7 @@ public class PeopleSpaceWidgetManager { try { return getTileForExistingWidgetThrowing(appWidgetId); } catch (Exception e) { - Log.e(TAG, "Failed to retrieve conversation for tile: " + e); + Log.e(TAG, "failed to retrieve tile for widget ID " + appWidgetId, e); return null; } } @@ -423,7 +423,7 @@ public class PeopleSpaceWidgetManager { // Add current state. return getTileWithCurrentState(storedTile.build(), ACTION_BOOT_COMPLETED); } catch (RemoteException e) { - Log.e(TAG, "Could not retrieve data: " + e); + Log.e(TAG, "getTileFromPersistentStorage failing", e); return null; } } @@ -476,7 +476,7 @@ public class PeopleSpaceWidgetManager { updateWidgetIdsBasedOnNotifications(tilesUpdated, notifications); } } catch (Exception e) { - Log.e(TAG, "Throwing exception: " + e); + Log.e(TAG, "updateWidgetsWithNotificationChangedInBackground failing", e); } } @@ -499,7 +499,7 @@ public class PeopleSpaceWidgetManager { id -> getAugmentedTileForExistingWidget(id, groupedNotifications))) .forEach((id, tile) -> updateAppWidgetOptionsAndViewOptional(id, tile)); } catch (Exception e) { - Log.e(TAG, "Exception updating widgets: " + e); + Log.e(TAG, "updateWidgetIdsBasedOnNotifications failing", e); } } @@ -851,7 +851,7 @@ public class PeopleSpaceWidgetManager { Collections.singletonList(tile.getId()), tile.getUserHandle(), LauncherApps.FLAG_CACHE_PEOPLE_TILE_SHORTCUTS); } catch (Exception e) { - Log.w(TAG, "Exception caching shortcut:" + e); + Log.w(TAG, "failed to cache shortcut", e); } PeopleSpaceTile finalTile = tile; mBgExecutor.execute( @@ -959,7 +959,7 @@ public class PeopleSpaceWidgetManager { UserHandle.of(key.getUserId()), LauncherApps.FLAG_CACHE_PEOPLE_TILE_SHORTCUTS); } catch (Exception e) { - Log.d(TAG, "Exception uncaching shortcut:" + e); + Log.d(TAG, "failed to uncache shortcut", e); } } @@ -1042,7 +1042,7 @@ public class PeopleSpaceWidgetManager { packageName, userHandle.getIdentifier(), shortcutId); tile = PeopleSpaceUtils.getTile(channel, mLauncherApps); } catch (Exception e) { - Log.w(TAG, "Exception getting tiles: " + e); + Log.w(TAG, "failed to get conversation or tile", e); return null; } if (tile == null) { @@ -1091,7 +1091,7 @@ public class PeopleSpaceWidgetManager { } } catch (PackageManager.NameNotFoundException e) { // Delete data for uninstalled widgets. - Log.e(TAG, "Package no longer found for tile: " + e); + Log.e(TAG, "package no longer found for tile", e); JobScheduler jobScheduler = mContext.getSystemService(JobScheduler.class); if (jobScheduler != null && jobScheduler.getPendingJob(PeopleBackupFollowUpJob.JOB_ID) != null) { @@ -1301,7 +1301,7 @@ public class PeopleSpaceWidgetManager { try { editor.putString(newId, (String) entry.getValue()); } catch (Exception e) { - Log.e(TAG, "Malformed entry value: " + entry.getValue()); + Log.e(TAG, "malformed entry value: " + entry.getValue(), e); } editor.remove(key); break; @@ -1311,7 +1311,7 @@ public class PeopleSpaceWidgetManager { try { oldWidgetIds = (Set) entry.getValue(); } catch (Exception e) { - Log.e(TAG, "Malformed entry value: " + entry.getValue()); + Log.e(TAG, "malformed entry value: " + entry.getValue(), e); editor.remove(key); break; } @@ -1342,7 +1342,7 @@ public class PeopleSpaceWidgetManager { try { oldWidgetIds = (Set) entry.getValue(); } catch (Exception e) { - Log.e(TAG, "Malformed entry value: " + entry.getValue()); + Log.e(TAG, "malformed entry value: " + entry.getValue(), e); followUpEditor.remove(key); continue; }