Merge changes from topics "b-254099598-1", "b-254133820"
* changes: Make UserTrackerImpl more extensible Allow for replacement of MultiUserUtilsModule
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<UserInfo> by SynchronizedDelegate(emptyList())
|
||||
private set
|
||||
protected set
|
||||
|
||||
@GuardedBy("callbacks")
|
||||
private val callbacks: MutableList<DataItem> = 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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user