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

Commit cdb1962e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6274245 from e8788abc to qt-qpr3-release

Change-Id: Icc985def081ac44df494d53db38eb9361f57207f
parents 3fda07fa e8788abc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import java.util.concurrent.Executor

import kotlin.math.roundToInt

const val TAG = "CameraOpTransitionController"
const val TAG = "CameraAvailabilityListener"

/**
 * Listens for usage of the Camera and controls the ScreenDecorations transition to show extra
+10 −3
Original line number Diff line number Diff line
@@ -878,9 +878,10 @@ public class ScreenDecorations extends SystemUI implements Tunable,
        private final List<Rect> mBounds = new ArrayList();
        private final Rect mBoundingRect = new Rect();
        private final Path mBoundingPath = new Path();
        // Don't initialize these because they are cached elsewhere and may not exist
        // Don't initialize these yet because they may never exist
        private Rect mProtectionRect;
        private Path mProtectionPath;
        private Path mProtectionPathOrig;
        private Rect mTotalBounds = new Rect();
        // Whether or not to show the cutout protection path
        private boolean mShowProtection = false;
@@ -969,7 +970,11 @@ public class ScreenDecorations extends SystemUI implements Tunable,
        }

        void setProtection(Path protectionPath, Rect pathBounds) {
            mProtectionPath = protectionPath;
            if (mProtectionPathOrig == null) {
                mProtectionPathOrig = new Path();
                mProtectionPath = new Path();
            }
            mProtectionPathOrig.set(protectionPath);
            mProtectionRect = pathBounds;
        }

@@ -1053,7 +1058,9 @@ public class ScreenDecorations extends SystemUI implements Tunable,
            Matrix m = new Matrix();
            transformPhysicalToLogicalCoordinates(mInfo.rotation, dw, dh, m);
            mBoundingPath.transform(m);
            if (mProtectionPath != null) {
            if (mProtectionPathOrig != null) {
                // Reset the protection path so we don't aggregate rotations
                mProtectionPath.set(mProtectionPathOrig);
                mProtectionPath.transform(m);
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public class DozeSensors {
                        mContext.getResources());
            } else {
                sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
                mSensorThreshold = sensor.getMaximumRange();
                mSensorThreshold = sensor == null ? 0 : sensor.getMaximumRange();
            }
            mSensor = sensor;
        }
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar;

import static java.lang.Float.isNaN;

import android.annotation.NonNull;
import android.content.Context;
import android.graphics.Canvas;
@@ -179,6 +181,9 @@ public class ScrimView extends View {
     * @param alpha Gradient alpha from 0 to 1.
     */
    public void setViewAlpha(float alpha) {
        if (isNaN(alpha)) {
            throw new IllegalArgumentException("alpha cannot be NaN");
        }
        if (alpha != mViewAlpha) {
            mViewAlpha = alpha;

+24 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar.phone;

import static java.lang.Float.isNaN;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -261,6 +263,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        mCurrentBehindTint = state.getBehindTint();
        mCurrentInFrontAlpha = state.getFrontAlpha();
        mCurrentBehindAlpha = state.getBehindAlpha();
        if (isNaN(mCurrentBehindAlpha) || isNaN(mCurrentInFrontAlpha)) {
            throw new IllegalStateException("Scrim opacity is NaN for state: " + state + ", front: "
                    + mCurrentInFrontAlpha + ", back: " + mCurrentBehindAlpha);
        }
        applyExpansionToAlpha();

        // Scrim might acquire focus when user is navigating with a D-pad or a keyboard.
@@ -390,6 +396,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
     * @param fraction From 0 to 1 where 0 means collapsed and 1 expanded.
     */
    public void setPanelExpansion(float fraction) {
        if (isNaN(fraction)) {
            throw new IllegalArgumentException("Fraction should not be NaN");
        }
        if (mExpansionFraction != fraction) {
            mExpansionFraction = fraction;

@@ -464,6 +473,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            mCurrentBehindTint = ColorUtils.blendARGB(ScrimState.BOUNCER.getBehindTint(),
                    mState.getBehindTint(), interpolatedFract);
        }
        if (isNaN(mBehindAlpha) || isNaN(mInFrontAlpha)) {
            throw new IllegalStateException("Scrim opacity is NaN for state: " + mState
                    + ", front: " + mInFrontAlpha + ", back: " + mBehindAlpha);
        }
    }

    /**
@@ -523,6 +536,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
            float newBehindAlpha = mState.getBehindAlpha();
            if (mCurrentBehindAlpha != newBehindAlpha) {
                mCurrentBehindAlpha = newBehindAlpha;
                if (isNaN(mCurrentBehindAlpha)) {
                    throw new IllegalStateException("Scrim opacity is NaN for state: " + mState
                            + ", back: " + mCurrentBehindAlpha);
                }
                updateScrims();
            }
        }
@@ -904,6 +921,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        pw.print(" tint=0x"); pw.println(Integer.toHexString(mScrimBehind.getTint()));

        pw.print("  mTracking="); pw.println(mTracking);

        pw.print("  mExpansionFraction="); pw.println(mExpansionFraction);
    }

    public void setWallpaperSupportsAmbientMode(boolean wallpaperSupportsAmbientMode) {
@@ -950,6 +969,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
        // in this case, back-scrim needs to be re-evaluated
        if (mState == ScrimState.AOD || mState == ScrimState.PULSING) {
            float newBehindAlpha = mState.getBehindAlpha();
            if (isNaN(newBehindAlpha)) {
                throw new IllegalStateException("Scrim opacity is NaN for state: " + mState
                        + ", back: " + mCurrentBehindAlpha);
            }
            if (mCurrentBehindAlpha != newBehindAlpha) {
                mCurrentBehindAlpha = newBehindAlpha;
                updateScrims();