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

Commit 4b85d9ce authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9354090 from d7f99f6c to tm-qpr2-release

Change-Id: Iae388d8e71821aaf410c2f0339bcac60cdb51048
parents ab1e6710 d7f99f6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ public class ChooseTypeAndAccountActivity extends Activity
                mExistingAccounts = AccountManager.get(this).getAccountsForPackage(mCallingPackage,
                        mCallingUid);
                intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivityForResult(intent, REQUEST_ADD_ACCOUNT);
                startActivityForResult(new Intent(intent), REQUEST_ADD_ACCOUNT);
                return;
            }
        } catch (OperationCanceledException e) {
+54 −2
Original line number Diff line number Diff line
@@ -938,7 +938,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
    public void onPointerDown(long requestId, int sensorId, int x, int y,
            float minor, float major) {
        if (mService == null) {
            Slog.w(TAG, "onFingerDown: no fingerprint service");
            Slog.w(TAG, "onPointerDown: no fingerprint service");
            return;
        }

@@ -955,7 +955,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void onPointerUp(long requestId, int sensorId) {
        if (mService == null) {
            Slog.w(TAG, "onFingerDown: no fingerprint service");
            Slog.w(TAG, "onPointerUp: no fingerprint service");
            return;
        }

@@ -966,6 +966,58 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
        }
    }

    /**
     * TODO(b/218388821): The parameter list should be replaced with PointerContext.
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void onPointerDown(
            long requestId,
            int sensorId,
            int pointerId,
            float x,
            float y,
            float minor,
            float major,
            float orientation,
            long time,
            long gestureStart,
            boolean isAod) {
        if (mService == null) {
            Slog.w(TAG, "onPointerDown: no fingerprint service");
            return;
        }

        // TODO(b/218388821): Propagate all the parameters to FingerprintService.
        Slog.e(TAG, "onPointerDown: not implemented!");
    }

    /**
     * TODO(b/218388821): The parameter list should be replaced with PointerContext.
     * @hide
     */
    @RequiresPermission(USE_BIOMETRIC_INTERNAL)
    public void onPointerUp(
            long requestId,
            int sensorId,
            int pointerId,
            float x,
            float y,
            float minor,
            float major,
            float orientation,
            long time,
            long gestureStart,
            boolean isAod) {
        if (mService == null) {
            Slog.w(TAG, "onPointerUp: no fingerprint service");
            return;
        }

        // TODO(b/218388821): Propagate all the parameters to FingerprintService.
        Slog.e(TAG, "onPointerUp: not implemented!");
    }

    /**
     * @hide
     */
+24 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.Dimension;
import android.graphics.Insets;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.view.Surface.Rotation;
import android.view.SurfaceControl;
@@ -192,6 +193,29 @@ public class RotationUtils {
        }
    }

    /**
     * Same as {@link #rotatePoint}, but for float coordinates.
     */
    public static void rotatePointF(PointF inOutPoint, @Rotation int rotation,
            float parentW, float parentH) {
        float origX = inOutPoint.x;
        switch (rotation) {
            case ROTATION_0:
                return;
            case ROTATION_90:
                inOutPoint.x = inOutPoint.y;
                inOutPoint.y = parentW - origX;
                return;
            case ROTATION_180:
                inOutPoint.x = parentW - inOutPoint.x;
                inOutPoint.y = parentH - inOutPoint.y;
                return;
            case ROTATION_270:
                inOutPoint.x = parentH - inOutPoint.y;
                inOutPoint.y = origX;
        }
    }

    /**
     * Sets a matrix such that given a rotation, it transforms physical display
     * coordinates to that rotation's logical coordinates.
+24 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.util;

import static android.util.RotationUtils.rotateBounds;
import static android.util.RotationUtils.rotatePoint;
import static android.util.RotationUtils.rotatePointF;
import static android.view.Surface.ROTATION_180;
import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
@@ -25,6 +26,7 @@ import static android.view.Surface.ROTATION_90;
import static org.junit.Assert.assertEquals;

import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;

import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -79,4 +81,26 @@ public class RotationUtilsTest {
        rotatePoint(testResult, ROTATION_270, parentW, parentH);
        assertEquals(new Point(560, 60), testResult);
    }

    @Test
    public void testRotatePointF() {
        float parentW = 1000f;
        float parentH = 600f;
        PointF testPt = new PointF(60f, 40f);

        PointF testResult = new PointF(testPt);
        rotatePointF(testResult, ROTATION_90, parentW, parentH);
        assertEquals(40f, testResult.x, .1f);
        assertEquals(940f, testResult.y, .1f);

        testResult.set(testPt.x, testPt.y);
        rotatePointF(testResult, ROTATION_180, parentW, parentH);
        assertEquals(940f, testResult.x, .1f);
        assertEquals(560f, testResult.y, .1f);

        testResult.set(testPt.x, testPt.y);
        rotatePointF(testResult, ROTATION_270, parentW, parentH);
        assertEquals(560f, testResult.x, .1f);
        assertEquals(60f, testResult.y, .1f);
    }
}
+5 −1
Original line number Diff line number Diff line
@@ -219,7 +219,11 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
                insetsState.getSource(InsetsState.ITYPE_EXTRA_NAVIGATION_BAR);
        // Only insets the divider bar with task bar when it's expanded so that the rounded corners
        // will be drawn against task bar.
        if (taskBarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight) {
        // But there is no need to do it when IME showing because there are no rounded corners at
        // the bottom. This also avoids the problem of task bar height not changing when IME
        // floating.
        if (!insetsState.getSourceOrDefaultVisibility(InsetsState.ITYPE_IME)
                && taskBarInsetsSource.getFrame().height() >= mExpandedTaskBarHeight) {
            mTempRect.inset(taskBarInsetsSource.calculateVisibleInsets(mTempRect));
        }

Loading