| commit | 949f6ebd26411f909dad648bfd88a867e001d0c8 | [log] [tgz] |
|---|---|---|
| author | Yasin Kilicdere <tyk@google.com> | Tue Sep 24 17:53:02 2024 +0000 |
| committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Sep 24 23:33:49 2024 +0000 |
| tree | 5291a34b2e0afed85dc0852484ca0857e061b9f8 | |
| parent | 9324ad4f94f992d2d9f7d8dcfe30ff5fd13d95e1 [diff] |
Fix UserRepository to use the correct callback method. Bug: 369294724 Bug: 331853529 Bug: 360838273 Test: atest UserRepositoryImplTest Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7cb99687fe1a22dc515c303aac7ed74792113315) Merged-In: I8b412400b89f5c62ccfc314d49dad68400cb3e5b Change-Id: I8b412400b89f5c62ccfc314d49dad68400cb3e5b
diff --git a/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt b/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt index a817b31..7bf9efa 100644 --- a/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt
@@ -195,7 +195,7 @@ val callback = object : UserTracker.Callback { - override fun onUserChanging(newUser: Int, userContext: Context) { + override fun onBeforeUserSwitching(newUser: Int) { send(SelectionStatus.SELECTION_IN_PROGRESS) }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/user/data/repository/UserRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/user/data/repository/UserRepositoryImplTest.kt index c235954..1af0f79 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/user/data/repository/UserRepositoryImplTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/user/data/repository/UserRepositoryImplTest.kt
@@ -248,10 +248,17 @@ setUpUsers(count = 2, selectedIndex = 1) + // WHEN the user switch is starting + tracker.onBeforeUserSwitching(userId = 1) + + // THEN the selection status is IN_PROGRESS + assertThat(selectedUser!!.selectionStatus) + .isEqualTo(SelectionStatus.SELECTION_IN_PROGRESS) + // WHEN the user is changing tracker.onUserChanging(userId = 1) - // THEN the selection status is IN_PROGRESS + // THEN the selection status is still IN_PROGRESS assertThat(selectedUser!!.selectionStatus) .isEqualTo(SelectionStatus.SELECTION_IN_PROGRESS) @@ -266,6 +273,7 @@ setUpUsers(count = 2, selectedIndex = 0) + tracker.onBeforeUserSwitching(userId = 0) tracker.onUserChanging(userId = 0) assertThat(selectedUser!!.selectionStatus) .isEqualTo(SelectionStatus.SELECTION_IN_PROGRESS)