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

Commit c4fe1b0d authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-23.0' into a16

parents 47e4941c 1da07de1
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -21,11 +21,16 @@
    <!-- Whether to enable framework dimming for UDFPS -->
    <bool name="config_udfpsFrameworkDimming">false</bool>

    <!-- Array of brightness-alpha LUT for framework dimming -->
    <!-- Brightness-to-alpha lookup table (LUT) for UDFPS framework dimming.
         Each entry is in the format <brightness>,<alpha> where:
           - brightness = panel backlight level
           - alpha = dim layer transparency applied at that brightness
         Rules:
           • The entries should be strictly ascending by brightness.
           • First entry = <minBrightness,maxAlpha>.
           • Last entry  = <maxBrightness,minAlpha>.
    -->
    <string-array name="config_udfpsDimmingBrightnessAlphaArray" translatable="false">
          <item>0,255</item>
          <item>1,248</item>
          <item>2,242</item>
          <item>3,238</item>
          <item>4,236</item>
          <item>6,236</item>
+3 −2
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ class UdfpsHelper(
            val (brightness, alpha) = it.split(",").map { value -> value.trim().toInt() }
            brightness to alpha
        }
    val maxPanelBrightness: Int = brightnessAlphaMap.keys.max()

    private val dimLayoutParams = WindowManager.LayoutParams(
        WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
@@ -83,7 +84,7 @@ class UdfpsHelper(
        flags = Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or
                WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
        privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY or
                WindowManager.LayoutParams.PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION
                WindowManager.LayoutParams.PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY
        // Avoid announcing window title
        accessibilityTitle = " "
        inputFeatures = WindowManager.LayoutParams.INPUT_FEATURE_SPY
@@ -148,7 +149,7 @@ class UdfpsHelper(
    // brightness_alpha_lut array from the kernel. This provides a comparable array.
    private fun brightnessToAlpha() {
        val adjustedBrightness =
            (currentBrightness.coerceIn(minBrightness, maxBrightness) * 4095).toInt()
            (currentBrightness.coerceIn(minBrightness, maxBrightness) * maxPanelBrightness).toInt()

        val targetAlpha = brightnessAlphaMap[adjustedBrightness]?.div(255.0f)
            ?: interpolateAlpha(adjustedBrightness)