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

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

Snap for 10306978 from 36f3373f to udc-release

Change-Id: I9b2f1ab66e5a9633956ad572a2ce4fd234beac9d
parents 723c0eb9 36f3373f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -333,6 +333,12 @@ public class TaskInfo {
     */
    public boolean isVisible;

    /**
     * Whether this task is request visible.
     * @hide
     */
    public boolean isVisibleRequested;

    /**
     * Whether this task is sleeping due to sleeping display.
     * @hide
@@ -518,6 +524,7 @@ public class TaskInfo {
                && Objects.equals(taskDescription, that.taskDescription)
                && isFocused == that.isFocused
                && isVisible == that.isVisible
                && isVisibleRequested == that.isVisibleRequested
                && isSleeping == that.isSleeping
                && Objects.equals(mTopActivityLocusId, that.mTopActivityLocusId)
                && parentTaskId == that.parentTaskId
@@ -591,6 +598,7 @@ public class TaskInfo {
        parentTaskId = source.readInt();
        isFocused = source.readBoolean();
        isVisible = source.readBoolean();
        isVisibleRequested = source.readBoolean();
        isSleeping = source.readBoolean();
        topActivityInSizeCompat = source.readBoolean();
        topActivityEligibleForLetterboxEducation = source.readBoolean();
@@ -644,6 +652,7 @@ public class TaskInfo {
        dest.writeInt(parentTaskId);
        dest.writeBoolean(isFocused);
        dest.writeBoolean(isVisible);
        dest.writeBoolean(isVisibleRequested);
        dest.writeBoolean(isSleeping);
        dest.writeBoolean(topActivityInSizeCompat);
        dest.writeBoolean(topActivityEligibleForLetterboxEducation);
@@ -687,6 +696,7 @@ public class TaskInfo {
                + " parentTaskId=" + parentTaskId
                + " isFocused=" + isFocused
                + " isVisible=" + isVisible
                + " isVisibleRequested=" + isVisibleRequested
                + " isSleeping=" + isSleeping
                + " topActivityInSizeCompat=" + topActivityInSizeCompat
                + " topActivityEligibleForLetterboxEducation= "
+1 −2
Original line number Diff line number Diff line
@@ -190,8 +190,7 @@ public final class PowerManager {
    /**
     * Wake lock flag: Turn the screen on when the wake lock is acquired.
     * <p>
     * This flag requires {@link android.Manifest.permission#TURN_SCREEN_ON} for apps targeting
     * Android version {@link Build.VERSION_CODES#UPSIDE_DOWN_CAKE} and higher.
     * This flag will require {@link android.Manifest.permission#TURN_SCREEN_ON} in future releases.
     * </p><p>
     * Normally wake locks don't actually wake the device, they just cause the screen to remain on
     * once it's already on. This flag will cause the device to wake up when the wake lock is
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ public class FeatureFlagUtils {
        DEFAULT_FLAGS.put(SETTINGS_BIOMETRICS2_ENROLLMENT, "false");
        DEFAULT_FLAGS.put(SETTINGS_ACCESSIBILITY_HEARING_AID_PAGE, "true");
        DEFAULT_FLAGS.put(SETTINGS_PREFER_ACCESSIBILITY_MENU_IN_SYSTEM, "false");
        DEFAULT_FLAGS.put(SETTINGS_AUDIO_ROUTING, "true");
        DEFAULT_FLAGS.put(SETTINGS_AUDIO_ROUTING, "false");
        DEFAULT_FLAGS.put(SETTINGS_FLASH_NOTIFICATIONS, "true");
        DEFAULT_FLAGS.put(SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS, "true");
        DEFAULT_FLAGS.put(SETTINGS_ENABLE_LOCKSCREEN_TRANSFER_API, "true");
+34 −8
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyStoreCryptoOperation;
import android.system.keystore2.Authorization;

import libcore.util.EmptyArray;

@@ -119,6 +120,14 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        mCipher = null;
    }

    private Authorization[] getKeyCharacteristics(Key key) {
        if (!(key instanceof AndroidKeyStoreKey)) {
            return new Authorization[] {};
        }

        return ((AndroidKeyStoreKey) key).getAuthorizations();
    }

    @Override
    protected final void engineInit(int opmode, Key key, SecureRandom random)
            throws InvalidKeyException {
@@ -173,7 +182,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
            init(opmode, key, random);
            initAlgorithmSpecificParameters();
            try {
                ensureKeystoreOperationInitialized();
                ensureKeystoreOperationInitialized(getKeyCharacteristics(key));
            } catch (InvalidAlgorithmParameterException e) {
                throw new InvalidKeyException(e);
            }
@@ -206,7 +215,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        try {
            init(opmode, key, random);
            initAlgorithmSpecificParameters(params);
            ensureKeystoreOperationInitialized();
            ensureKeystoreOperationInitialized(getKeyCharacteristics(key));
            success = true;
        } finally {
            if (!success) {
@@ -236,7 +245,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        try {
            init(opmode, key, random);
            initAlgorithmSpecificParameters(params);
            ensureKeystoreOperationInitialized();
            ensureKeystoreOperationInitialized(getKeyCharacteristics(key));
            success = true;
        } finally {
            if (!success) {
@@ -310,7 +319,8 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        mCachedException = null;
    }

    private void ensureKeystoreOperationInitialized() throws InvalidKeyException,
    private void ensureKeystoreOperationInitialized(Authorization[] keyCharacteristics)
            throws InvalidKeyException,
            InvalidAlgorithmParameterException {
        if (mMainDataStreamer != null) {
            return;
@@ -323,7 +333,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        }

        List<KeyParameter> parameters = new ArrayList<>();
        addAlgorithmSpecificParametersToBegin(parameters);
        addAlgorithmSpecificParametersToBegin(parameters, keyCharacteristics);

        int purpose;
        if (mKeymasterPurposeOverride != -1) {
@@ -404,7 +414,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
            return null;
        }
        try {
            ensureKeystoreOperationInitialized();
            ensureKeystoreOperationInitialized(getKeyCharacteristics(mKey));
        } catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
            mCachedException = e;
            return null;
@@ -520,7 +530,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        }

        try {
            ensureKeystoreOperationInitialized();
            ensureKeystoreOperationInitialized(getKeyCharacteristics(mKey));
        } catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
            mCachedException = e;
            return;
@@ -597,7 +607,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
        }

        try {
            ensureKeystoreOperationInitialized();
            ensureKeystoreOperationInitialized(getKeyCharacteristics(mKey));
        } catch (InvalidKeyException | InvalidAlgorithmParameterException e) {
            throw (IllegalBlockSizeException) new IllegalBlockSizeException().initCause(e);
        }
@@ -1011,6 +1021,22 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
    protected abstract void addAlgorithmSpecificParametersToBegin(
            @NonNull List<KeyParameter> parameters);

    /**
     * Invoked to add algorithm-specific parameters for the KeyStore's {@code begin} operation,
     * including the key characteristics. This is useful in case the parameters to {@code begin}
     * depend on how the key was generated.
     * The default implementation provided here simply ignores these key characteristics because
     * they are not be needed for most engines.
     *
     * @param parameters keystore/keymaster arguments to be populated with algorithm-specific
     *                   parameters.
     * @param keyCharacteristics The key's characteristics.
     */
    protected void addAlgorithmSpecificParametersToBegin(
            @NonNull List<KeyParameter> parameters, Authorization[] keyCharacteristics) {
        addAlgorithmSpecificParametersToBegin(parameters);
    }

    /**
     * Invoked to obtain algorithm-specific parameters from the result of the KeyStore's
     * {@code begin} operation.
+23 −5
Original line number Diff line number Diff line
@@ -288,17 +288,35 @@ abstract class AndroidKeyStoreRSACipherSpi extends AndroidKeyStoreCipherSpiBase
            }
        }

        private static boolean isMgfDigestTagPresentInKeyProperties(
                Authorization[] keyCharacteristics) {
            for (Authorization authorization : keyCharacteristics) {
                if (authorization.keyParameter.tag == KeymasterDefs.KM_TAG_RSA_OAEP_MGF_DIGEST) {
                    return true;
                }
            }

            return false;
        }

        @Override
        protected final void addAlgorithmSpecificParametersToBegin(
                @NonNull List<KeyParameter> parameters) {
            super.addAlgorithmSpecificParametersToBegin(parameters);
                @NonNull List<KeyParameter> parameters, Authorization[] keyCharacteristics) {
            super.addAlgorithmSpecificParametersToBegin(parameters, keyCharacteristics);
            parameters.add(KeyStore2ParameterUtils.makeEnum(
                    KeymasterDefs.KM_TAG_DIGEST, mKeymasterDigest
            ));
            // Only add the KM_TAG_RSA_OAEP_MGF_DIGEST tag to begin() if the MGF Digest is
            // present in the key properties. Keys generated prior to Android 14 did not have
            // this tag (Keystore didn't add it) so specifying any MGF digest tag would cause
            // a begin() operation (on an Android 14 device) to fail (with a key that was generated
            // on Android 13 or below).
            if (isMgfDigestTagPresentInKeyProperties(keyCharacteristics)) {
                parameters.add(KeyStore2ParameterUtils.makeEnum(
                        KeymasterDefs.KM_TAG_RSA_OAEP_MGF_DIGEST, mKeymasterMgf1Digest
                ));
            }
        }

        @Override
        protected final void loadAlgorithmSpecificParametersFromBeginResult(
Loading