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

Commit a2c142f9 authored by Beverly Tai's avatar Beverly Tai Committed by Automerger Merge Worker
Browse files

Merge "For devices with udfps, always show bg on udfps" into sc-dev am: d2e60974 am: 5c74ba06

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15392265

Change-Id: I11a592566f098851a05ca0cc37a3a935e81ee895
parents bb9b219d 5c74ba06
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -14,10 +14,11 @@
-->
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:shape="oval">

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

    <size
        android:width="64dp"
+42 −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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:height="65dp" android:width="46dp" android:viewportHeight="65" android:viewportWidth="46">
    <group android:translateX="8.625" android:translateY="13.625">
        <path
            android:strokeColor="#FF000000"
            android:strokeLineCap="round"
            android:strokeLineJoin="round"
            android:strokeWidth="2.5"
            android:pathData="M4.75 15 C4.75,15 23.25,15 23.25,15 C24.35,15 25.25,15.9 25.25,17 C25.25,17 25.25,33 25.25,33 C25.25,34.1 24.35,35 23.25,35 C23.25,35 4.75,35 4.75,35 C3.65,35 2.75,34.1 2.75,33 C2.75,33 2.75,17 2.75,17 C2.75,15.9 3.65,15 4.75,15c " />
    </group>
    <group android:translateX="14" android:translateY="13.5">
        <path
            android:strokeColor="#FF000000"
            android:strokeLineCap="round"
            android:strokeLineJoin="round"
            android:strokeWidth="2.5"
            android:pathData="M27.19 14.81 C27.19,14.81 27.19,8.3 27.19,8.3 C27.19,4.92 24.44,2.88 21.19,2.75 C17.74,2.62 15,4.74 15,8.11 C15,8.11 15,15 15,15 " />
    </group>
    <group android:translateX="20" android:translateY="35.75">
        <path
            android:fillColor="#FF000000"
            android:fillAlpha="1"
            android:fillType="nonZero"
            android:pathData=" M2.75 5.25 C4.13,5.25 5.25,4.13 5.25,2.75 C5.25,1.37 4.13,0.25 2.75,0.25 C1.37,0.25 0.25,1.37 0.25,2.75 C0.25,4.13 1.37,5.25 2.75,5.25c " />
    </group>
</vector>
+17 −3
Original line number Diff line number Diff line
@@ -55,9 +55,23 @@
        android:id="@+id/lock_icon_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center">
        <!-- Background protection -->
        <ImageView
            android:id="@+id/lock_icon_bg"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/fingerprint_bg"
            android:visibility="invisible"/>

        <ImageView
            android:id="@+id/lock_icon"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="48px"
            android:layout_gravity="center"
            android:scaleType="centerCrop"/>
    </com.android.keyguard.LockIconView>

    <com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer
        android:layout_width="match_parent"
+1 −2
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@
        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"/>
        android:src="@drawable/fingerprint_bg"/>

    <!-- Fingerprint -->
    <!-- AOD dashed fingerprint icon with moving dashes -->
+37 −2
Original line number Diff line number Diff line
@@ -17,15 +17,20 @@
package com.android.keyguard;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.android.settingslib.Utils;
import com.android.systemui.Dumpable;
import com.android.systemui.R;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -33,16 +38,47 @@ import java.io.PrintWriter;
/**
 * A view positioned under the notification shade.
 */
public class LockIconView extends ImageView implements Dumpable {
public class LockIconView extends FrameLayout implements Dumpable {
    @NonNull private final RectF mSensorRect;
    @NonNull private PointF mLockIconCenter = new PointF(0f, 0f);
    private int mRadius;

    private ImageView mLockIcon;
    private ImageView mUnlockBgView;

    private int mLockIconColor;

    public LockIconView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mSensorRect = new RectF();
    }

    @Override
    public void onFinishInflate() {
        super.onFinishInflate();
        mLockIcon = findViewById(R.id.lock_icon);
        mUnlockBgView = findViewById(R.id.lock_icon_bg);
    }

    void updateColorAndBackgroundVisibility(boolean useBackground) {
        if (useBackground) {
            mLockIconColor = Utils.getColorAttrDefaultColor(getContext(),
                    android.R.attr.textColorPrimary);
            mUnlockBgView.setBackground(getContext().getDrawable(R.drawable.fingerprint_bg));
            mUnlockBgView.setVisibility(View.VISIBLE);
        } else {
            mLockIconColor = Utils.getColorAttrDefaultColor(getContext(),
                    R.attr.wallpaperTextColorAccent);
            mUnlockBgView.setVisibility(View.GONE);
        }

        mLockIcon.setImageTintList(ColorStateList.valueOf(mLockIconColor));
    }

    void setImageDrawable(Drawable drawable) {
        mLockIcon.setImageDrawable(drawable);
    }

    void setCenterLocation(@NonNull PointF center, int radius) {
        mLockIconCenter = center;
        mRadius = radius;
@@ -70,7 +106,6 @@ public class LockIconView extends ImageView implements Dumpable {
        return mLockIconCenter.y - mRadius;
    }


    @Override
    public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
        pw.println("Center in px (x, y)= (" + mLockIconCenter.x + ", " + mLockIconCenter.y + ")");
Loading