Fix multi-display nav bar tests on large screen devices

Tests failed because #createnavigationBar skip create nav bar even on
the secondary display if there's a task bar initialized.
This CL changes to only check on the default display instead.

fixes: 241509471
Test: atest MultiDisplaySystemDecorationTests#testNavBarShowingOnDisplayWithDecor
Test: atest MultiDisplaySystemDecorationTests#testNavBarNotShowingOnDisplayWithoutDecor
Test: atest MultiDisplaySystemDecorationTests#testNavBarNotShowingOnPrivateDisplay
Change-Id: Ibdd5fb65a92915ac92e908c0091260573cec18c8
This commit is contained in:
Charles Chen
2022-08-08 10:35:42 +08:00
parent 7c09300459
commit 1e164d4a87

View File

@@ -302,10 +302,6 @@ public class NavigationBarController implements
*/
@VisibleForTesting
void createNavigationBar(Display display, Bundle savedState, RegisterStatusBarResult result) {
if (initializeTaskbarIfNecessary()) {
return;
}
if (display == null) {
return;
}
@@ -315,7 +311,7 @@ public class NavigationBarController implements
// We may show TaskBar on the default display for large screen device. Don't need to create
// navigation bar for this case.
if (mIsTablet && isOnDefaultDisplay) {
if (isOnDefaultDisplay && initializeTaskbarIfNecessary()) {
return;
}