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

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

Merge cherrypicks of ['googleplex-android-review.googlesource.com/26620869',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/26620869', 'googleplex-android-review.googlesource.com/26620870', 'googleplex-android-review.googlesource.com/26588797', 'googleplex-android-review.googlesource.com/26600850'] into 24Q2-release.

Change-Id: I6d3cdded973e291953847f48db53072dc4792bc1
parents c176aaad d05ece78
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@
# limitations under the License.

#
# Sony DS4 motion sensor configuration file.
# Sony Playstation(R) DualShock 4 Controller
#

## Motion sensor ##

# reporting mode 0 - continuous
sensor.accelerometer.reportingMode = 0
# The delay between sensor events corresponding to the lowest frequency in microsecond
@@ -33,3 +35,28 @@ sensor.gyroscope.maxDelay = 100000
sensor.gyroscope.minDelay = 5000
# The power in mA used by this sensor while in use
sensor.gyroscope.power = 0.8

## Touchpad ##

# After the DualShock 4 has been connected over Bluetooth for a minute or so,
# its reports start bunching up in time, meaning that we receive 2–4 reports
# within a millisecond followed by a >10ms wait until the next batch.
#
# This uneven timing causes the apparent speed of a finger (calculated using
# time deltas between received reports) to vary dramatically even if it's
# actually moving smoothly across the touchpad, triggering the touchpad stack's
# drumroll detection logic. For moving fingers, the drumroll detection logic
# splits the finger's single movement into many small movements of consecutive
# touches, which are then inhibited by the click wiggle filter. For tapping
# fingers, it prevents tapping to click because it thinks the finger's moving
# too fast.
#
# Since this touchpad doesn't seem to have to drumroll issues, we can safely
# disable drumroll detection.
gestureProp.Drumroll_Suppression_Enable = 0

# Because of the way this touchpad is positioned, touches around the edges are
# no more likely to be palms than ones in the middle, so remove the edge zones
# from the palm classifier to increase the usable area of the pad.
gestureProp.Palm_Edge_Zone_Width = 0
gestureProp.Tap_Exclusion_Border_Width = 0
+28 −1
Original line number Diff line number Diff line
@@ -13,9 +13,11 @@
# limitations under the License.

#
# Sony DS4 motion sensor configuration file.
# Sony Playstation(R) DualShock 4 Controller
#

## Motion sensor ##

# reporting mode 0 - continuous
sensor.accelerometer.reportingMode = 0
# The delay between sensor events corresponding to the lowest frequency in microsecond
@@ -33,3 +35,28 @@ sensor.gyroscope.maxDelay = 100000
sensor.gyroscope.minDelay = 5000
# The power in mA used by this sensor while in use
sensor.gyroscope.power = 0.8

## Touchpad ##

# After the DualShock 4 has been connected over Bluetooth for a minute or so,
# its reports start bunching up in time, meaning that we receive 2–4 reports
# within a millisecond followed by a >10ms wait until the next batch.
#
# This uneven timing causes the apparent speed of a finger (calculated using
# time deltas between received reports) to vary dramatically even if it's
# actually moving smoothly across the touchpad, triggering the touchpad stack's
# drumroll detection logic. For moving fingers, the drumroll detection logic
# splits the finger's single movement into many small movements of consecutive
# touches, which are then inhibited by the click wiggle filter. For tapping
# fingers, it prevents tapping to click because it thinks the finger's moving
# too fast.
#
# Since this touchpad doesn't seem to have drumroll issues, we can safely
# disable drumroll detection.
gestureProp.Drumroll_Suppression_Enable = 0

# Because of the way this touchpad is positioned, touches around the edges are
# no more likely to be palms than ones in the middle, so remove the edge zones
# from the palm classifier to increase the usable area of the pad.
gestureProp.Palm_Edge_Zone_Width = 0
gestureProp.Tap_Exclusion_Border_Width = 0
+3 −30
Original line number Diff line number Diff line
@@ -109,29 +109,13 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato
        }
    }

    // For curve 25519, KeyMint uses the KM_ALGORITHM_EC constant, but in the Java layer we need
    // to distinguish between Curve 25519 and other EC algorithms, so we use a different constant
    // with a value that is outside the range of the enum used for KeyMint algorithms.
    private static final int ALGORITHM_XDH = KeymasterDefs.KM_ALGORITHM_EC + 1200;
    private static final int ALGORITHM_ED25519 = ALGORITHM_XDH + 1;

    /**
     * XDH represents Curve 25519 agreement key provider.
     * XDH represents Curve 25519 providers.
     */
    public static class XDH extends AndroidKeyStoreKeyPairGeneratorSpi {
        // XDH is treated as EC.
        public XDH() {
            super(ALGORITHM_XDH);
        }
    }

    /**
     * ED25519 represents Curve 25519 signing key provider.
     */
    public static class ED25519 extends AndroidKeyStoreKeyPairGeneratorSpi {
        // ED25519 is treated as EC.
        public ED25519() {
            super(ALGORITHM_ED25519);
            super(KeymasterDefs.KM_ALGORITHM_EC);
        }
    }

@@ -257,9 +241,7 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato

            KeyGenParameterSpec spec;
            boolean encryptionAtRestRequired = false;
            int keymasterAlgorithm = (mOriginalKeymasterAlgorithm == ALGORITHM_XDH
                    || mOriginalKeymasterAlgorithm == ALGORITHM_ED25519)
                    ? KeymasterDefs.KM_ALGORITHM_EC : mOriginalKeymasterAlgorithm;
            int keymasterAlgorithm = mOriginalKeymasterAlgorithm;
            if (params instanceof KeyGenParameterSpec) {
                spec = (KeyGenParameterSpec) params;
            } else if (params instanceof KeyPairGeneratorSpec) {
@@ -628,15 +610,6 @@ public abstract class AndroidKeyStoreKeyPairGeneratorSpi extends KeyPairGenerato
                if (algSpecificSpec instanceof ECGenParameterSpec) {
                    ECGenParameterSpec ecSpec = (ECGenParameterSpec) algSpecificSpec;
                    mEcCurveName = ecSpec.getName();
                    if (mOriginalKeymasterAlgorithm == ALGORITHM_XDH
                            && !mEcCurveName.equalsIgnoreCase("x25519")) {
                        throw new InvalidAlgorithmParameterException("XDH algorithm only supports"
                                + " x25519 curve.");
                    } else if (mOriginalKeymasterAlgorithm == ALGORITHM_ED25519
                            && !mEcCurveName.equalsIgnoreCase("ed25519")) {
                        throw new InvalidAlgorithmParameterException("Ed25519 algorithm only"
                                + " supports ed25519 curve.");
                    }
                    final Integer ecSpecKeySizeBits = SUPPORTED_EC_CURVE_NAME_TO_SIZE.get(
                            mEcCurveName.toLowerCase(Locale.US));
                    if (ecSpecKeySizeBits == null) {
+0 −3
Original line number Diff line number Diff line
@@ -85,14 +85,11 @@ public class AndroidKeyStoreProvider extends Provider {
        put("KeyPairGenerator.EC", PACKAGE_NAME + ".AndroidKeyStoreKeyPairGeneratorSpi$EC");
        put("KeyPairGenerator.RSA", PACKAGE_NAME +  ".AndroidKeyStoreKeyPairGeneratorSpi$RSA");
        put("KeyPairGenerator.XDH", PACKAGE_NAME +  ".AndroidKeyStoreKeyPairGeneratorSpi$XDH");
        put("KeyPairGenerator.ED25519", PACKAGE_NAME
                +  ".AndroidKeyStoreKeyPairGeneratorSpi$ED25519");

        // java.security.KeyFactory
        putKeyFactoryImpl("EC");
        putKeyFactoryImpl("RSA");
        putKeyFactoryImpl("XDH");
        putKeyFactoryImpl("ED25519");

        // javax.crypto.KeyGenerator
        put("KeyGenerator.AES", PACKAGE_NAME + ".AndroidKeyStoreKeyGeneratorSpi$AES");