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

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

Snap for 12637843 from c5c73a8b to 25Q1-release

Change-Id: I2b4d0f9202a5f60f8f7aaa23f90dd0ec65427d63
parents 7ab5aff8 c5c73a8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ android_library {
    name: "msdl",
    manifest: "AndroidManifest.xml",
    sdk_version: "system_current",
    min_sdk_version: "33",
    min_sdk_version: "31",
    static_libs: [
        "kotlinx_coroutines_android",
        "androidx.annotation_annotation",
+15 −8
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.google.android.msdl.domain

import android.os.Build
import android.os.VibrationAttributes
import android.os.VibrationEffect
import android.os.Vibrator
@@ -87,15 +88,21 @@ internal class MSDLPlayerImpl(
                    }
                }

            // 2. Deliver the haptics with attributes
            // 2. Deliver the haptics with or without attributes
            if (effect == null || !vibrator.hasVibrator()) return
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                val attributes =
                    if (properties?.vibrationAttributes != null) {
                        properties.vibrationAttributes
                    } else {
                    VibrationAttributes.Builder().setUsage(VibrationAttributes.USAGE_TOUCH).build()
                        VibrationAttributes.Builder()
                            .setUsage(VibrationAttributes.USAGE_TOUCH)
                            .build()
                    }
                executor.execute { vibrator.vibrate(effect, attributes) }
            } else {
                executor.execute { vibrator.vibrate(effect) }
            }

            // 3. Log the event
            historyLogger.addEvent(MSDLEvent(token, properties))
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ abstract class WeatherEffectBase(
    abstract val colorGradingIntensity: Float

    override fun setMatrix(matrix: Matrix) {
        this.parallaxMatrix = matrix
        this.parallaxMatrix.set(matrix)
        adjustCropping(surfaceSize)
    }