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

Commit 6dff1427 authored by Beverly's avatar Beverly
Browse files

AlternateBouncerView supports tap AND swipe up to primary bouncer

Also:
- fixes the AlternateBouncerInteractorTest so that it consistently
works despite any flag overrides on the device.
- renames DefaultDeviceEntryIconSection to DefaultDeviceEntrySection

Bug: 287599719
Flag: ACONFIG com.android.systemui.device_entry_udfps_refactor DEVELOPMENT
Test: atest AlternateBouncerViewModelTest DefaultDeviceEntryIconSectionTest
Change-Id: I9b908d566b4e206e30e48113be2883bf15523601
parent 3baabef4
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -103,8 +103,6 @@ import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.concurrency.Execution;
import com.android.systemui.util.time.SystemClock;

import kotlin.Unit;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
@@ -114,6 +112,8 @@ import java.util.concurrent.Executor;
import javax.inject.Inject;
import javax.inject.Provider;

import kotlin.Unit;

import kotlinx.coroutines.ExperimentalCoroutinesApi;

/**
@@ -589,7 +589,8 @@ public class UdfpsController implements DozeReceiver, Dumpable {

        // Always pilfer pointers that are within sensor area or when alternate bouncer is showing
        if (mActivePointerId != MotionEvent.INVALID_POINTER_ID
                || mAlternateBouncerInteractor.isVisibleState()) {
                || (mAlternateBouncerInteractor.isVisibleState()
                && !DeviceEntryUdfpsRefactor.isEnabled())) {
            shouldPilfer = true;
        }

+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ public abstract class Classifier {
    public static final int BACK_GESTURE = 16;
    public static final int QS_SWIPE_NESTED = 17;
    public static final int MEDIA_SEEKBAR = 18;
    public static final int ALTERNATE_BOUNCER_SWIPE = 19;

    @IntDef({
            QUICK_SETTINGS,
@@ -65,6 +66,7 @@ public abstract class Classifier {
            QS_SWIPE_NESTED,
            BACK_GESTURE,
            MEDIA_SEEKBAR,
            ALTERNATE_BOUNCER_SWIPE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface InteractionType {}
+3 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHT
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_DISTANCE_VELOCITY_TO_DISTANCE;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_DISTANCE_VERTICAL_FLING_THRESHOLD_IN;
import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.BRIGHTLINE_FALSING_DISTANCE_VERTICAL_SWIPE_THRESHOLD_IN;
import static com.android.systemui.classifier.Classifier.ALTERNATE_BOUNCER_SWIPE;
import static com.android.systemui.classifier.Classifier.BRIGHTNESS_SLIDER;
import static com.android.systemui.classifier.Classifier.MEDIA_SEEKBAR;
import static com.android.systemui.classifier.Classifier.QS_COLLAPSE;
@@ -159,7 +160,8 @@ class DistanceClassifier extends FalsingClassifier {
                || interactionType == QS_COLLAPSE
                || interactionType == Classifier.UDFPS_AUTHENTICATION
                || interactionType == Classifier.QS_SWIPE_SIDE
                || interactionType == QS_SWIPE_NESTED) {
                || interactionType == QS_SWIPE_NESTED
                || interactionType == ALTERNATE_BOUNCER_SWIPE) {
            return Result.passed(0);
        }

+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.classifier;


import static com.android.systemui.classifier.Classifier.ALTERNATE_BOUNCER_SWIPE;
import static com.android.systemui.classifier.Classifier.BOUNCER_UNLOCK;
import static com.android.systemui.classifier.Classifier.BRIGHTNESS_SLIDER;
import static com.android.systemui.classifier.Classifier.LEFT_AFFORDANCE;
@@ -73,6 +74,7 @@ public class TypeClassifier extends FalsingClassifier {
            case NOTIFICATION_DISMISS:
                wrongDirection = vertical;
                break;
            case ALTERNATE_BOUNCER_SWIPE:
            case UNLOCK:
            case BOUNCER_UNLOCK:
                wrongDirection = !vertical || !up;
+45 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.systemui.keyguard.ui

import android.content.Context
import android.view.MotionEvent
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.settings.DisplayTracker
import com.android.systemui.statusbar.gesture.SwipeUpGestureHandler
import com.android.systemui.statusbar.gesture.SwipeUpGestureLogger
import javax.inject.Inject

/** A class to detect when a user swipes up anywhere on the display. */
@SysUISingleton
class SwipeUpAnywhereGestureHandler
@Inject
constructor(
    context: Context,
    displayTracker: DisplayTracker,
    logger: SwipeUpGestureLogger,
) :
    SwipeUpGestureHandler(
        context,
        displayTracker,
        logger,
        loggerTag = "SwipeUpAnywhereGestureHandler"
    ) {
    override fun startOfGestureIsWithinBounds(ev: MotionEvent): Boolean {
        return true
    }
}
Loading