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

Commit 6a220214 authored by Alex Stetson's avatar Alex Stetson Committed by Android (Google) Code Review
Browse files

Merge "Allow beforeUserSwitch override" into udc-dev

parents 6f5c242d 93346b55
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()