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

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

Snap for 10255809 from 1cb2fb89 to udc-release

Change-Id: I4c7c00ff2c2371fa8483c38ae92447e14cc81090
parents 53c6a1cb 1cb2fb89
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -827,6 +827,12 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
     */
    public static final int PRIVATE_FLAG_EXT_ALLOWLISTED_FOR_HIDDEN_APIS = 1 << 4;

    /**
     * Whether AbiOverride was used when installing this application.
     * @hide
     */
    public static final int PRIVATE_FLAG_EXT_CPU_OVERRIDE = 1 << 5;

    /** @hide */
    @IntDef(flag = true, prefix = { "PRIVATE_FLAG_EXT_" }, value = {
            PRIVATE_FLAG_EXT_PROFILEABLE,
@@ -834,6 +840,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
            PRIVATE_FLAG_EXT_ATTRIBUTIONS_ARE_USER_VISIBLE,
            PRIVATE_FLAG_EXT_ENABLE_ON_BACK_INVOKED_CALLBACK,
            PRIVATE_FLAG_EXT_ALLOWLISTED_FOR_HIDDEN_APIS,
            PRIVATE_FLAG_EXT_CPU_OVERRIDE,
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ApplicationInfoPrivateFlagsExt {}
+15 −1
Original line number Diff line number Diff line
@@ -56,7 +56,19 @@ data class TurbulenceNoiseAnimationConfig(
    val easeOutDuration: Float = DEFAULT_EASING_DURATION_IN_MILLIS,
    val pixelDensity: Float = 1f,
    val blendMode: BlendMode = DEFAULT_BLEND_MODE,
    val onAnimationEnd: Runnable? = null
    val onAnimationEnd: Runnable? = null,
    /**
     * Variants in noise. Higher number means more contrast; lower number means less contrast but
     * make the noise dimmed. You may want to increase the [lumaMatteBlendFactor] to compensate.
     * Expected range [0, 1].
     */
    val lumaMatteBlendFactor: Float = DEFAULT_LUMA_MATTE_BLEND_FACTOR,
    /**
     * Offset for the overall brightness in noise. Higher number makes the noise brighter. You may
     * want to use this if you have made the noise softer using [lumaMatteBlendFactor]. Expected
     * range [0, 1].
     */
    val lumaMatteOverallBrightness: Float = DEFAULT_LUMA_MATTE_OVERALL_BRIGHTNESS
) {
    companion object {
        const val DEFAULT_MAX_DURATION_IN_MILLIS = 30_000f // Max 30 sec
@@ -66,6 +78,8 @@ data class TurbulenceNoiseAnimationConfig(
        const val DEFAULT_NOISE_SPEED_Z = 0.3f
        const val DEFAULT_OPACITY = 150 // full opacity is 255.
        const val DEFAULT_COLOR = Color.WHITE
        const val DEFAULT_LUMA_MATTE_BLEND_FACTOR = 1f
        const val DEFAULT_LUMA_MATTE_OVERALL_BRIGHTNESS = 0f
        const val DEFAULT_BACKGROUND_COLOR = Color.BLACK
        val DEFAULT_BLEND_MODE = BlendMode.SRC_OVER
    }
+37 −7
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ class TurbulenceNoiseShader(useFractal: Boolean = false) :
            uniform float in_opacity;
            uniform float in_pixelDensity;
            uniform float in_inverseLuma;
            uniform half in_lumaMatteBlendFactor;
            uniform half in_lumaMatteOverallBrightness;
            layout(color) uniform vec4 in_color;
            layout(color) uniform vec4 in_backgroundColor;
        """
@@ -48,18 +50,21 @@ class TurbulenceNoiseShader(useFractal: Boolean = false) :
                uv.x *= in_aspectRatio;

                vec3 noiseP = vec3(uv + in_noiseMove.xy, in_noiseMove.z) * in_gridNum;
                float luma = abs(in_inverseLuma - simplex3d(noiseP)) * in_opacity;
                // Bring it to [0, 1] range.
                float luma = (simplex3d(noiseP) * in_inverseLuma) * 0.5 + 0.5;
                luma = saturate(luma * in_lumaMatteBlendFactor + in_lumaMatteOverallBrightness)
                        * in_opacity;
                vec3 mask = maskLuminosity(in_color.rgb, luma);
                vec3 color = in_backgroundColor.rgb + mask * 0.6;

                // Add dither with triangle distribution to avoid color banding. Ok to dither in the
                // Add dither with triangle distribution to avoid color banding. Dither in the
                // shader here as we are in gamma space.
                float dither = triangleNoise(p * in_pixelDensity) / 255.;

                // The result color should be pre-multiplied, i.e. [R*A, G*A, B*A, A], thus need to
                // multiply rgb with a to get the correct result.
                color = (color + dither.rrr) * in_color.a;
                return vec4(color, in_color.a);
                color = (color + dither.rrr) * in_opacity;
                return vec4(color, in_opacity);
            }
        """

@@ -70,12 +75,15 @@ class TurbulenceNoiseShader(useFractal: Boolean = false) :
                uv.x *= in_aspectRatio;

                vec3 noiseP = vec3(uv + in_noiseMove.xy, in_noiseMove.z) * in_gridNum;
                float luma = abs(in_inverseLuma - simplex3d_fractal(noiseP)) * in_opacity;
                // Bring it to [0, 1] range.
                float luma = (simplex3d_fractal(noiseP) * in_inverseLuma) * 0.5 + 0.5;
                luma = saturate(luma * in_lumaMatteBlendFactor + in_lumaMatteOverallBrightness)
                        * in_opacity;
                vec3 mask = maskLuminosity(in_color.rgb, luma);
                vec3 color = in_backgroundColor.rgb + mask * 0.6;

                // Skip dithering.
                return vec4(color * in_color.a, in_color.a);
                return vec4(color * in_opacity, in_opacity);
            }
        """

@@ -124,6 +132,28 @@ class TurbulenceNoiseShader(useFractal: Boolean = false) :
        setFloatUniform("in_aspectRatio", width / max(height, 0.001f))
    }

    /**
     * Sets blend and brightness factors of the luma matte.
     *
     * @param lumaMatteBlendFactor increases or decreases the amount of variance in noise. Setting
     *   this a lower number removes variations. I.e. the turbulence noise will look more blended.
     *   Expected input range is [0, 1]. more dimmed.
     * @param lumaMatteOverallBrightness adds the overall brightness of the turbulence noise.
     *   Expected input range is [0, 1].
     *
     * Example usage: You may want to apply a small number to [lumaMatteBlendFactor], such as 0.2,
     * which makes the noise look softer. However it makes the overall noise look dim, so you want
     * offset something like 0.3 for [lumaMatteOverallBrightness] to bring back its overall
     * brightness.
     */
    fun setLumaMatteFactors(
        lumaMatteBlendFactor: Float = 1f,
        lumaMatteOverallBrightness: Float = 0f
    ) {
        setFloatUniform("in_lumaMatteBlendFactor", lumaMatteBlendFactor)
        setFloatUniform("in_lumaMatteOverallBrightness", lumaMatteOverallBrightness)
    }

    /**
     * Sets whether to inverse the luminosity of the noise.
     *
@@ -132,7 +162,7 @@ class TurbulenceNoiseShader(useFractal: Boolean = false) :
     * true.
     */
    fun setInverseNoiseLuminosity(inverse: Boolean) {
        setFloatUniform("in_inverseLuma", if (inverse) 1f else 0f)
        setFloatUniform("in_inverseLuma", if (inverse) -1f else 1f)
    }

    /** Current noise movements in x, y, and z axes. */
+3 −1
Original line number Diff line number Diff line
@@ -215,10 +215,12 @@ class TurbulenceNoiseView(context: Context?, attrs: AttributeSet?) : View(contex
        noiseConfig = config
        with(turbulenceNoiseShader) {
            setGridCount(config.gridCount)
            setColor(ColorUtils.setAlphaComponent(config.color, config.opacity))
            setColor(config.color)
            setBackgroundColor(config.backgroundColor)
            setSize(config.width, config.height)
            setPixelDensity(config.pixelDensity)
            setInverseNoiseLuminosity(inverse = false)
            setLumaMatteFactors(config.lumaMatteBlendFactor, config.lumaMatteOverallBrightness)
        }
        paint.blendMode = config.blendMode
    }
+2 −2
Original line number Diff line number Diff line
@@ -2724,8 +2724,8 @@
    <string name="media_output_broadcast_last_update_error">Can\u2019t save.</string>
    <!-- The hint message when Broadcast code is less than 4 characters [CHAR LIMIT=60] -->
    <string name="media_output_broadcast_code_hint_no_less_than_min">Use at least 4 characters</string>
    <!-- The hint message when Broadcast code is more than 16 characters [CHAR LIMIT=60] -->
    <string name="media_output_broadcast_code_hint_no_more_than_max">Use fewer than 16 characters</string>
    <!-- The hint message when Broadcast edit is more than 16/254 characters [CHAR LIMIT=60] -->
    <string name="media_output_broadcast_edit_hint_no_more_than_max">Use fewer than <xliff:g id="length" example="16">%1$d</xliff:g> characters</string>

    <!-- Label for clip data when copying the build number off QS [CHAR LIMIT=NONE]-->
    <string name="build_number_clip_data_label">Build number</string>
Loading