Compare commits
69 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02d5796d3a | |||
|
|
c0de818eba | ||
|
|
4609a70e95 | ||
|
|
2ac524b54c | ||
| f42bd8b0b0 | |||
| 3e5a418ec2 | |||
|
|
a87374584b | ||
|
|
823cb93c6e | ||
|
|
298cc0e0a2 | ||
|
|
9bb5037bc0 | ||
|
|
0c9ddc4349 | ||
|
|
9034fe64c9 | ||
|
|
ff98f55a64 | ||
|
|
d520bfc991 | ||
|
|
898b66db90 | ||
|
|
ba30d4f198 | ||
|
|
756f07541f | ||
|
|
8d1f1dec6f | ||
|
|
708d38f721 | ||
|
|
5d570a07fe | ||
|
|
7a34fbab8f | ||
|
|
80dde88580 | ||
|
|
b78ed962c9 | ||
|
|
0aa344b92c | ||
|
|
21b1b920de | ||
|
|
97abb34497 | ||
|
|
f102f6b9b0 | ||
|
|
caedc60497 | ||
|
|
97387bcbb5 | ||
|
|
e33ef72395 | ||
|
|
6cc96db8d4 | ||
|
|
6a92f5625e | ||
|
|
5bddfe4ab8 | ||
|
|
a6202e7f90 | ||
|
|
00d74c76bc | ||
|
|
23662b74ac | ||
|
|
65d7336949 | ||
|
|
0befa6aa8c | ||
|
|
6d89341732 | ||
|
|
f5fb608d13 | ||
|
|
6cc95d2a09 | ||
|
|
048d3bfbe3 | ||
|
|
fac9089afd | ||
|
|
724f607cb8 | ||
|
|
da758a7873 | ||
|
|
a54c599e2b | ||
|
|
9c8b952778 | ||
|
|
9bce0718c3 | ||
|
|
4401819065 | ||
|
|
6fe60d867d | ||
|
|
beef2e28a1 | ||
|
|
efb871f672 | ||
|
|
1f2bc3d255 | ||
|
|
7870b8a0c7 | ||
|
|
6ad0f598e9 | ||
|
|
174e52ec51 | ||
|
|
881bb90ebe | ||
|
|
3fa57e3935 | ||
|
|
07b0a125fd | ||
|
|
fe709e060d | ||
|
|
e96e8c76fd | ||
|
|
31843fb4e7 | ||
|
|
f167291caf | ||
|
|
773b6cba9e | ||
|
|
04bec17707 | ||
|
|
a952ccb07b | ||
|
|
d2d27807cc | ||
|
|
667b4721be | ||
|
|
258557eec9 |
346
Android.bp
346
Android.bp
@@ -14,3 +14,349 @@
|
||||
|
||||
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,
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:allowBackup="false"
|
||||
android:label="@string/dolby_title"
|
||||
android:persistent="true">
|
||||
android:persistent="true"
|
||||
android:theme="@style/Theme.SubSettingsBase.Expressive">
|
||||
|
||||
<receiver
|
||||
android:name=".BootCompletedReceiver"
|
||||
@@ -26,7 +27,6 @@
|
||||
<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,7 +50,6 @@
|
||||
<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" />
|
||||
|
||||
@@ -16,7 +16,7 @@ class DolbyActivity : CollapsingToolbarBaseActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
fragmentManager.beginTransaction()
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbySettingsFragment(), TAG)
|
||||
.commit()
|
||||
}
|
||||
|
||||
@@ -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 : PreferenceFragment(),
|
||||
class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
private val switchBar by lazy {
|
||||
@@ -57,8 +57,8 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
findPreference<Preference>(DolbyConstants.PREF_RESET)!!
|
||||
}
|
||||
|
||||
private val dolbyController by lazy { DolbyController.getInstance(context) }
|
||||
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
|
||||
private val dolbyController by lazy { DolbyController.getInstance(requireContext()) }
|
||||
private val audioManager by lazy { requireContext().getSystemService(AudioManager::class.java) }
|
||||
private val handler = Handler()
|
||||
|
||||
private var isOnSpeaker = true
|
||||
@@ -83,13 +83,14 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
dlog(TAG, "onCreatePreferences")
|
||||
addPreferencesFromResource(R.xml.dolby_settings)
|
||||
|
||||
val profile = dolbyController.profile
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(context).also {
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(requireContext()).also {
|
||||
it.profile = profile
|
||||
}
|
||||
|
||||
setPreferencesFromResource(R.xml.dolby_settings, rootKey)
|
||||
|
||||
val dsOn = dolbyController.dsOn
|
||||
switchBar.addOnSwitchChangeListener(this)
|
||||
switchBar.setChecked(dsOn)
|
||||
@@ -101,7 +102,7 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
summary = "%s"
|
||||
value = profile.toString()
|
||||
} else {
|
||||
summary = context.getString(R.string.dolby_unknown)
|
||||
summary = getString(R.string.dolby_unknown)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +117,8 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
dolbyController.resetProfileSpecificSettings()
|
||||
updateProfileSpecificPrefs()
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.dolby_reset_profile_toast, profilePref.summary),
|
||||
requireContext(),
|
||||
getString(R.string.dolby_reset_profile_toast, profilePref.summary),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
true
|
||||
@@ -191,8 +192,8 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
}
|
||||
|
||||
private fun updateProfileSpecificPrefs() {
|
||||
val unknownRes = context.getString(R.string.dolby_unknown)
|
||||
val headphoneRes = context.getString(R.string.dolby_connect_headphones)
|
||||
val unknownRes = getString(R.string.dolby_unknown)
|
||||
val headphoneRes = getString(R.string.dolby_connect_headphones)
|
||||
val dsOn = dolbyController.dsOn
|
||||
val currentProfile = dolbyController.profile
|
||||
|
||||
|
||||
@@ -6,21 +6,20 @@
|
||||
|
||||
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
|
||||
@@ -36,47 +35,33 @@ 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 : PreferenceFragment(),
|
||||
OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
class DolbySettingsFragment : SettingsBasePreferenceFragment(),
|
||||
Preference.OnPreferenceChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
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 appContext: Context
|
||||
get() = requireContext().applicationContext
|
||||
|
||||
private val dolbyController by lazy { DolbyController.getInstance(context) }
|
||||
private val audioManager by lazy { context.getSystemService(AudioManager::class.java) }
|
||||
private val handler = Handler()
|
||||
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 audioManager by lazy(LazyThreadSafetyMode.NONE) {
|
||||
appContext.getSystemService(AudioManager::class.java)
|
||||
}
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
private var isOnSpeaker = true
|
||||
set(value) {
|
||||
@@ -100,26 +85,29 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
dlog(TAG, "onCreatePreferences")
|
||||
addPreferencesFromResource(R.xml.dolby_settings)
|
||||
setPreferencesFromResource(R.xml.dolby_settings, rootKey)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val profile = dolbyController.profile
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(context).also {
|
||||
preferenceManager.preferenceDataStore = DolbyPreferenceStore(appContext).also {
|
||||
it.profile = profile
|
||||
}
|
||||
|
||||
val dsOn = dolbyController.dsOn
|
||||
switchBar.addOnSwitchChangeListener(this)
|
||||
switchBar.setChecked(dsOn)
|
||||
switchBar.isChecked = dsOn
|
||||
|
||||
profilePref.onPreferenceChangeListener = this
|
||||
updateProfileIcon(profile)
|
||||
profilePref.setEnabled(dsOn)
|
||||
profilePref.isEnabled = dsOn
|
||||
profilePref.apply {
|
||||
if (entryValues.contains(profile.toString())) {
|
||||
summary = "%s"
|
||||
value = profile.toString()
|
||||
} else {
|
||||
summary = context.getString(R.string.dolby_unknown)
|
||||
summary = getString(R.string.dolby_unknown)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,21 +123,21 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
dolbyController.resetProfileSpecificSettings()
|
||||
updateProfileSpecificPrefs()
|
||||
Toast.makeText(
|
||||
context,
|
||||
context.getString(R.string.dolby_reset_profile_toast, profilePref.summary),
|
||||
appContext,
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -168,35 +156,13 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
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
|
||||
@@ -205,18 +171,21 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
|
||||
dlog(TAG, "onCheckedChanged($isChecked)")
|
||||
dolbyController.dsOn = isChecked
|
||||
profilePref.setEnabled(isChecked)
|
||||
profilePref.isEnabled = isChecked
|
||||
updateProfileSpecificPrefs()
|
||||
}
|
||||
|
||||
private fun updateSpeakerState() {
|
||||
val device = audioManager!!.getDevicesForAttributes(ATTRIBUTES_MEDIA)[0]
|
||||
isOnSpeaker = (device.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
||||
val devices = audioManager
|
||||
?.getDevicesForAttributes(ATTRIBUTES_MEDIA)
|
||||
.orEmpty()
|
||||
val firstType = devices.firstOrNull()?.type
|
||||
isOnSpeaker = (firstType == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)
|
||||
}
|
||||
|
||||
private fun updateProfileSpecificPrefs() {
|
||||
val unknownRes = context.getString(R.string.dolby_unknown)
|
||||
val headphoneRes = context.getString(R.string.dolby_connect_headphones)
|
||||
val unknownRes = getString(R.string.dolby_unknown)
|
||||
val headphoneRes = getString(R.string.dolby_connect_headphones)
|
||||
val dsOn = dolbyController.dsOn
|
||||
val currentProfile = dolbyController.profile
|
||||
|
||||
@@ -226,15 +195,15 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
)
|
||||
|
||||
val enable = dsOn && (currentProfile != -1)
|
||||
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)
|
||||
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
|
||||
|
||||
if (!enable) return
|
||||
|
||||
@@ -260,9 +229,9 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
}
|
||||
}
|
||||
|
||||
spkVirtPref.setChecked(dolbyController.getSpeakerVirtEnabled(currentProfile))
|
||||
volumePref.setChecked(dolbyController.getVolumeLevelerEnabled(currentProfile))
|
||||
bassPref.setChecked(dolbyController.getBassEnhancerEnabled(currentProfile))
|
||||
spkVirtPref.isChecked = dolbyController.getSpeakerVirtEnabled(currentProfile)
|
||||
volumePref.isChecked = dolbyController.getVolumeLevelerEnabled(currentProfile)
|
||||
bassPref.isChecked = dolbyController.getBassEnhancerEnabled(currentProfile)
|
||||
|
||||
// below prefs are not enabled on loudspeaker
|
||||
if (isOnSpeaker) {
|
||||
@@ -282,7 +251,7 @@ class DolbySettingsFragment : PreferenceFragment(),
|
||||
}
|
||||
|
||||
hpVirtPref.apply {
|
||||
setChecked(dolbyController.getHeadphoneVirtEnabled(currentProfile))
|
||||
isChecked = dolbyController.getHeadphoneVirtEnabled(currentProfile)
|
||||
summary = null
|
||||
}
|
||||
}
|
||||
|
||||
20
README.mkdn
20
README.mkdn
@@ -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) and make sure your device supports c2 codecs. :-
|
||||
For dolby media codecs to work add this line in your media codecs config (should be in vendor partition) :-
|
||||
|
||||
```bash
|
||||
<Include href="media_codecs_dolby_audio.xml" />
|
||||
@@ -42,4 +42,20 @@ 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 :-
|
||||
https://github.com/Neoteric-OS/device_nothing_Pong/commit/cefa46567c04770e492351e51dd96cfae80e34fb
|
||||
|
||||
[**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)
|
||||
|
||||
10
RemovePackagesDolby/Android.mk
Normal file
10
RemovePackagesDolby/Android.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
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)
|
||||
20
configs/android.hardware.sensor.dynamic.head_tracker.xml
Normal file
20
configs/android.hardware.sensor.dynamic.head_tracker.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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
@@ -1,30 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2016 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.
|
||||
|
||||
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
|
||||
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>
|
||||
@@ -51,5 +35,13 @@
|
||||
</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>
|
||||
129
dolby.mk
129
dolby.mk
@@ -21,63 +21,110 @@ DOLBY_PATH := hardware/dolby
|
||||
PRODUCT_SOONG_NAMESPACES += \
|
||||
$(DOLBY_PATH)
|
||||
|
||||
# Build codec2 packages
|
||||
PRODUCT_PACKAGES += \
|
||||
libavservices_minijail.vendor \
|
||||
libcodec2_hidl@1.2.vendor \
|
||||
libcodec2_soft_common.vendor
|
||||
# Enable codec support
|
||||
AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
|
||||
|
||||
# SEPolicy
|
||||
BOARD_VENDOR_SEPOLICY_DIRS += $(DOLBY_PATH)/sepolicy/vendor
|
||||
|
||||
# HIDL
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# Configs
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(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_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 VNDK libs
|
||||
PRODUCT_COPY_FILES += \
|
||||
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
|
||||
PRODUCT_PACKAGES += \
|
||||
libstagefright_foundation-v33
|
||||
|
||||
# Dolby
|
||||
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 \
|
||||
|
||||
# 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
|
||||
PRODUCT_VENDOR_PROPERTIES += \
|
||||
ro.vendor.dolby.dax.version=DAX3_3.7.0.8_r1
|
||||
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
|
||||
|
||||
|
||||
# DolbyManager
|
||||
PRODUCT_PACKAGES += \
|
||||
DolbyManager
|
||||
|
||||
# Proprietary-files
|
||||
# Dolby Proprietary blobs
|
||||
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 \
|
||||
$(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
|
||||
|
||||
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 \
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IComponentStore</name>
|
||||
<instance>dolby</instance>
|
||||
<instance>default1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
17
libshims/Android.bp
Normal file
17
libshims/Android.bp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// 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,
|
||||
}
|
||||
27
libshims/libshim_dolby.cpp
Normal file
27
libshims/libshim_dolby.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// 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);
|
||||
}
|
||||
4
overlay/DolbyFrameworksResCommon/Android.bp
Normal file
4
overlay/DolbyFrameworksResCommon/Android.bp
Normal file
@@ -0,0 +1,4 @@
|
||||
runtime_resource_overlay {
|
||||
name: "DolbyFrameworksResCommon",
|
||||
product_specific: true,
|
||||
}
|
||||
9
overlay/DolbyFrameworksResCommon/AndroidManifest.xml
Normal file
9
overlay/DolbyFrameworksResCommon/AndroidManifest.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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>
|
||||
10
overlay/DolbyFrameworksResCommon/res/values/config.xml
Normal file
10
overlay/DolbyFrameworksResCommon/res/values/config.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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
Executable file → Normal file
0
proprietary/vendor/bin/hw/vendor.dolby.hardware.dms@2.0-service
vendored
Executable file → Normal file
Binary file not shown.
BIN
proprietary/vendor/lib/libdapparamstorage.so
vendored
BIN
proprietary/vendor/lib/libdapparamstorage.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib/libdlbpreg.so
vendored
BIN
proprietary/vendor/lib/libdlbpreg.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib/soundfx/libdlbvol.so
vendored
BIN
proprietary/vendor/lib/soundfx/libdlbvol.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib/soundfx/libspatialaudio.so
vendored
Normal file
BIN
proprietary/vendor/lib/soundfx/libspatialaudio.so
vendored
Normal file
Binary file not shown.
BIN
proprietary/vendor/lib/soundfx/libswdap.so
vendored
BIN
proprietary/vendor/lib/soundfx/libswdap.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib/soundfx/libswgamedap.so
vendored
BIN
proprietary/vendor/lib/soundfx/libswgamedap.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib/soundfx/libswvqe.so
vendored
BIN
proprietary/vendor/lib/soundfx/libswvqe.so
vendored
Binary file not shown.
Binary file not shown.
BIN
proprietary/vendor/lib64/libcodec2_soft_ac4dec.so
vendored
BIN
proprietary/vendor/lib64/libcodec2_soft_ac4dec.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib64/libcodec2_soft_ddpdec.so
vendored
BIN
proprietary/vendor/lib64/libcodec2_soft_ddpdec.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib64/libcodec2_soft_dolby.so
vendored
BIN
proprietary/vendor/lib64/libcodec2_soft_dolby.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib64/libcodec2_store_dolby.so
vendored
BIN
proprietary/vendor/lib64/libcodec2_store_dolby.so
vendored
Binary file not shown.
BIN
proprietary/vendor/lib64/liboem_specific.so
vendored
Normal file
BIN
proprietary/vendor/lib64/liboem_specific.so
vendored
Normal file
Binary file not shown.
BIN
proprietary/vendor/lib64/soundfx/libspatialaudio.so
vendored
Normal file
BIN
proprietary/vendor/lib64/soundfx/libspatialaudio.so
vendored
Normal file
Binary file not shown.
BIN
proprietary/vendor/lib64/soundfx/libswdap.so
vendored
BIN
proprietary/vendor/lib64/soundfx/libswdap.so
vendored
Binary file not shown.
6
rootdir/etc/Android.bp
Normal file
6
rootdir/etc/Android.bp
Normal file
@@ -0,0 +1,6 @@
|
||||
prebuilt_etc {
|
||||
name: "init.dolby.rc",
|
||||
src: "init.dolby.rc",
|
||||
sub_dir: "init",
|
||||
soc_specific: true
|
||||
}
|
||||
4
rootdir/etc/init.dolby.rc
Normal file
4
rootdir/etc/init.dolby.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
on early-boot
|
||||
# Dolby
|
||||
mkdir /data/vendor/dolby 0770 media media
|
||||
mkdir /data/vendor/multimedia 0775 system system
|
||||
1
sepolicy/vendor/audioserver.te
vendored
1
sepolicy/vendor/audioserver.te
vendored
@@ -1 +0,0 @@
|
||||
hal_client_domain(audioserver, hal_dms)
|
||||
10
sepolicy/vendor/file_contexts
vendored
10
sepolicy/vendor/file_contexts
vendored
@@ -1,8 +1,6 @@
|
||||
# Data files
|
||||
/data/vendor/dolby(/.*)? u:object_r:vendor_data_file:s0
|
||||
# Dolby Files
|
||||
/data/vendor/dolby(/.*)? u:object_r:vendor_data_file:s0
|
||||
|
||||
# Dolby
|
||||
/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
|
||||
/(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
|
||||
|
||||
2
sepolicy/vendor/hal_audio_default.te
vendored
2
sepolicy/vendor/hal_audio_default.te
vendored
@@ -1,2 +1,4 @@
|
||||
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)
|
||||
|
||||
12
sepolicy/vendor/hal_dms_default.te
vendored
12
sepolicy/vendor/hal_dms_default.te
vendored
@@ -1,19 +1,11 @@
|
||||
type hal_dms_default, domain;
|
||||
hal_server_domain(hal_dms_default, hal_dms)
|
||||
|
||||
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 };
|
||||
|
||||
type hal_dms_default_exec, exec_type, vendor_file_type, file_type;
|
||||
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 property_socket:sock_file write;
|
||||
allow hal_dms_default init:unix_stream_socket connectto;
|
||||
|
||||
allow hal_dms_default mediacodec:binder call;
|
||||
binder_call(hal_dms_default, hal_audio_default)
|
||||
binder_call(hal_dms_default, platform_app)
|
||||
|
||||
2
sepolicy/vendor/init.te
vendored
2
sepolicy/vendor/init.te
vendored
@@ -1,2 +0,0 @@
|
||||
# dms
|
||||
allow init hal_dms_default:process { siginh rlimitinh transition };
|
||||
1
sepolicy/vendor/mediacodec.te
vendored
1
sepolicy/vendor/mediacodec.te
vendored
@@ -1,2 +1,3 @@
|
||||
allow mediacodec hal_dms_hwservice:hwservice_manager find;
|
||||
binder_call(mediacodec, hal_dms_default)
|
||||
hal_client_domain(mediacodec, hal_dms)
|
||||
|
||||
2
sepolicy/vendor/platform_app.te
vendored
2
sepolicy/vendor/platform_app.te
vendored
@@ -1,2 +1,4 @@
|
||||
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)
|
||||
|
||||
3
sepolicy/vendor/priv_app.te
vendored
Normal file
3
sepolicy/vendor/priv_app.te
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Dolby
|
||||
allow priv_app hal_dms_hwservice:hwservice_manager find;
|
||||
binder_call(priv_app, hal_dms_default)
|
||||
Reference in New Issue
Block a user