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

Commit 389556b9 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

[1/N] Make alternateBouncer its own view

With this flag enabled...
- AlternateBouncer shows over the lockscreen and notification
  shade (which is why it lives in super_notification_shade
  instead of the KeyguardRootView)
- AlternateBouncer has its own clickhandler so touches no longer
  need to be intercepted by the NotificationWindowView. Updated
  StatusBarTouchableRegionManager to include allowing touches
  when the AlternateBouncer is showing.
- AlternateBouncer "scrim" isn't relying on ScrimController and
  instead uses its own ScrimView.

This doesn't support the alternateBouncer message area nor swiping
on the alternate bouncer view => primary bouncer interactions.

Test: atest CentralSurfacesImplTest
Test: atest StatusBarKeyguardViewManagerTest
Test: atest AlternateBouncerViewModelTest
Test: adb shell cmd statusbar flag alternate_bouncer_view true
Bug: 300440924
Bug: 287599719
Change-Id: Ib51e7c3468f2607efc2dc9df531d26582120a041
parent 8d3c0614
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2023 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:sysui="http://schemas.android.com/apk/res-auto"
    android:id="@+id/alternate_bouncer"
    android:focusable="true"
    android:clickable="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.android.systemui.scrim.ScrimView
        android:id="@+id/alternate_bouncer_scrim"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:importantForAccessibility="no"
        sysui:ignoreRightInset="true"
    />
</FrameLayout>
+5 −0
Original line number Diff line number Diff line
@@ -130,6 +130,11 @@
        android:inflatedId="@+id/multi_shade"
        android:layout="@layout/multi_shade" />

    <include layout="@layout/alternate_bouncer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="invisible" />

    <com.android.systemui.biometrics.AuthRippleView
        android:id="@+id/auth_ripple"
        android:layout_width="match_parent"
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.systemui.keyboard.PhysicalKeyboardCoreStartable
import com.android.systemui.keyguard.KeyguardViewConfigurator
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.data.quickaffordance.MuteQuickAffordanceCoreStartable
import com.android.systemui.keyguard.ui.binder.AlternateBouncerBinder
import com.android.systemui.keyguard.ui.binder.KeyguardDismissActionBinder
import com.android.systemui.keyguard.ui.binder.KeyguardDismissBinder
import com.android.systemui.log.SessionTracker
@@ -92,6 +93,11 @@ abstract class SystemUICoreStartableModule {
    @ClassKey(AuthController::class)
    abstract fun bindAuthController(service: AuthController): CoreStartable

    @Binds
    @IntoMap
    @ClassKey(AlternateBouncerBinder::class)
    abstract fun bindAlternateBouncerBinder(impl: AlternateBouncerBinder): CoreStartable

    /** Inject into BiometricNotificationService */
    @Binds
    @IntoMap
+1 −1
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ object Flags {
    /** Flag to use a separate view for the alternate bouncer. */
    // TODO(b/300440924): Tracking bug
    @JvmField
    val ALTERNATE_BOUNCER_REFACTOR: UnreleasedFlag = unreleasedFlag("alternate_bouncer_view")
    val ALTERNATE_BOUNCER_VIEW: UnreleasedFlag = unreleasedFlag("alternate_bouncer_view")

    // 300 - power menu
    // TODO(b/254512600): Tracking Bug
+3 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds

@SysUISingleton
class FromAlternateBouncerTransitionInteractor
@@ -129,11 +130,11 @@ constructor(
    override fun getDefaultAnimatorForTransitionsToState(toState: KeyguardState): ValueAnimator {
        return ValueAnimator().apply {
            interpolator = Interpolators.LINEAR
            duration = TRANSITION_DURATION_MS
            duration = TRANSITION_DURATION_MS.inWholeMilliseconds
        }
    }

    companion object {
        private const val TRANSITION_DURATION_MS = 300L
        val TRANSITION_DURATION_MS = 300.milliseconds
    }
}
Loading