28 Commits
bka ... vic

Author SHA1 Message Date
pabloescobar-reborn
0420f3f245 configs: add dolby instance in FM 2025-05-19 04:43:07 +09:00
Dmitry
ea81a2acc2 dolby: add missing selinux policies 2025-05-13 21:26:09 +09:00
Ghosuto
fc013ffdef dolby: Update to use new tooltip position provider API 2025-05-03 19:17:11 +02:00
Bruno Martins
d69c31b038 dolby: Migrate MainSwitchBar and Switch to Material3
This follows Settings style updates for Android U.

Change-Id: Id6d3e7f193b6ef9fa6419d164265062328eb9170
2024-11-23 04:06:25 +05:30
Abhay Singh Gill
f479eef03b dolby: DolbyManager: Add custom profile
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-11-09 01:51:40 +05:30
Abhay Singh Gill
e8ebd395d1 dolby: DolbyManager: Add icons for dolby profiles
Also nuke voice profile and fixup some strings.

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-11-09 01:51:34 +05:30
Abhay Singh Gill
296d340b6d dolby: DolbyManager: Make bass enhancer available on speakers as well
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-11-06 14:52:00 +05:30
Sarthak Roy
41a93dd519 dolby: DolbyManager: Fix building in Android 15
Change-Id: Ie4e312bce0232c7a55ed2c29c8442f886f5aabd9
2024-11-06 14:52:00 +05:30
Adithya R
750b00415a dolby: DolbyManager: Add intelligent equalizer setting
Move preference-related classes to a new package while we're at it,
to reduce code clutter.
Also fix graphical equlizer

Change-Id: I2430e8ab9b6758503ce1777ec985a3e400b55b8e
2024-11-06 14:52:00 +05:30
Aditya R
a5e3d9c63d dolby: Switch to DolbyManager
Based on existing dirac implementation and observing stock
sound effects app and daxservice.

History -
- Allow bass enhancer to use in speaker also
- Remove deprecated PlainTooltipBox
- Fix build with kotlinc 1.9.0
- Add launcher icon
- Introduce graphical equalizer
- Do not set volume leveler amount
- Restore all settings upon bootup
- Rewrite in Kotlin
- Restore dolby profile on audio changes
- Guard debug logging
- Implement profile-specific Dolby settings
- Remove play/pause hack while toggling Dolby
- Set proper summary for dolby settings
- Always refresh playback if status changed
- Introduce Dolby Atmos

Co-authored-by: Henrique Silva <jhenrique09.mcz@hotmail.com>
Co-authored-by: Pranav Vashi <neobuddy89@gmail.com>
Co-authored-by: Fabian Leutenegger <fabian.leutenegger@bluewin.ch>
Co-authored-by: basamaryan <basam.aryan@gmail.com>
Co-authored-by: Ghosuto <clash.raja10@gmail.com>
2024-11-06 14:52:00 +05:30
Abhay Singh Gill
f3fc9e46e2 dolby: Update from sssi-user 14 67.1.A.2.287 1 release-keys
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-11-06 14:51:56 +05:30
Abhay Singh Gill
939e58c22a dolby: Remove redundant audio codec flag
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-11-03 01:28:02 +05:30
Abhay Singh Gill
4ec5eeda3c dolby: Remove OnePlus specific headphone tunings
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-11 07:08:41 +05:30
Abhay Singh Gill
b2e635a522 dolby: Fixup soong modules config
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-11 07:08:25 +05:30
Abhay Singh Gill
42005cbb91 dolby: Build codec2 required packages
Incase someone ignores the README.

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-10 19:48:50 +05:30
Abhay Singh Gill
3b0d7fd56d dolby: Update DaxUI
Now settings are restored after a reboot.

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-09 05:41:56 +05:30
Abhay Singh Gill
01a21f5098 dolby: Nuke libeffectproxy.so
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-09 04:06:34 +05:30
Abhay Singh Gill
4dc3303a4c Reapply "dolby: Link dolby blobs against v33 libstagefright_foundation"
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-09 04:06:13 +05:30
Abhay Singh Gill
3fb780dd60 dolby: Kang libswdap.so from https://github.com/sony-sm8550/proprietary_vendor_sony_extra
Else the effects do not update properly.

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-08 04:04:49 +05:30
Abhay Singh Gill
4be460186b dolby: Switch to sony dolby from pdx234
Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-08-08 02:32:28 +05:30
Abhay Singh Gill
d56e3b306b dolby: DaxUI: Override MusicFX and AudioFX 2024-03-19 05:58:35 +05:30
Abhay Singh Gill
5c1afecdb5 dolby: DaxUI: Fix clipped dialogue enhancer seekbar thumb 2024-03-19 03:02:51 +05:30
Fabian Leutenegger
8d0cda23b6 dolby: Link dolby blobs against v33 libstagefright_foundation
* fixes crashes and absurdly high CPU usage while using dolby
2024-03-15 16:05:38 +05:30
Abhay Singh Gill
3a6b0ad303 dolby: Remove unused blobs 2024-03-15 14:58:24 +05:30
Abhay Singh Gill
deb7018300 Revert "dolby: Update from OnePlus 8 (OOS-11)"
This reverts commit c527d9b162.
2024-03-15 14:56:55 +05:30
Abhay Singh Gill
c8c233e40d dolby: Add path variable 2024-03-15 14:01:44 +05:30
Abhay Singh Gill
5bd62626da dolby: Update readme 2024-03-15 14:01:41 +05:30
Abhay Singh Gill
f28d0a3718 dolby: DaxUI: Add more switches
For:-
• volume leveler
• surround virtualizer
• bass enhancer

Signed-off-by: Abhay Singh Gill <abhaygill017@gmail.com>
2024-03-15 13:49:23 +05:30
46 changed files with 1005 additions and 1512 deletions

View File

@@ -14,349 +14,3 @@
soong_namespace {
}
cc_prebuilt_library_shared {
name: "libdapparamstorage",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/libdapparamstorage.so"],
shared_libs: ["libcutils", "libutils", "liblog", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/libdapparamstorage.so"],
shared_libs: ["libcutils", "libutils", "liblog", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libdlbpreg",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/libdlbpreg.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libstagefright_foundation-v33", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/libdlbpreg.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libstagefright_foundation-v33", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "vendor.dolby.hardware.dms@2.0",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/vendor.dolby.hardware.dms@2.0.so"],
shared_libs: ["libhidlbase", "liblog", "libutils", "libcutils", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/vendor.dolby.hardware.dms@2.0.so"],
shared_libs: ["libhidlbase", "liblog", "libutils", "libcutils", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libdlbdsservice",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libdlbdsservice.so"],
shared_libs: ["libutils", "libstagefright_foundation-v33", "liblog", "libxml2", "libcrypto", "libdapparamstorage", "libsqlite", "libhidlbase", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "liboem_specific",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/liboem_specific.so"],
shared_libs: ["libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "vendor.dolby.hardware.dms@2.0-impl",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/vendor.dolby.hardware.dms@2.0-impl.so"],
shared_libs: ["libhidlbase", "libutils", "liblog", "libdapparamstorage", "libdlbdsservice", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_binary {
name: "vendor.dolby.hardware.dms@2.0-service",
owner: "xiaomi",
target: {
android_arm64: {
srcs: ["proprietary/vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service"],
shared_libs: ["liblog", "libutils", "libhidlbase", "libdapparamstorage", "libdlbdsservice", "vendor.dolby.hardware.dms@2.0", "vendor.dolby.hardware.dms@2.0-impl", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
strip: {
none: true,
},
prefer: true,
relative_install_path: "hw",
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_soft_ac4dec",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libcodec2_soft_ac4dec.so"],
shared_libs: ["libhidlbase", "vendor.dolby.hardware.dms@2.0", "libdeccfg", "libstagefright_foundation-v33", "libcutils", "libbase", "liblog", "libcodec2", "libcodec2_vndk", "libutils", "libcodec2_soft_dolby", "libcodec2_store_dolby", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_soft_ddpdec",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libcodec2_soft_ddpdec.so"],
shared_libs: ["libhidlbase", "vendor.dolby.hardware.dms@2.0", "libdeccfg", "libstagefright_foundation-v33", "libcutils", "libbase", "liblog", "libcodec2", "libcodec2_vndk", "libutils", "libcodec2_soft_dolby", "libcodec2_store_dolby", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_soft_dolby",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libcodec2_soft_dolby.so"],
shared_libs: ["libbase", "libcodec2", "libcodec2_vndk", "libutils", "libcutils", "liblog", "libstagefright_foundation-v33", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libcodec2_store_dolby",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libcodec2_store_dolby.so"],
shared_libs: ["libbase", "liblog", "libcodec2", "libcodec2_vndk", "libutils", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libdeccfg",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/vendor/lib64/libdeccfg.so"],
shared_libs: ["libhidlbase", "vendor.dolby.hardware.dms@2.0", "libdapparamstorage", "libcutils", "libutils", "liblog", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
soc_specific: true,
}
cc_prebuilt_binary {
name: "vendor.dolby.media.c2@1.0-service",
owner: "xiaomi",
target: {
android_arm64: {
srcs: ["proprietary/vendor/bin/hw/vendor.dolby.media.c2@1.0-service"],
shared_libs: ["libshim_dolby", "libbase", "liblog", "libcodec2", "libutils", "android.hardware.media.c2@1.0", "android.hardware.media.c2@1.1", "android.hardware.media.c2@1.2", "libcodec2_hidl@1.0", "libcodec2_hidl@1.1", "libcodec2_hidl@1.2", "libcodec2_vndk", "libhidlbase", "libavservices_minijail", "libbinder", "libcodec2_store_dolby", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
strip: {
none: true,
},
prefer: true,
relative_install_path: "hw",
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libdlbvol",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/soundfx/libdlbvol.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libstagefright_foundation-v33", "libdlbpreg", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/soundfx/libdlbvol.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libstagefright_foundation-v33", "libdlbpreg", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
relative_install_path: "soundfx",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libswdap",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/soundfx/libswdap.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "libstagefright_foundation-v33", "libdlbpreg", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/soundfx/libswdap.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "libstagefright_foundation-v33", "libdlbpreg", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
relative_install_path: "soundfx",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libswgamedap",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/soundfx/libswgamedap.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/soundfx/libswgamedap.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
relative_install_path: "soundfx",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libswvqe",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/soundfx/libswvqe.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/soundfx/libswvqe.so"],
shared_libs: ["liblog", "libutils", "libcutils", "libaudioutils", "libdapparamstorage", "libhidlbase", "vendor.dolby.hardware.dms@2.0", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
relative_install_path: "soundfx",
prefer: true,
soc_specific: true,
}
cc_prebuilt_library_shared {
name: "libspatialaudio",
owner: "xiaomi",
strip: {
none: true,
},
target: {
android_arm: {
srcs: ["proprietary/vendor/lib/soundfx/libspatialaudio.so"],
shared_libs: ["libaudioutils", "libcutils", "liblog", "libc++", "libc", "libm", "libdl", ],
},
android_arm64: {
srcs: ["proprietary/vendor/lib64/soundfx/libspatialaudio.so"],
shared_libs: ["libaudioutils", "libcutils", "liblog", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "both",
relative_install_path: "soundfx",
prefer: true,
soc_specific: true,
}

View File

@@ -13,8 +13,7 @@
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:label="@string/dolby_title"
android:persistent="true"
android:theme="@style/Theme.SubSettingsBase.Expressive">
android:persistent="true">
<receiver
android:name=".BootCompletedReceiver"
@@ -27,6 +26,7 @@
<activity
android:name=".DolbyActivity"
android:label="@string/dolby_title"
android:theme="@style/Theme.SubSettingsBase"
android:exported="true">
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
@@ -50,6 +50,7 @@
<activity
android:name=".geq.EqualizerActivity"
android:label="@string/dolby_preset"
android:theme="@style/Theme.SubSettingsBase"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@@ -16,7 +16,7 @@ class DolbyActivity : CollapsingToolbarBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
supportFragmentManager.beginTransaction()
fragmentManager.beginTransaction()
.replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbySettingsFragment(), TAG)
.commit()
}

View File

@@ -17,13 +17,13 @@ import android.widget.Toast
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.Preference.OnPreferenceChangeListener
import androidx.preference.PreferenceFragment
import androidx.preference.SwitchPreferenceCompat
import co.aospa.dolby.DolbyConstants.Companion.dlog
import co.aospa.dolby.R
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.SettingsBasePreferenceFragment
class DolbySettingsFragment : SettingsBasePreferenceFragment(),
class DolbySettingsFragment : PreferenceFragment(),
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
private val switchBar by lazy {
@@ -57,8 +57,8 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
findPreference<Preference>(DolbyConstants.PREF_RESET)!!
}
private val dolbyController by lazy { DolbyController.getInstance(requireContext()) }
private val audioManager by lazy { requireContext().getSystemService(AudioManager::class.java) }
private val dolbyController by lazy { DolbyController.getInstance(context) }
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
private val handler = Handler()
private var isOnSpeaker = true
@@ -83,14 +83,13 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
dlog(TAG, "onCreatePreferences")
addPreferencesFromResource(R.xml.dolby_settings)
val profile = dolbyController.profile
preferenceManager.preferenceDataStore = DolbyPreferenceStore(requireContext()).also {
preferenceManager.preferenceDataStore = DolbyPreferenceStore(context).also {
it.profile = profile
}
setPreferencesFromResource(R.xml.dolby_settings, rootKey)
val dsOn = dolbyController.dsOn
switchBar.addOnSwitchChangeListener(this)
switchBar.setChecked(dsOn)
@@ -102,7 +101,7 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
summary = "%s"
value = profile.toString()
} else {
summary = getString(R.string.dolby_unknown)
summary = context.getString(R.string.dolby_unknown)
}
}
@@ -117,8 +116,8 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
dolbyController.resetProfileSpecificSettings()
updateProfileSpecificPrefs()
Toast.makeText(
requireContext(),
getString(R.string.dolby_reset_profile_toast, profilePref.summary),
context,
context.getString(R.string.dolby_reset_profile_toast, profilePref.summary),
Toast.LENGTH_SHORT
).show()
true
@@ -192,8 +191,8 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
}
private fun updateProfileSpecificPrefs() {
val unknownRes = getString(R.string.dolby_unknown)
val headphoneRes = getString(R.string.dolby_connect_headphones)
val unknownRes = context.getString(R.string.dolby_unknown)
val headphoneRes = context.getString(R.string.dolby_connect_headphones)
val dsOn = dolbyController.dsOn
val currentProfile = dolbyController.profile

View File

@@ -6,20 +6,21 @@
package co.aospa.dolby.preference
import android.content.Context
import android.media.AudioAttributes
import android.media.AudioDeviceCallback
import android.media.AudioDeviceInfo
import android.media.AudioManager
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import android.widget.CompoundButton
import android.widget.CompoundButton.OnCheckedChangeListener
import android.widget.Toast
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.Preference.OnPreferenceChangeListener
import androidx.preference.PreferenceFragment
import androidx.preference.SwitchPreferenceCompat
import co.aospa.dolby.DolbyConstants
import co.aospa.dolby.DolbyConstants.Companion.PREF_BASS
import co.aospa.dolby.DolbyConstants.Companion.PREF_DIALOGUE
import co.aospa.dolby.DolbyConstants.Companion.PREF_ENABLE
@@ -35,33 +36,47 @@ import co.aospa.dolby.DolbyConstants.Companion.dlog
import co.aospa.dolby.DolbyController
import co.aospa.dolby.R
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.SettingsBasePreferenceFragment
class DolbySettingsFragment : SettingsBasePreferenceFragment(),
Preference.OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
class DolbySettingsFragment : PreferenceFragment(),
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
private val appContext: Context
get() = requireContext().applicationContext
private val switchBar by lazy { findPreference<MainSwitchPreference>(PREF_ENABLE)!! }
private val profilePref by lazy { findPreference<ListPreference>(PREF_PROFILE)!! }
private val presetPref by lazy { findPreference<Preference>(PREF_PRESET)!! }
private val ieqPref by lazy { findPreference<DolbyIeqPreference>(PREF_IEQ)!! }
private val stereoPref by lazy { findPreference<ListPreference>(PREF_STEREO)!! }
private val dialoguePref by lazy { findPreference<ListPreference>(PREF_DIALOGUE)!! }
private val bassPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_BASS)!! }
private val hpVirtPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_HP_VIRTUALIZER)!! }
private val spkVirtPref by lazy { findPreference<SwitchPreferenceCompat>(PREF_SPK_VIRTUALIZER)!! }
private val volumePref by lazy { findPreference<SwitchPreferenceCompat>(PREF_VOLUME)!! }
private val resetPref by lazy { findPreference<Preference>(PREF_RESET)!! }
private val dolbyController by lazy(LazyThreadSafetyMode.NONE) {
DolbyController.getInstance(appContext)
private val switchBar by lazy {
findPreference<MainSwitchPreference>(PREF_ENABLE)!!
}
private val audioManager by lazy(LazyThreadSafetyMode.NONE) {
appContext.getSystemService(AudioManager::class.java)
private val profilePref by lazy {
findPreference<ListPreference>(PREF_PROFILE)!!
}
private val handler = Handler(Looper.getMainLooper())
private val presetPref by lazy {
findPreference<Preference>(PREF_PRESET)!!
}
private val ieqPref by lazy {
findPreference<DolbyIeqPreference>(PREF_IEQ)!!
}
private val stereoPref by lazy {
findPreference<ListPreference>(PREF_STEREO)!!
}
private val dialoguePref by lazy {
findPreference<ListPreference>(PREF_DIALOGUE)!!
}
private val bassPref by lazy {
findPreference<SwitchPreferenceCompat>(PREF_BASS)!!
}
private val hpVirtPref by lazy {
findPreference<SwitchPreferenceCompat>(PREF_HP_VIRTUALIZER)!!
}
private val spkVirtPref by lazy {
findPreference<SwitchPreferenceCompat>(PREF_SPK_VIRTUALIZER)!!
}
private val volumePref by lazy {
findPreference<SwitchPreferenceCompat>(PREF_VOLUME)!!
}
private val resetPref by lazy {
findPreference<Preference>(PREF_RESET)!!
}
private val dolbyController by lazy { DolbyController.getInstance(context) }
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
private val handler = Handler()
private var isOnSpeaker = true
set(value) {
@@ -85,29 +100,26 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
dlog(TAG, "onCreatePreferences")
setPreferencesFromResource(R.xml.dolby_settings, rootKey)
}
addPreferencesFromResource(R.xml.dolby_settings)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val profile = dolbyController.profile
preferenceManager.preferenceDataStore = DolbyPreferenceStore(appContext).also {
preferenceManager.preferenceDataStore = DolbyPreferenceStore(context).also {
it.profile = profile
}
val dsOn = dolbyController.dsOn
switchBar.addOnSwitchChangeListener(this)
switchBar.isChecked = dsOn
switchBar.setChecked(dsOn)
profilePref.onPreferenceChangeListener = this
updateProfileIcon(profile)
profilePref.isEnabled = dsOn
profilePref.setEnabled(dsOn)
profilePref.apply {
if (entryValues.contains(profile.toString())) {
summary = "%s"
value = profile.toString()
} else {
summary = getString(R.string.dolby_unknown)
summary = context.getString(R.string.dolby_unknown)
}
}
@@ -123,21 +135,21 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
dolbyController.resetProfileSpecificSettings()
updateProfileSpecificPrefs()
Toast.makeText(
appContext,
getString(R.string.dolby_reset_profile_toast, profilePref.summary),
context,
context.getString(R.string.dolby_reset_profile_toast, profilePref.summary),
Toast.LENGTH_SHORT
).show()
true
}
audioManager?.registerAudioDeviceCallback(audioDeviceCallback, handler)
audioManager!!.registerAudioDeviceCallback(audioDeviceCallback, handler)
updateSpeakerState()
updateProfileSpecificPrefs()
}
override fun onDestroyView() {
dlog(TAG, "onDestroyView")
audioManager?.unregisterAudioDeviceCallback(audioDeviceCallback)
audioManager!!.unregisterAudioDeviceCallback(audioDeviceCallback)
super.onDestroyView()
}
@@ -156,13 +168,35 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
updateProfileIcon(profile)
updateProfileSpecificPrefs()
}
PREF_SPK_VIRTUALIZER -> dolbyController.setSpeakerVirtEnabled(newValue as Boolean)
PREF_HP_VIRTUALIZER -> dolbyController.setHeadphoneVirtEnabled(newValue as Boolean)
PREF_STEREO -> dolbyController.setStereoWideningAmount(newValue.toString().toInt())
PREF_DIALOGUE -> dolbyController.setDialogueEnhancerAmount(newValue.toString().toInt())
PREF_BASS -> dolbyController.setBassEnhancerEnabled(newValue as Boolean)
PREF_VOLUME -> dolbyController.setVolumeLevelerEnabled(newValue as Boolean)
PREF_IEQ -> dolbyController.setIeqPreset(newValue.toString().toInt())
PREF_SPK_VIRTUALIZER -> {
dolbyController.setSpeakerVirtEnabled(newValue as Boolean)
}
PREF_HP_VIRTUALIZER -> {
dolbyController.setHeadphoneVirtEnabled(newValue as Boolean)
}
PREF_STEREO -> {
dolbyController.setStereoWideningAmount(newValue.toString().toInt())
}
PREF_DIALOGUE -> {
dolbyController.setDialogueEnhancerAmount(newValue.toString().toInt())
}
PREF_BASS -> {
dolbyController.setBassEnhancerEnabled(newValue as Boolean)
}
PREF_VOLUME -> {
dolbyController.setVolumeLevelerEnabled(newValue as Boolean)
}
PREF_IEQ -> {
dolbyController.setIeqPreset(newValue.toString().toInt())
}
else -> return false
}
return true
@@ -171,21 +205,18 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
dlog(TAG, "onCheckedChanged($isChecked)")
dolbyController.dsOn = isChecked
profilePref.isEnabled = isChecked
profilePref.setEnabled(isChecked)
updateProfileSpecificPrefs()
}
private fun updateSpeakerState() {
val devices = audioManager
?.getDevicesForAttributes(ATTRIBUTES_MEDIA)
.orEmpty()
val firstType = devices.firstOrNull()?.type
isOnSpeaker = (firstType == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
val device = audioManager!!.getDevicesForAttributes(ATTRIBUTES_MEDIA)[0]
isOnSpeaker = (device.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
}
private fun updateProfileSpecificPrefs() {
val unknownRes = getString(R.string.dolby_unknown)
val headphoneRes = getString(R.string.dolby_connect_headphones)
val unknownRes = context.getString(R.string.dolby_unknown)
val headphoneRes = context.getString(R.string.dolby_connect_headphones)
val dsOn = dolbyController.dsOn
val currentProfile = dolbyController.profile
@@ -195,15 +226,15 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
)
val enable = dsOn && (currentProfile != -1)
presetPref.isEnabled = enable
spkVirtPref.isEnabled = enable
ieqPref.isEnabled = enable
dialoguePref.isEnabled = enable
volumePref.isEnabled = enable
bassPref.isEnabled = enable
resetPref.isEnabled = enable
hpVirtPref.isEnabled = enable && !isOnSpeaker
stereoPref.isEnabled = enable && !isOnSpeaker
presetPref.setEnabled(enable)
spkVirtPref.setEnabled(enable)
ieqPref.setEnabled(enable)
dialoguePref.setEnabled(enable)
volumePref.setEnabled(enable)
bassPref.setEnabled(enable)
resetPref.setEnabled(enable)
hpVirtPref.setEnabled(enable && !isOnSpeaker)
stereoPref.setEnabled(enable && !isOnSpeaker)
if (!enable) return
@@ -229,9 +260,9 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
}
}
spkVirtPref.isChecked = dolbyController.getSpeakerVirtEnabled(currentProfile)
volumePref.isChecked = dolbyController.getVolumeLevelerEnabled(currentProfile)
bassPref.isChecked = dolbyController.getBassEnhancerEnabled(currentProfile)
spkVirtPref.setChecked(dolbyController.getSpeakerVirtEnabled(currentProfile))
volumePref.setChecked(dolbyController.getVolumeLevelerEnabled(currentProfile))
bassPref.setChecked(dolbyController.getBassEnhancerEnabled(currentProfile))
// below prefs are not enabled on loudspeaker
if (isOnSpeaker) {
@@ -251,7 +282,7 @@ class DolbySettingsFragment : SettingsBasePreferenceFragment(),
}
hpVirtPref.apply {
isChecked = dolbyController.getHeadphoneVirtEnabled(currentProfile)
setChecked(dolbyController.getHeadphoneVirtEnabled(currentProfile))
summary = null
}
}

View File

@@ -3,7 +3,7 @@ Sony Dolby
Getting Started
---------------
For dolby media codecs to work add this line in your media codecs config (should be in vendor partition) :-
For dolby media codecs to work add this line in your media codecs config (should be in vendor partition) and make sure your device supports c2 codecs. :-
```bash
<Include href="media_codecs_dolby_audio.xml" />
@@ -42,20 +42,4 @@ DEVICE_MANIFEST_FILE +=
The only change done above is changing := symbol to += so that manifest can't be overriden from device tree in BoardConfig makefile.
At the end an example commit to properly implement it in your device tree could be :-
[**1**] https://github.com/Spanish-or-Vanish/android_device_xiaomi_sm8350-common/commit/8ece9a976087ed03f1adb447d0ac2a3f5f1a0d3c
[**2**] https://github.com/Spanish-or-Vanish/android_device_xiaomi_sm8350-common/commit/f5abe4a589d54d8363b0f3458e09e3c069cf6384
#### Tip pick anyone for Reference:
https://dumps.tadiphone.dev/dumps/xiaomi/vili/-/blob/missi_phone_global-user-14-UKQ1.231207.002-V816.0.5.0.UKDMIXM-release-keys/aosp-device-tree/proprietary-files.txt#L2072
https://github.com/Spanish-or-Vanish/android_device_xiaomi_sm8350-common/commit/6a8f6aae347f9f864f17f2dfa5d541f83ab5b170
https://github.com/Spanish-or-Vanish/android_device_xiaomi_sm8350-common/commit/5c593cbd2c19d571b7e62ea4bd6b8c864a4e1d9e
# Credits:
* [**HELLBOY017**](https://github.com/HELLBOY017)
* [**adithya2306**](https://github.com/adithya2306)
* [**johnmart19**](https://github.com/johnmart19)
* [**userariii**](https://github.com/userariii)
* [**saku-bruh**](https://github.com/saku-bruh)
* [**ahnet-69 · he/him**](https://github.com/ahnet-69)
https://github.com/Neoteric-OS/device_nothing_Pong/commit/cefa46567c04770e492351e51dd96cfae80e34fb

View File

@@ -1,10 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := RemovePackagesDolby
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_OVERRIDES_PACKAGES += Music MusicFX AudioFX
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := /dev/null
include $(BUILD_PREBUILT)

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Feature for devices with a head tracker sensor. -->
<permissions>
<feature name="android.hardware.sensor.dynamic.head_tracker" />
</permissions>

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
<!-- Copyright 2016 The Android Open Source Project
This program is protected under international and U.S. copyright laws as
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was modified by Dolby Laboratories, Inc. The portions of the
code that are surrounded by "DOLBY..." are copyrighted and
licensed separately, as follows:
(C) 2018 Dolby Laboratories, Inc.
All rights reserved.
This program is protected under international and U.S. Copyright laws as
an unpublished work. This program is confidential and proprietary to the
copyright owners. Reproduction or disclosure, in whole or in part, or the
production of derivative works therefrom without the express permission of
the copyright owners is prohibited.
Copyright (C) 2020-2021 by Dolby Laboratories,
All rights reserved.
-->
<Included>
@@ -35,13 +51,5 @@
</Type>
</MediaCodec>
<!-- DOLBY_UDC END -->
<!-- DOLBY_AC4 -->
<MediaCodec name="c2.dolby.ac4.decoder" type="audio/ac4">
<Alias name="OMX.dolby.ac4.decoder" />
<Limit name="channel-count" max="16" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="16000-2688000" />
</MediaCodec>
<!-- DOLBY_AC4 END -->
</Decoders>
</Included>

View File

@@ -12,6 +12,7 @@
<version>1.0</version>
<interface>
<name>IComponentStore</name>
<instance>dolby</instance>
<instance>default1</instance>
</interface>
</hal>

127
dolby.mk
View File

@@ -21,110 +21,63 @@ DOLBY_PATH := hardware/dolby
PRODUCT_SOONG_NAMESPACES += \
$(DOLBY_PATH)
# Enable codec support
AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
# Build codec2 packages
PRODUCT_PACKAGES += \
libavservices_minijail.vendor \
libcodec2_hidl@1.2.vendor \
libcodec2_soft_common.vendor
# SEPolicy
BOARD_VENDOR_SEPOLICY_DIRS += $(DOLBY_PATH)/sepolicy/vendor
# HIDL
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += $(DOLBY_PATH)/dolby_framework_matrix.xml
DEVICE_MANIFEST_FILE += $(DOLBY_PATH)/vendor.dolby.hardware.dms@2.0-service.xml
DEVICE_MANIFEST_FILE += $(DOLBY_PATH)/vendor.dolby.media.c2.xml
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE += $(DOLBY_PATH)/configs/vintf/dolby_framework_matrix.xml
DEVICE_MANIFEST_FILE += \
$(DOLBY_PATH)/configs/vintf/vendor.dolby.hardware.dms@2.0-service.xml \
$(DOLBY_PATH)/configs/vintf/vendor.dolby.media.c2@1.0-service.xml
# Configs
PRODUCT_COPY_FILES += \
$(DOLBY_PATH)/configs/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml \
$(DOLBY_PATH)/configs/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml
$(DOLBY_PATH)/configs/dax/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml \
$(DOLBY_PATH)/configs/media/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml
# Dolby VNDK libs
PRODUCT_PACKAGES += \
libstagefright_foundation-v33
PRODUCT_PACKAGES += \
libshim_dolby
# Init
PRODUCT_PACKAGES += \
init.dolby.rc
# Overlays
PRODUCT_PACKAGES += \
DolbyFrameworksResCommon
# Spatial Audio
PRODUCT_COPY_FILES += \
$(DOLBY_PATH)/configs/android.hardware.sensor.dynamic.head_tracker.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.dynamic.head_tracker.xml \
prebuilts/vndk/v33/arm/arch-arm-armv7-a-neon/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib/libstagefright_foundation-v33.so \
prebuilts/vndk/v33/arm64/arch-arm64-armv8-a/shared/vndk-core/libstagefright_foundation.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libstagefright_foundation-v33.so
# Spatial Audio: optimize spatializer effect
PRODUCT_PROPERTY_OVERRIDES += \
audio.spatializer.effect.util_clamp_min=300
# Spatial Audio: declare use of spatial audio
PRODUCT_PROPERTY_OVERRIDES += \
ro.audio.spatializer_enabled=true \
ro.audio.headtracking_enabled=true \
ro.audio.spatializer_transaural_enabled_default=false \
persist.vendor.audio.spatializer.speaker_enabled=true \
# Spatial Audio Proprietary blobs
PRODUCT_PACKAGES += \
libspatialaudio
# Media (C2)
PRODUCT_PACKAGES += \
android.hardware.media.c2@1.0.vendor \
android.hardware.media.c2@1.1.vendor \
android.hardware.media.c2@1.2.vendor \
libcodec2_hidl@1.2.vendor \
libsfplugin_ccodec_utils.vendor \
libcodec2_soft_common.vendor
# Codec2 Props
# Dolby
PRODUCT_VENDOR_PROPERTIES += \
vendor.audio.c2.preferred=true \
debug.c2.use_dmabufheaps=1 \
vendor.qc2audio.suspend.enabled=true \
vendor.qc2audio.per_frame.flac.dec.enabled=true
# Dolby Props
PRODUCT_VENDOR_PROPERTIES += \
ro.vendor.dolby.dax.version=DAX3_3.7.0.8_r1 \
vendor.audio.dolby.ds2.hardbypass=false \
vendor.audio.dolby.ds2.enabled=false
# Remove Packages for Dolby Support
PRODUCT_PACKAGES += \
RemovePackagesDolby
ro.vendor.dolby.dax.version=DAX3_3.7.0.8_r1
# DolbyManager
PRODUCT_PACKAGES += \
DolbyManager
# Dolby Proprietary blobs
# Proprietary-files
PRODUCT_COPY_FILES += \
$(DOLBY_PATH)/proprietary/vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.dolby.hardware.dms@2.0-service \
$(DOLBY_PATH)/proprietary/vendor/bin/hw/vendor.dolby.media.c2@1.0-service:$(TARGET_COPY_OUT_VENDOR)/bin/hw/vendor.dolby.media.c2@1.0-service \
$(DOLBY_PATH)/proprietary/vendor/etc/init/vendor.dolby.hardware.dms@2.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.dolby.hardware.dms@2.0-service.rc \
# Codec2 (Dolby)
PRODUCT_COPY_FILES += \
$(DOLBY_PATH)/proprietary/vendor/etc/init/vendor.dolby.media.c2@1.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.dolby.media.c2@1.0-service.rc \
PRODUCT_PACKAGES += \
libdapparamstorage \
libdlbpreg \
vendor.dolby.hardware.dms@2.0 \
libdlbdsservice \
liboem_specific \
vendor.dolby.hardware.dms@2.0-impl \
vendor.dolby.hardware.dms@2.0-service \
libcodec2_soft_ac4dec \
libcodec2_soft_ddpdec \
libcodec2_soft_dolby \
libcodec2_store_dolby \
libdeccfg \
vendor.dolby.media.c2@1.0-service \
libdlbvol \
libswdap \
libswgamedap \
libswvqe \
$(DOLBY_PATH)/proprietary/vendor/lib/libdapparamstorage.so:$(TARGET_COPY_OUT_VENDOR)/lib/libdapparamstorage.so \
$(DOLBY_PATH)/proprietary/vendor/lib/libdlbpreg.so:$(TARGET_COPY_OUT_VENDOR)/lib/libdlbpreg.so \
$(DOLBY_PATH)/proprietary/vendor/lib/soundfx/libdlbvol.so:$(TARGET_COPY_OUT_VENDOR)/lib/soundfx/libdlbvol.so \
$(DOLBY_PATH)/proprietary/vendor/lib/soundfx/libswdap.so:$(TARGET_COPY_OUT_VENDOR)/lib/soundfx/libswdap.so \
$(DOLBY_PATH)/proprietary/vendor/lib/soundfx/libswgamedap.so:$(TARGET_COPY_OUT_VENDOR)/lib/soundfx/libswgamedap.so \
$(DOLBY_PATH)/proprietary/vendor/lib/soundfx/libswvqe.so:$(TARGET_COPY_OUT_VENDOR)/lib/soundfx/libswvqe.so \
$(DOLBY_PATH)/proprietary/vendor/lib/vendor.dolby.hardware.dms@2.0.so:$(TARGET_COPY_OUT_VENDOR)/lib/vendor.dolby.hardware.dms@2.0.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libcodec2_soft_ac4dec.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcodec2_soft_ac4dec.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libcodec2_soft_ddpdec.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcodec2_soft_ddpdec.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libcodec2_soft_dolby.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcodec2_soft_dolby.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libcodec2_store_dolby.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libcodec2_store_dolby.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libdapparamstorage.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libdapparamstorage.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libdeccfg.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libdeccfg.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libdlbdsservice.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libdlbdsservice.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/libdlbpreg.so:$(TARGET_COPY_OUT_VENDOR)/lib64/libdlbpreg.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/soundfx/libdlbvol.so:$(TARGET_COPY_OUT_VENDOR)/lib64/soundfx/libdlbvol.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/soundfx/libswdap.so:$(TARGET_COPY_OUT_VENDOR)/lib64/soundfx/libswdap.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/soundfx/libswgamedap.so:$(TARGET_COPY_OUT_VENDOR)/lib64/soundfx/libswgamedap.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/soundfx/libswvqe.so:$(TARGET_COPY_OUT_VENDOR)/lib64/soundfx/libswvqe.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/vendor.dolby.hardware.dms@2.0-impl.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.dolby.hardware.dms@2.0-impl.so \
$(DOLBY_PATH)/proprietary/vendor/lib64/vendor.dolby.hardware.dms@2.0.so:$(TARGET_COPY_OUT_VENDOR)/lib64/vendor.dolby.hardware.dms@2.0.so

View File

@@ -1,17 +0,0 @@
//
// Copyright (C) 2023 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
cc_library_shared {
name: "libshim_dolby",
srcs: ["libshim_dolby.cpp"],
compile_multilib: "64",
shared_libs: [
"liblog",
"libdl",
"libc",
],
vendor: true,
}

View File

@@ -1,27 +0,0 @@
//
// SPDX-FileCopyrightText: The LineageOS Project
// SPDX-License-Identifier: Apache-2.0
//
#include <log/log.h>
#include <dlfcn.h>
extern "C" void _ZNK7android7RefBase9incStrongEPKv(void* thisptr, const void* id) {
if (!thisptr) {
ALOGE("DolbyShim: incStrong called on nullptr!");
return;
}
typedef void (*RealFunc)(void*, const void*);
static RealFunc real = (RealFunc)dlsym(RTLD_NEXT, "_ZNK7android7RefBase9incStrongEPKv");
if (real) real(thisptr, id);
}
extern "C" void _ZNK7android7RefBase9decStrongEPKv(void* thisptr, const void* id) {
if (!thisptr) {
ALOGE("DolbyShim: decStrong called on nullptr!");
return;
}
typedef void (*RealFunc)(void*, const void*);
static RealFunc real = (RealFunc)dlsym(RTLD_NEXT, "_ZNK7android7RefBase9decStrongEPKv");
if (real) real(thisptr, id);
}

View File

@@ -1,4 +0,0 @@
runtime_resource_overlay {
name: "DolbyFrameworksResCommon",
product_specific: true,
}

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.overlay.dolby">
<overlay
android:isStatic="true"
android:priority="300"
android:targetPackage="android" />
</manifest>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<!-- The default value for whether head tracking for
spatial audio is enabled for a newly connected audio device -->
<bool name="config_spatial_audio_head_tracking_enabled_default">true</bool>
</resources>

0
proprietary/vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service vendored Normal file → Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +0,0 @@
prebuilt_etc {
name: "init.dolby.rc",
src: "init.dolby.rc",
sub_dir: "init",
soc_specific: true
}

View File

@@ -1,4 +0,0 @@
on early-boot
# Dolby
mkdir /data/vendor/dolby 0770 media media
mkdir /data/vendor/multimedia 0775 system system

1
sepolicy/vendor/audioserver.te vendored Normal file
View File

@@ -0,0 +1 @@
hal_client_domain(audioserver, hal_dms)

View File

@@ -1,6 +1,8 @@
# Dolby Files
/data/vendor/dolby(/.*)? u:object_r:vendor_data_file:s0
# Data files
/data/vendor/dolby(/.*)? u:object_r:vendor_data_file:s0
# Dolby
/(system/vendor|vendor)/bin/hw/vendor\.dolby\.media\.c2@1\.0-service u:object_r:mediacodec_exec:s0
/(vendor|system/vendor)/bin/hw/vendor\.dolby\.hardware\.dms@2\.0-service u:object_r:hal_dms_default_exec:s0
/vendor/bin/hw/vendor\.dolby\.hardware\.dms@2\.0-service u:object_r:hal_dms_default_exec:s0
# Dolby Vision
/vendor/bin/hw/vendor\.dolby\.media\.c2@1\.0-service u:object_r:mediacodec_exec:s0

View File

@@ -1,4 +1,2 @@
allow hal_audio_default hal_dms_hwservice:hwservice_manager find;
binder_call(hal_audio_default, hal_dms_default)
hal_client_domain(hal_audio_default, hal_dms)

View File

@@ -1,11 +1,19 @@
type hal_dms_default, domain;
hal_server_domain(hal_dms_default, hal_dms)
type hal_dms_default_exec, exec_type, vendor_file_type, file_type;
type hal_dms_default_exec, exec_type, file_type, vendor_file_type;
allow hal_dms_default hal_dms_default_exec:file { read getattr map execute open entrypoint };
init_daemon_domain(hal_dms_default)
allow hal_dms_default vendor_audio_prop:property_service set;
allow hal_dms_default vendor_audio_prop:file { read open getattr map };
allow hal_dms_default vendor_data_file:file { rw_file_perms create unlink };
allow hal_dms_default vendor_data_file:dir { rw_file_perms add_name remove_name };
allow hal_dms_default mediacodec:binder call;
allow hal_dms_default property_socket:sock_file write;
allow hal_dms_default init:unix_stream_socket connectto;
binder_call(hal_dms_default, hal_audio_default)
binder_call(hal_dms_default, platform_app)

2
sepolicy/vendor/init.te vendored Normal file
View File

@@ -0,0 +1,2 @@
# dms
allow init hal_dms_default:process { siginh rlimitinh transition };

View File

@@ -1,3 +1,2 @@
allow mediacodec hal_dms_hwservice:hwservice_manager find;
binder_call(mediacodec, hal_dms_default)
hal_client_domain(mediacodec, hal_dms)

View File

@@ -1,4 +1,2 @@
allow platform_app hal_dms_hwservice:hwservice_manager find;
binder_call(platform_app, hal_dms_default)
get_prop(platform_app, audio_config_prop)
hal_client_domain(platform_app, hal_dms)

View File

@@ -1,3 +0,0 @@
# Dolby
allow priv_app hal_dms_hwservice:hwservice_manager find;
binder_call(priv_app, hal_dms_default)