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

Commit 54af6905 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Merge remote-tracking branch 'origin/lineage-18.1' into v1-r

parents 9b909ac7 e6ffa411
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -399,6 +399,8 @@
    <protected-broadcast android:name="android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED" />
    <protected-broadcast android:name="android.net.conn.TETHER_STATE_CHANGED" />
    <protected-broadcast android:name="android.net.conn.INET_CONDITION_ACTION" />
    <!-- This broadcast is no longer sent in S but it should stay protected to avoid third party
         apps broadcasting this and confusing old system apps that may not have been updated. -->
    <protected-broadcast android:name="android.net.conn.NETWORK_CONDITIONS_MEASURED" />
    <protected-broadcast
            android:name="android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED" />
+13 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;

import com.android.systemui.R;

@@ -76,6 +77,18 @@ public class AuthBiometricFingerprintView extends AuthBiometricView {
        showTouchSensorString();
    }

    @Override
    void onFinishInflateInternal() {
        super.onFinishInflateInternal();
        if (mHasFod) {
            mIconView.setVisibility(View.INVISIBLE);
            mIconView.setPadding(0, 0, 0, 0);
            // Add IndicatorView above the biometric icon
            removeView(mIndicatorView);
            addView(mIndicatorView, indexOfChild(mIconView));
        }
    }

    private void showTouchSensorString() {
        mIndicatorView.setText(R.string.fingerprint_dialog_touch_sensor);
        mIndicatorView.setTextColor(mTextColorHint);
+27 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.biometrics.BiometricPrompt;
import android.os.Bundle;
import android.os.Handler;
@@ -40,8 +41,12 @@ import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.Dependency;
import com.android.systemui.R;

import lineageos.app.LineageContextConstants;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -186,6 +191,8 @@ public abstract class AuthBiometricView extends LinearLayout {
    protected boolean mDialogSizeAnimating;
    protected Bundle mSavedState;

    protected boolean mHasFod;

    /**
     * Delay after authentication is confirmed, before the dialog should be animated away.
     */
@@ -248,6 +255,10 @@ public abstract class AuthBiometricView extends LinearLayout {

        mAccessibilityManager = context.getSystemService(AccessibilityManager.class);

        PackageManager packageManager = context.getPackageManager();
        mHasFod = packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) &&
                packageManager.hasSystemFeature(LineageContextConstants.Features.FOD);

        mResetErrorRunnable = () -> {
            updateState(getStateForAfterError());
            handleResetAfterError();
@@ -703,9 +714,22 @@ public abstract class AuthBiometricView extends LinearLayout {
            final View child = getChildAt(i);

            if (child.getId() == R.id.biometric_icon) {
                if (this instanceof AuthBiometricFingerprintView && mHasFod) {
                    final int buttonBarHeight =
                            findViewById(R.id.button_bar).getLayoutParams().height;
                    // The view is invisible, so it still takes space and
                    // we use that to adjust for the FOD icon
                    final int fodHeight = Dependency.get(StatusBar.class).getFodHeight(true) -
                            buttonBarHeight - findViewById(R.id.button_bar).getPaddingTop();

                    child.measure(
                            MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.AT_MOST),
                            MeasureSpec.makeMeasureSpec(fodHeight, MeasureSpec.EXACTLY));
                } else {
                    child.measure(
                            MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.AT_MOST),
                            MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
                }
            } else if (child.getId() == R.id.button_bar) {
                child.measure(
                        MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.EXACTLY),
+11 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
import android.view.MotionEvent;
@@ -423,6 +424,16 @@ public class FODCircleView extends ImageView {
        dispatchHide();
    }

    public int getHeight(boolean includeDecor) {
        DisplayMetrics dm = new DisplayMetrics();
        if (includeDecor) {
            mWindowManager.getDefaultDisplay().getMetrics(dm);
        } else {
            mWindowManager.getDefaultDisplay().getRealMetrics(dm);
        }
        return dm.heightPixels - mPositionY + mSize / 2;
    }

    private void updateAlpha() {
        setAlpha(mIsDreaming ? 0.5f : 1.0f);
    }
+4 −0
Original line number Diff line number Diff line
@@ -100,6 +100,10 @@ public class FODCircleViewImpl extends SystemUI implements CommandQueue.Callback
        }
    }

    public int getHeight(boolean includeDecor) {
         return mFodCircleView.getHeight(includeDecor);
    }

    public void registerCallback(FODCircleViewImplCallback callback) {
        Assert.isMainThread();
        Slog.v(TAG, "*** register callback for " + callback);
Loading