Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93346b55 authored by Alex Stetson's avatar Alex Stetson
Browse files

Allow beforeUserSwitch override

Bug: 277094749
Test: manual
Change-Id: I773a4f77be1e0bb0646c18778e1bad55cce8ab4d
parent bb76d1e9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ open class UserTrackerImpl internal constructor(
    private fun registerUserSwitchObserver() {
        iActivityManager.registerUserSwitchObserver(object : UserSwitchObserver() {
            override fun onBeforeUserSwitching(newUserId: Int) {
                setUserIdInternal(newUserId)
                handleBeforeUserSwitching(newUserId)
            }

            override fun onUserSwitching(newUserId: Int, reply: IRemoteCallback?) {
@@ -180,6 +180,10 @@ open class UserTrackerImpl internal constructor(
        }, TAG)
    }

    protected open fun handleBeforeUserSwitching(newUserId: Int) {
        setUserIdInternal(newUserId)
    }

    @WorkerThread
    protected open fun handleUserSwitching(newUserId: Int) {
        Assert.isNotMainThread()