Prevent crash when on UserSwitcherActivity rotate

Bug: 251347416
Test: manual verification following steps in bug
Change-Id: I8770300f1bbd269dfdb8e9a7c7f29103216509d7
This commit is contained in:
Brad Hinegardner
2022-12-14 16:07:48 -05:00
parent 24e16e4a21
commit 4e0cbfbb1e
2 changed files with 4 additions and 4 deletions

View File

@@ -890,7 +890,7 @@
android:showForAllUsers="true"
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboard|keyboardHidden"
android:visibleToInstantApps="true">
</activity>

View File

@@ -39,9 +39,9 @@ constructor(
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_switcher_fullscreen)
window.decorView.getWindowInsetsController().apply {
setSystemBarsBehavior(BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE)
hide(Type.systemBars())
window.decorView.windowInsetsController?.let { controller ->
controller.systemBarsBehavior = BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
controller.hide(Type.systemBars())
}
val viewModel =
ViewModelProvider(this, viewModelFactory.get())[UserSwitcherViewModel::class.java]