Loading msdllib/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -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", Loading msdllib/src/com/google/android/msdl/domain/MSDLPlayerImpl.kt +15 −8 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)) Loading Loading
msdllib/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -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", Loading
msdllib/src/com/google/android/msdl/domain/MSDLPlayerImpl.kt +15 −8 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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)) Loading