diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java index 48bef97c30fba..2bee75e9435b4 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java @@ -41,6 +41,7 @@ import com.android.systemui.qs.tileimpl.QSFactoryImpl; import com.android.systemui.recents.Recents; import com.android.systemui.recents.RecentsImplementation; import com.android.systemui.screenshot.ReferenceScreenshotModule; +import com.android.systemui.settings.dagger.MultiUserUtilsModule; import com.android.systemui.shade.NotificationShadeWindowControllerImpl; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeControllerImpl; @@ -93,6 +94,7 @@ import dagger.Provides; AospPolicyModule.class, GestureModule.class, MediaModule.class, + MultiUserUtilsModule.class, PowerModule.class, QSModule.class, ReferenceScreenshotModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index 6db562107357e..482bdafc63cc4 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -58,7 +58,6 @@ import com.android.systemui.qs.footer.dagger.FooterActionsModule; import com.android.systemui.recents.Recents; import com.android.systemui.screenshot.dagger.ScreenshotModule; import com.android.systemui.security.data.repository.SecurityRepositoryModule; -import com.android.systemui.settings.dagger.MultiUserUtilsModule; import com.android.systemui.shade.ShadeController; import com.android.systemui.smartspace.dagger.SmartspaceModule; import com.android.systemui.statusbar.CommandQueue; @@ -140,7 +139,6 @@ import dagger.Provides; PrivacyModule.class, ScreenshotModule.class, SensorModule.class, - MultiUserUtilsModule.class, SecurityRepositoryModule.class, SettingsUtilModule.class, SmartRepliesInflationModule.class, diff --git a/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt b/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt index 671173413e731..cd5647e510295 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/settings/UserTrackerImpl.kt @@ -30,7 +30,6 @@ import androidx.annotation.GuardedBy import androidx.annotation.WorkerThread import com.android.systemui.Dumpable import com.android.systemui.dump.DumpManager -import com.android.systemui.people.widget.PeopleSpaceWidgetProvider.EXTRA_USER_HANDLE import com.android.systemui.util.Assert import java.io.PrintWriter import java.lang.ref.WeakReference @@ -53,7 +52,7 @@ import kotlin.reflect.KProperty * * Class constructed and initialized in [SettingsModule]. */ -class UserTrackerImpl internal constructor( +open class UserTrackerImpl internal constructor( private val context: Context, private val userManager: UserManager, private val dumpManager: DumpManager, @@ -70,13 +69,13 @@ class UserTrackerImpl internal constructor( private val mutex = Any() override var userId: Int by SynchronizedDelegate(context.userId) - private set + protected set override var userHandle: UserHandle by SynchronizedDelegate(context.user) - private set + protected set override var userContext: Context by SynchronizedDelegate(context) - private set + protected set override val userContentResolver: ContentResolver get() = userContext.contentResolver @@ -94,7 +93,7 @@ class UserTrackerImpl internal constructor( * modified. */ override var userProfiles: List by SynchronizedDelegate(emptyList()) - private set + protected set @GuardedBy("callbacks") private val callbacks: MutableList = ArrayList() @@ -155,7 +154,7 @@ class UserTrackerImpl internal constructor( } @WorkerThread - private fun handleSwitchUser(newUser: Int) { + protected open fun handleSwitchUser(newUser: Int) { Assert.isNotMainThread() if (newUser == UserHandle.USER_NULL) { Log.w(TAG, "handleSwitchUser - Couldn't get new id from intent") @@ -174,7 +173,7 @@ class UserTrackerImpl internal constructor( } @WorkerThread - private fun handleProfilesChanged() { + protected open fun handleProfilesChanged() { Assert.isNotMainThread() val profiles = userManager.getProfiles(userId) diff --git a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java index 10a09dd169e82..61eadeb1764fa 100644 --- a/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/tv/TvSystemUIModule.java @@ -44,6 +44,7 @@ import com.android.systemui.qs.tileimpl.QSFactoryImpl; import com.android.systemui.recents.Recents; import com.android.systemui.recents.RecentsImplementation; import com.android.systemui.screenshot.ReferenceScreenshotModule; +import com.android.systemui.settings.dagger.MultiUserUtilsModule; import com.android.systemui.shade.NotificationShadeWindowControllerImpl; import com.android.systemui.shade.ShadeController; import com.android.systemui.shade.ShadeControllerImpl; @@ -89,6 +90,7 @@ import dagger.multibindings.IntoSet; includes = { AospPolicyModule.class, GestureModule.class, + MultiUserUtilsModule.class, PowerModule.class, QSModule.class, ReferenceScreenshotModule.class,