Avoid some reinflations when unfolding
The reason why views were reinflated onSmallestScreenWidthChanged is that the userSwitcher could have been visible in one configuration, but invisible in another. With this change, views are reinflated only if it is sure there is a visibility change of the user switcher. From Perfetto recordings, this makes the screen switch (from external to internal) 95ms faster Bug: 197515205 Bug: 186728895 Test: Manually tested Change-Id: Ic887c3727a9bf911861078af72dc642621f6076e
This commit is contained in:
@@ -4596,7 +4596,14 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
|
||||
// Can affect multi-user switcher visibility as it depends on screen size by default:
|
||||
// it is enabled only for devices with large screens (see config_keyguardUserSwitcher)
|
||||
reInflateViews();
|
||||
boolean prevKeyguardUserSwitcherEnabled = mKeyguardUserSwitcherEnabled;
|
||||
boolean prevKeyguardQsUserSwitchEnabled = mKeyguardQsUserSwitchEnabled;
|
||||
updateUserSwitcherFlags();
|
||||
if (prevKeyguardUserSwitcherEnabled != mKeyguardUserSwitcherEnabled
|
||||
|| prevKeyguardQsUserSwitchEnabled != mKeyguardQsUserSwitchEnabled) {
|
||||
reInflateViews();
|
||||
}
|
||||
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user