From 5659637cfdb258cc89692bbfa4e30c9fd51f725f Mon Sep 17 00:00:00 2001 From: Naomi Musgrave Date: Mon, 7 Sep 2020 17:25:02 +0100 Subject: [PATCH] Add trace, and post UI-intensive work on receive Fixes: 157898351 Test: atest StatusBarTest Change-Id: I3b1cfcbb5e808f0f2ac32e9fb54fbe3b9443e1a6 --- .../com/android/systemui/statusbar/phone/StatusBar.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 31c1a5e5a9aa7..8254b7f5b32a6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -1848,7 +1848,7 @@ public class StatusBar extends SystemUI implements DemoMode, mStatusBarStateController.setPanelExpanded(isExpanded); if (isExpanded && mStatusBarStateController.getState() != StatusBarState.KEYGUARD) { if (DEBUG) { - Log.v(TAG, "clearing notification effects from setExpandedHeight"); + Log.v(TAG, "clearing notification effects from Height"); } clearNotificationEffects(); } @@ -2809,6 +2809,7 @@ public class StatusBar extends SystemUI implements DemoMode, private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { + Trace.beginSection("StatusBar#onReceive"); if (DEBUG) Log.v(TAG, "onReceive: " + intent); String action = intent.getAction(); if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) { @@ -2833,7 +2834,8 @@ public class StatusBar extends SystemUI implements DemoMode, mNotificationShadeWindowController.setNotTouchable(false); } if (mBubbleController.isStackExpanded()) { - mBubbleController.collapseStack(); + // Post to main thread handler, since updating the UI. + mMainThreadHandler.post(() -> mBubbleController.collapseStack()); } finishBarAnimations(); resetUserExpandedStates(); @@ -2841,6 +2843,7 @@ public class StatusBar extends SystemUI implements DemoMode, else if (DevicePolicyManager.ACTION_SHOW_DEVICE_MONITORING_DIALOG.equals(action)) { mQSPanel.showDeviceMonitoringDialog(); } + Trace.endSection(); } };