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

Commit 847f1229 authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Add alt auth affordance for keyguard notif-taps" into sc-dev

parents 6e91d799 d47d3a91
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!-- Copyright (C) 2021 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.
-->
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <solid
      android:color="?android:attr/colorBackground"/>

    <size
        android:width="64dp"
        android:height="64dp"/>
</shape>
+7 −1
Original line number Diff line number Diff line
@@ -20,7 +20,13 @@
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- TODO: add background protection -->
    <!-- Background protection -->
    <ImageView
        android:id="@+id/udfps_keyguard_fp_bg"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/fingerprint_bg"
        android:visibility="gone"/>

    <!-- Fingerprint -->
    <ImageView
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ abstract class UdfpsAnimationView extends FrameLayout {
        return mPauseAuth ? mAlpha : 255;
    }

    boolean isPauseAuth() {
        return mPauseAuth;
    }

    private int expansionToAlpha(float expansion) {
        // Fade to 0 opacity when reaching this expansion amount
        final float maxExpansion = 0.4f;
+26 −3
Original line number Diff line number Diff line
@@ -24,10 +24,16 @@ import android.annotation.NonNull;
import android.graphics.PointF;
import android.graphics.RectF;

import com.android.systemui.Dumpable;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.util.ViewController;

import java.io.FileDescriptor;
import java.io.PrintWriter;

/**
 * Handles:
 * 1. registering for listeners when its view is attached and unregistering on view detached
@@ -39,33 +45,50 @@ import com.android.systemui.util.ViewController;
 *      - doze time event
 */
abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView>
        extends ViewController<T> {
        extends ViewController<T> implements Dumpable {
    @NonNull final StatusBarStateController mStatusBarStateController;
    @NonNull final StatusBar mStatusBar;
    @NonNull final DumpManager mDumpManger;

    private boolean mNotificationShadeExpanded;
    private int mStatusBarState;

    protected UdfpsAnimationViewController(
            T view,
            StatusBarStateController statusBarStateController,
            StatusBar statusBar) {
            @NonNull StatusBarStateController statusBarStateController,
            @NonNull StatusBar statusBar,
            @NonNull DumpManager dumpManager) {
        super(view);
        mStatusBarStateController = statusBarStateController;
        mStatusBar = statusBar;
        mDumpManger = dumpManager;
    }

    abstract @NonNull String getTag();

    @Override
    protected void onViewAttached() {
        mStatusBarStateController.addCallback(mStateListener);
        mStateListener.onStateChanged(mStatusBarStateController.getState());
        mStatusBar.addExpansionChangedListener(mStatusBarExpansionChangedListener);

        mDumpManger.registerDumpable(getTag(), this);
    }

    @Override
    protected void onViewDetached() {
        mStatusBarStateController.removeCallback(mStateListener);
        mStatusBar.removeExpansionChangedListener(mStatusBarExpansionChangedListener);

        mDumpManger.unregisterDumpable(getTag());
    }

    @Override
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        pw.println("mStatusBarState=" + StatusBarState.toShortString(mStatusBarState));
        pw.println("mNotificationShadeExpanded=" + mNotificationShadeExpanded);
        pw.println("shouldPauseAuth()=" + shouldPauseAuth());
        pw.println("isPauseAuth=" + mView.isPauseAuth());
    }

    /**
+13 −4
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@

package com.android.systemui.biometrics;

import android.annotation.NonNull;

import com.android.systemui.dump.DumpManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.phone.StatusBar;

@@ -24,9 +27,15 @@ import com.android.systemui.statusbar.phone.StatusBar;
 */
class UdfpsBpViewController extends UdfpsAnimationViewController<UdfpsBpView> {
    protected UdfpsBpViewController(
            UdfpsBpView view,
            StatusBarStateController statusBarStateController,
            StatusBar statusBar) {
        super(view, statusBarStateController, statusBar);
            @NonNull UdfpsBpView view,
            @NonNull StatusBarStateController statusBarStateController,
            @NonNull StatusBar statusBar,
            @NonNull DumpManager dumpManager) {
        super(view, statusBarStateController, statusBar, dumpManager);
    }

    @Override
    @NonNull String getTag() {
        return "UdfpsBpViewController";
    }
}
Loading