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

Commit 7ab7f027 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Iebb13b14,I22c264ea

* changes:
  Fix keyguard icons aligned to start
  Use fullscreen user switcher if available
parents 4f2645ae 9639cf8d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
    android:id="@+id/system_icons"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="center_vertical|end"
    android:gravity="center_vertical">

    <com.android.systemui.statusbar.phone.StatusIconContainer android:id="@+id/statusIcons"
+20 −3
Original line number Diff line number Diff line
@@ -16,9 +16,15 @@

package com.android.systemui.statusbar.phone.userswitcher

import android.content.Intent
import android.view.View
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.plugins.ActivityStarter

import com.android.systemui.qs.user.UserSwitchDialogController
import com.android.systemui.user.UserSwitcherActivity
import com.android.systemui.util.ViewController

import javax.inject.Inject
@@ -30,7 +36,9 @@ class StatusBarUserSwitcherControllerImpl @Inject constructor(
    view: StatusBarUserSwitcherContainer,
    private val tracker: StatusBarUserInfoTracker,
    private val featureController: StatusBarUserSwitcherFeatureController,
    private val userSwitcherDialogController: UserSwitchDialogController
    private val userSwitcherDialogController: UserSwitchDialogController,
    private val featureFlags: FeatureFlags,
    private val activityStarter: ActivityStarter
) : ViewController<StatusBarUserSwitcherContainer>(view),
        StatusBarUserSwitcherController {
    private val listener = object : CurrentUserChipInfoUpdatedListener {
@@ -52,8 +60,17 @@ class StatusBarUserSwitcherControllerImpl @Inject constructor(
    override fun onViewAttached() {
        tracker.addCallback(listener)
        featureController.addCallback(featureFlagListener)
        mView.setOnClickListener {
            userSwitcherDialogController.showDialog(it)
        mView.setOnClickListener { view: View ->
            if (featureFlags.isEnabled(Flags.FULL_SCREEN_USER_SWITCHER)) {
                val intent = Intent(context, UserSwitcherActivity::class.java)
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)

                activityStarter.startActivity(intent, true /* dismissShade */,
                        ActivityLaunchAnimator.Controller.fromView(view, null),
                        true /* showOverlockscreenwhenlocked */)
            } else {
                userSwitcherDialogController.showDialog(view)
            }
        }

        updateEnabled()