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

Commit 3cd2429e authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Android (Google) Code Review
Browse files

Merge changes from topics "usc-less-domain", "usc-less-split-flag", "usc-less-ui" into tm-qpr-dev

* changes:
  Splits up the flag.
  UserRecord support in user interactor.
  user UI layer changes to support USC dep removal
  UserInteractor changes to not depend on USC
  GuestUserInteractor.
  RefreshScheduler.
  User data layer without dependency on USC
  Extracts dialogs out of old UserSwitcherController.
  Adds snapshot function for isKeyguardShowing.
  Adds telephony repository and interactor.
  Moves enforcedAdmin into UserRecord.
parents 8f9e2183 2caeebc5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.statusbar.policy.dagger.SmartRepliesInflationModule;
import com.android.systemui.statusbar.policy.dagger.StatusBarPolicyModule;
import com.android.systemui.statusbar.window.StatusBarWindowModule;
import com.android.systemui.telephony.data.repository.TelephonyRepositoryModule;
import com.android.systemui.tuner.dagger.TunerModule;
import com.android.systemui.unfold.SysUIUnfoldModule;
import com.android.systemui.user.UserModule;
@@ -145,6 +146,7 @@ import dagger.Provides;
            StatusBarWindowModule.class,
            SysUIConcurrencyModule.class,
            SysUIUnfoldModule.class,
            TelephonyRepositoryModule.class,
            TunerModule.class,
            UserModule.class,
            UtilModule.class,
+20 −3
Original line number Diff line number Diff line
@@ -104,9 +104,26 @@ public class Flags {
    public static final ReleasedFlag MODERN_USER_SWITCHER_ACTIVITY =
            new ReleasedFlag(209, true);

    /** Whether the new implementation of UserSwitcherController should be used. */
    public static final UnreleasedFlag REFACTORED_USER_SWITCHER_CONTROLLER =
            new UnreleasedFlag(210, false);
    /**
     * Whether the user interactor and repository should use `UserSwitcherController`.
     *
     * <p>If this is {@code false}, the interactor and repo skip the controller and directly access
     * the framework APIs.
     */
    public static final UnreleasedFlag USER_INTERACTOR_AND_REPO_USE_CONTROLLER =
            new UnreleasedFlag(210, true);

    /**
     * Whether `UserSwitcherController` should use the user interactor.
     *
     * <p>When this is {@code true}, the controller does not directly access framework APIs.
     * Instead, it goes through the interactor.
     *
     * <p>Note: do not set this to true if {@link #USER_INTERACTOR_AND_REPO_USE_CONTROLLER} is
     * {@code true} as it would created a cycle between controller -> interactor -> controller.
     */
    public static final UnreleasedFlag USER_CONTROLLER_USES_INTERACTOR =
            new UnreleasedFlag(211, false);

    /***************************************/
    // 300 - power menu
+14 −1
Original line number Diff line number Diff line
@@ -85,6 +85,15 @@ interface KeyguardRepository {
     */
    val dozeAmount: Flow<Float>

    /**
     * Returns `true` if the keyguard is showing; `false` otherwise.
     *
     * Note: this is also `true` when the lock-screen is occluded with an `Activity` "above" it in
     * the z-order (which is not really above the system UI window, but rather - the lock-screen
     * becomes invisible to reveal the "occluding activity").
     */
    fun isKeyguardShowing(): Boolean

    /** Sets whether the bottom area UI should animate the transition out of doze state. */
    fun setAnimateDozingTransitions(animate: Boolean)

@@ -103,7 +112,7 @@ class KeyguardRepositoryImpl
@Inject
constructor(
    statusBarStateController: StatusBarStateController,
    keyguardStateController: KeyguardStateController,
    private val keyguardStateController: KeyguardStateController,
    dozeHost: DozeHost,
) : KeyguardRepository {
    private val _animateBottomAreaDozingTransitions = MutableStateFlow(false)
@@ -168,6 +177,10 @@ constructor(
        awaitClose { statusBarStateController.removeCallback(callback) }
    }

    override fun isKeyguardShowing(): Boolean {
        return keyguardStateController.isShowing
    }

    override fun setAnimateDozingTransitions(animate: Boolean) {
        _animateBottomAreaDozingTransitions.value = animate
    }
+5 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import kotlinx.coroutines.flow.Flow
class KeyguardInteractor
@Inject
constructor(
    repository: KeyguardRepository,
    private val repository: KeyguardRepository,
) {
    /**
     * The amount of doze the system is in, where `1.0` is fully dozing and `0.0` is not dozing at
@@ -40,4 +40,8 @@ constructor(
    val isDozing: Flow<Boolean> = repository.isDozing
    /** Whether the keyguard is showing ot not. */
    val isKeyguardShowing: Flow<Boolean> = repository.isKeyguardShowing

    fun isKeyguardShowing(): Boolean {
        return repository.isKeyguardShowing()
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ public class UserDetailView extends PseudoGridView {
                v.bind(name, drawable, item.info.id);
            }
            v.setActivated(item.isCurrent);
            v.setDisabledByAdmin(mController.isDisabledByAdmin(item));
            v.setDisabledByAdmin(item.isDisabledByAdmin());
            v.setEnabled(item.isSwitchToEnabled);
            UserSwitcherController.setSelectableAlpha(v);

@@ -173,16 +173,16 @@ public class UserDetailView extends PseudoGridView {
            Trace.beginSection("UserDetailView.Adapter#onClick");
            UserRecord userRecord =
                    (UserRecord) view.getTag();
            if (mController.isDisabledByAdmin(userRecord)) {
            if (userRecord.isDisabledByAdmin()) {
                final Intent intent = RestrictedLockUtils.getShowAdminSupportDetailsIntent(
                        mContext, mController.getEnforcedAdmin(userRecord));
                        mContext, userRecord.enforcedAdmin);
                mController.startActivity(intent);
            } else if (userRecord.isSwitchToEnabled) {
                MetricsLogger.action(mContext, MetricsEvent.QS_SWITCH_USER);
                mUiEventLogger.log(QSUserSwitcherEvent.QS_USER_SWITCH);
                if (!userRecord.isAddUser
                        && !userRecord.isRestricted
                        && !mController.isDisabledByAdmin(userRecord)) {
                        && !userRecord.isDisabledByAdmin()) {
                    if (mCurrentUserView != null) {
                        mCurrentUserView.setActivated(false);
                    }
Loading