diff options
| author | 2022-12-07 10:22:47 +0000 | |
|---|---|---|
| committer | 2022-12-07 10:45:00 +0000 | |
| commit | f23642b9af19de68c46b7fec5550cf5eb36f061f (patch) | |
| tree | d6a7148b4b3bdce314c954d877c92e68c1319702 | |
| parent | c868e22da9a216e75166439a33e4e1a6f7c68ede (diff) | |
Do not recreate navigation bar for screen layout change
According to the document, the screenLayout can be changed
if orientation is changed:
If you want to manually handle orientation changes in your
app you must declare the "orientation", "screenSize", and
"screenLayout" values in the android:configChanges attributes.
The activity configuration follows the behavior for years, so
[1] makes the calculation of display screen layout (sent to
application) consistent, instead of computing a smallest value.
NavigationBar was configured to recreate if it detects a screen
layout change, then it may trigger an additional display config
change since [2] considers the insets of decor windows as a
factor to affect screen size.
The InterestingConfigChanges flags of NavigationBar was just
reused from [3] which is not added for NavigationBar. So a
simple redraw is enough for screen layout change, that is also
more efficient.
[1]: If806e2a42a6c3c548d93ba43c1aed69889901193
[2]: If966bcc8125300d47d5cd631f7db17ff027e5261
[3]: I48af51cc4694ba5c492794631a1e1a54a60fce0b
Bug: 233855302
Test: Simulate screen layout change (LONG) of rotation
adb shell wm size 720x1280
adb shell wm density 320
atest ConfigChangeTests#testRotation90NoRelaunch
Test: Simulate large screen change (width>600dp)
The navigation bar shows correctly with
adb shell wm size 2600x2200
Switch navigation mode / rotate device.
adb shell wm size reset
Change-Id: I7c47faabc66ac117a8429ca4d856865e581e1a3d
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java index 3fd1aa73c033..ea0c2c9935fc 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java @@ -98,7 +98,7 @@ public class NavigationBarController implements // Tracks config changes that will actually recreate the nav bar private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges( - ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_SCREEN_LAYOUT + ActivityInfo.CONFIG_FONT_SCALE | ActivityInfo.CONFIG_UI_MODE); @Inject |