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

Commit 11b09424 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7744445 from 1f012650 to sc-qpr1-release

Change-Id: I699b0837cae8b7660880d24a40316bff9d181f45
parents 228ee1a4 1f012650
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -124,7 +124,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {
                        Intent intent = new Intent(Intent.ACTION_VOICE_COMMAND);
                        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        try {
                            sendCloseSystemWindows();
                            mContext.startActivity(intent);
                        } catch (ActivityNotFoundException e) {
                            startCallActivity();
@@ -147,7 +146,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {
                    dispatcher.performedLongPress(event);
                    if (isUserSetupComplete()) {
                        mView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
                        sendCloseSystemWindows();
                        // Broadcast an intent that the Camera button was longpressed
                        Intent intent = new Intent(Intent.ACTION_CAMERA_BUTTON, null);
                        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
@@ -178,7 +176,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {
                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                            try {
                                mView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
                                sendCloseSystemWindows();
                                getSearchManager().stopSearch();
                                mContext.startActivity(intent);
                                // Only clear this if we successfully start the
@@ -272,7 +269,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {

    @UnsupportedAppUsage
    void startCallActivity() {
        sendCloseSystemWindows();
        Intent intent = new Intent(Intent.ACTION_CALL_BUTTON);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        try {
@@ -319,10 +315,6 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {
        return mMediaSessionManager;
    }

    void sendCloseSystemWindows() {
        PhoneWindow.sendCloseSystemWindows(mContext, null);
    }

    private void handleVolumeKeyEvent(KeyEvent keyEvent) {
        getMediaSessionManager().dispatchVolumeKeyEventAsSystemService(keyEvent,
                AudioManager.USE_DEFAULT_STREAM_TYPE);
+19 −13
Original line number Diff line number Diff line
@@ -15,10 +15,15 @@
  ~ limitations under the License
  -->
<!-- This is a view that shows a user switcher in Keyguard. -->
<com.android.systemui.statusbar.phone.UserAvatarView
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/keyguard_qs_user_switch_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="end">
    <com.android.systemui.statusbar.phone.UserAvatarView
        android:id="@+id/kg_multi_user_avatar"
        android:layout_width="@dimen/kg_framed_avatar_size"
        android:layout_height="@dimen/kg_framed_avatar_size"
        android:layout_centerHorizontal="true"
@@ -31,3 +36,4 @@
        systemui:framePadding="0dp"
        systemui:frameWidth="0dp">
    </com.android.systemui.statusbar.phone.UserAvatarView>
</FrameLayout>
 No newline at end of file
+1 −3
Original line number Diff line number Diff line
@@ -160,10 +160,8 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
        mBroadcastDispatcher.unregisterReceiver(mLocaleBroadcastReceiver);
        mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback);
        mBatteryController.removeCallback(mBatteryCallback);
        if (!mView.isAttachedToWindow()) {
        mStatusBarStateController.removeCallback(mStatusBarStatePersistentListener);
    }
    }

    /** Animate the clock appearance */
    public void animateAppear() {
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@

package com.android.keyguard.dagger;

import com.android.systemui.statusbar.phone.UserAvatarView;
import android.widget.FrameLayout;

import com.android.systemui.statusbar.policy.KeyguardQsUserSwitchController;

import dagger.BindsInstance;
@@ -31,8 +32,7 @@ public interface KeyguardQsUserSwitchComponent {
    /** Simple factory for {@link KeyguardUserSwitcherComponent}. */
    @Subcomponent.Factory
    interface Factory {
        KeyguardQsUserSwitchComponent build(
                @BindsInstance UserAvatarView userAvatarView);
        KeyguardQsUserSwitchComponent build(@BindsInstance FrameLayout userAvatarContainer);
    }

    /** Builds a {@link KeyguardQsUserSwitchController}. */
+50 −12
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.biometrics

import android.animation.ValueAnimator
import android.content.Context
import android.content.res.Configuration
import android.graphics.PointF
@@ -26,6 +27,8 @@ import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.settingslib.Utils
import com.android.systemui.R
import com.android.systemui.animation.Interpolators
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.statusbar.CircleReveal
import com.android.systemui.statusbar.LightRevealEffect
import com.android.systemui.statusbar.NotificationShadeWindowController
@@ -36,12 +39,15 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController
import com.android.systemui.statusbar.phone.StatusBar
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent.StatusBarScope
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.util.ViewController
import java.io.PrintWriter
import javax.inject.Inject
import javax.inject.Provider
import com.android.systemui.plugins.statusbar.StatusBarStateController

private const val WAKE_AND_UNLOCK_FADE_DURATION = 180L

/***
 * Controls the ripple effect that shows when authentication is successful.
 * The ripple uses the accent color of the current theme.
@@ -53,6 +59,8 @@ class AuthRippleController @Inject constructor(
    private val authController: AuthController,
    private val configurationController: ConfigurationController,
    private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
    private val keyguardStateController: KeyguardStateController,
    private val wakefulnessLifecycle: WakefulnessLifecycle,
    private val commandRegistry: CommandRegistry,
    private val notificationShadeWindowController: NotificationShadeWindowController,
    private val bypassController: KeyguardBypassController,
@@ -60,7 +68,11 @@ class AuthRippleController @Inject constructor(
    private val udfpsControllerProvider: Provider<UdfpsController>,
    private val statusBarStateController: StatusBarStateController,
    rippleView: AuthRippleView?
) : ViewController<AuthRippleView>(rippleView) {
) : ViewController<AuthRippleView>(rippleView), KeyguardStateController.Callback,
    WakefulnessLifecycle.Observer {

    @VisibleForTesting
    internal var startLightRevealScrimOnKeyguardFadingAway = false
    var fingerprintSensorLocation: PointF? = null
    private var faceSensorLocation: PointF? = null
    private var circleReveal: LightRevealEffect? = null
@@ -87,6 +99,8 @@ class AuthRippleController @Inject constructor(
        udfpsController?.addCallback(udfpsControllerCallback)
        configurationController.addCallback(configurationChangedListener)
        keyguardUpdateMonitor.registerCallback(keyguardUpdateMonitorCallback)
        keyguardStateController.addCallback(this)
        wakefulnessLifecycle.addObserver(this)
        commandRegistry.registerCommand("auth-ripple") { AuthRippleCommand() }
    }

@@ -96,6 +110,8 @@ class AuthRippleController @Inject constructor(
        authController.removeCallback(authControllerCallback)
        keyguardUpdateMonitor.removeCallback(keyguardUpdateMonitorCallback)
        configurationController.removeCallback(configurationChangedListener)
        keyguardStateController.removeCallback(this)
        wakefulnessLifecycle.removeObserver(this)
        commandRegistry.unregisterCommand("auth-ripple")

        notificationShadeWindowController.setForcePluginOpen(false, this)
@@ -123,30 +139,48 @@ class AuthRippleController @Inject constructor(

    private fun showUnlockedRipple() {
        notificationShadeWindowController.setForcePluginOpen(true, this)
        val biometricUnlockMode = biometricUnlockController.mode
        val useCircleReveal = circleReveal != null &&
            (biometricUnlockMode == BiometricUnlockController.MODE_WAKE_AND_UNLOCK ||
                biometricUnlockMode == BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING ||
                biometricUnlockMode == BiometricUnlockController.MODE_WAKE_AND_UNLOCK_FROM_DREAM)
        val useCircleReveal = circleReveal != null && biometricUnlockController.isWakeAndUnlock
        val lightRevealScrim = statusBar.lightRevealScrim
        if (useCircleReveal) {
            lightRevealScrim?.revealEffect = circleReveal!!
            startLightRevealScrimOnKeyguardFadingAway = true
        }

        mView.startUnlockedRipple(
            /* end runnable */
            Runnable {
                notificationShadeWindowController.setForcePluginOpen(false, this)
            },
            /* circleReveal */
            if (useCircleReveal) {
                lightRevealScrim
            } else {
                null
            }
        )
    }

    override fun onKeyguardFadingAwayChanged() {
        if (keyguardStateController.isKeyguardFadingAway) {
            val lightRevealScrim = statusBar.lightRevealScrim
            if (startLightRevealScrimOnKeyguardFadingAway && lightRevealScrim != null) {
                val revealAnimator = ValueAnimator.ofFloat(.1f, 1f).apply {
                    interpolator = Interpolators.LINEAR_OUT_SLOW_IN
                    duration = RIPPLE_ANIMATION_DURATION
                    startDelay = keyguardStateController.keyguardFadingAwayDelay
                    addUpdateListener { animator ->
                        if (lightRevealScrim.revealEffect != circleReveal) {
                            // if the something else took over the reveal, let's do nothing.
                            return@addUpdateListener
                        }
                        lightRevealScrim.revealAmount = animator.animatedValue as Float
                    }
                }
                revealAnimator.start()
                startLightRevealScrimOnKeyguardFadingAway = false
            }
        }
    }

    override fun onStartedGoingToSleep() {
        // reset the light reveal start in case we were pending an unlock
        startLightRevealScrimOnKeyguardFadingAway = false
    }

    fun updateSensorLocation() {
        fingerprintSensorLocation = authController.fingerprintSensorLocation
        faceSensorLocation = authController.faceAuthSensorLocation
@@ -318,4 +352,8 @@ class AuthRippleController @Inject constructor(
            help(pw)
        }
    }

    companion object {
        const val RIPPLE_ANIMATION_DURATION: Long = 1533
    }
}
Loading