diff --git a/universal7885-common/apps/SamsungDAP/Android.bp b/universal7885-common/apps/SamsungDAP/Android.bp
deleted file mode 100644
index be5fd86..0000000
--- a/universal7885-common/apps/SamsungDAP/Android.bp
+++ /dev/null
@@ -1,12 +0,0 @@
-android_app {
- name: "SamsungDAP",
-
- srcs: ["src/**/*.kt"],
-
- certificate: "platform",
- platform_apis: true,
-
- optimize: {
- proguard_flags_files: ["proguard.flags"],
- },
-}
diff --git a/universal7885-common/apps/SamsungDAP/AndroidManifest.xml b/universal7885-common/apps/SamsungDAP/AndroidManifest.xml
deleted file mode 100644
index f0faa5b..0000000
--- a/universal7885-common/apps/SamsungDAP/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungDAP/proguard.flags b/universal7885-common/apps/SamsungDAP/proguard.flags
deleted file mode 100644
index 2908800..0000000
--- a/universal7885-common/apps/SamsungDAP/proguard.flags
+++ /dev/null
@@ -1,3 +0,0 @@
--keep class org.lineageos.dap.gef.* {
- *;
-}
diff --git a/universal7885-common/apps/SamsungDAP/src/org/lineageos/dap/BootCompletedReceiver.kt b/universal7885-common/apps/SamsungDAP/src/org/lineageos/dap/BootCompletedReceiver.kt
deleted file mode 100644
index c3350ac..0000000
--- a/universal7885-common/apps/SamsungDAP/src/org/lineageos/dap/BootCompletedReceiver.kt
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2021 The LineageOS 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.
- */
-
-package org.lineageos.dap
-
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import android.media.audiofx.AudioEffect
-import android.util.Log
-
-import java.util.UUID
-
-class BootCompletedReceiver : BroadcastReceiver() {
- private val audioEffect = AudioEffect(
- EFFECT_TYPE_DAP, AudioEffect.EFFECT_TYPE_NULL, 0, 0
- )
-
- override fun onReceive(context: Context, intent: Intent) {
- Log.d(TAG, "Starting")
- audioEffect.setParameter(EFFECT_PARAM_EFF_ENAB, 1)
- audioEffect.setParameter(EFFECT_PARAM_PROFILE, PROFILE_AUTO)
- audioEffect.enabled = true
- }
-
- companion object {
- private const val TAG = "SamsungDAP"
-
- private val EFFECT_TYPE_DAP = UUID.fromString("46d279d9-9be7-453d-9d7c-ef937f675587")
-
- private const val EFFECT_PARAM_PROFILE = 0
- private const val EFFECT_PARAM_STEREO_WIDENING_DISTANCE = 1
- private const val EFFECT_PARAM_EFF_ENAB = 19
-
- private const val PROFILE_AUTO = 0
- private const val PROFILE_MOVIE = 1
- private const val PROFILE_MUSIC = 2
- private const val PROFILE_VOICE = 3
- private const val PROFILE_GAME = 4
- private const val PROFILE_OFF = 5
- private const val PROFILE_GAME_1 = 6
- private const val PROFILE_GAME_2 = 7
- private const val PROFILE_SPACIAL_AUDIO = 8
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/Android.bp b/universal7885-common/apps/SamsungParts/Android.bp
index d08311c..95001d5 100644
--- a/universal7885-common/apps/SamsungParts/Android.bp
+++ b/universal7885-common/apps/SamsungParts/Android.bp
@@ -2,6 +2,7 @@ android_app {
name: "SamsungParts",
srcs: [
"src/**/*.java",
+ "src/**/*.kt",
],
platform_apis: true,
privileged: true,
diff --git a/universal7885-common/apps/SamsungParts/AndroidManifest.xml b/universal7885-common/apps/SamsungParts/AndroidManifest.xml
index 775a676..df7f337 100644
--- a/universal7885-common/apps/SamsungParts/AndroidManifest.xml
+++ b/universal7885-common/apps/SamsungParts/AndroidManifest.xml
@@ -35,7 +35,6 @@
@@ -81,6 +80,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/dolby.png b/universal7885-common/apps/SamsungParts/res/drawable/dolby.png
new file mode 100644
index 0000000..58a78d6
Binary files /dev/null and b/universal7885-common/apps/SamsungParts/res/drawable/dolby.png differ
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml
new file mode 100644
index 0000000..c6a0c7a
--- /dev/null
+++ b/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml
@@ -0,0 +1,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml
new file mode 100644
index 0000000..f13fca6
--- /dev/null
+++ b/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml
@@ -0,0 +1,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/universal7885-common/apps/SamsungParts/res/values/arrays.xml b/universal7885-common/apps/SamsungParts/res/values/arrays.xml
index d7b4fe7..c9d2ac8 100644
--- a/universal7885-common/apps/SamsungParts/res/values/arrays.xml
+++ b/universal7885-common/apps/SamsungParts/res/values/arrays.xml
@@ -8,4 +8,15 @@
- @string/battery_status
- @string/battery_temp
+
+ - @string/dolby_profile_auto
+ - @string/dolby_profile_game
+ - @string/dolby_profile_game_1
+ - @string/dolby_profile_game_2
+ - @string/dolby_profile_movie
+ - @string/dolby_profile_music
+ - @string/dolby_profile_off
+ - @string/dolby_profile_special_audio
+ - @string/dolby_profile_voice
+
\ No newline at end of file
diff --git a/universal7885-common/apps/SamsungParts/res/values/strings.xml b/universal7885-common/apps/SamsungParts/res/values/strings.xml
index 4d8575b..fc9ec67 100644
--- a/universal7885-common/apps/SamsungParts/res/values/strings.xml
+++ b/universal7885-common/apps/SamsungParts/res/values/strings.xml
@@ -21,23 +21,36 @@
Display
-
- Logs
- Options
- Action failed because of missing superuser access
-
FPS info overlay
Show overlay with current frames per second
- Speaker
+ Audio
Clear speaker
Play a 30-second audio to clear the speaker
Run this feature once or twice if you find that your speaker is lightly blocked by dust. Set media volume to maximum.\n\nIf the speaker is blocked heavily, run this feature 2–5 times while shaking your device with the speaker facing downwards.
+
+ Dolby Atmos
+ Enable the Dolby Atmos audio effect
+ Enable Dolby audio, just like in OneUI.
+ Available Dolby Modes
+ Choose one of these
+ Auto Profile
+ Movie Profile
+ Music Profile
+ Voice Profile
+ Game Profile
+ No Profile
+ Game 1 Profile
+ Game 2 Profile
+ Special Audio Profile
+
+
+
Eureka Kernel Features
diff --git a/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml
index eb7ce77..ab2222a 100644
--- a/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml
+++ b/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml
@@ -6,7 +6,7 @@
+
+
+
+
+
+
+
+
+
diff --git a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml b/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
index e84c564..6e3bdee 100644
--- a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
+++ b/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
@@ -17,12 +17,22 @@
android:key="clear_speaker_settings"
android:title="@string/clear_speaker_title"
android:summary="@string/clear_speaker_summary"
- android:icon="@drawable/ic_speaker_cleaner_icon" >
+ android:icon="@drawable/ic_sound" >
+
+
+
{
+ switch (Integer.parseInt((String) newValue)){
+ case 1:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_AUTO);
+ break;
+ case 2:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME);
+ break;
+ case 3:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME_1);
+ break;
+ case 4:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_GAME_2);
+ break;
+ case 5:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_MOVIE);
+ break;
+ case 6:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_MUSIC);
+ break;
+ case 7:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_OFF);
+ break;
+ case 8:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_VOICE);
+ break;
+ case 9:
+ dolbyCore.startDolbyEffect(DolbyCore.PROFILE_SPACIAL_AUDIO);
+ break;
+ default:
+ break;
+ }
+ return true;
+ });
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ if (preference == DolbyEnablePreference) {
+ Boolean value = (Boolean) newValue;
+ if(value){
+ dolbyCore.justStartOnly();
+ }else{
+ dolbyCore.stopDolbyEffect();
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/universal7885-common/universal7885-common.mk b/universal7885-common/universal7885-common.mk
index c90a182..c6a7563 100644
--- a/universal7885-common/universal7885-common.mk
+++ b/universal7885-common/universal7885-common.mk
@@ -19,8 +19,7 @@ PRODUCT_PACKAGES += \
android.hardware.audio.effect@7.0-impl \
libtinycompress \
audio.r_submix.default \
- audio.usb.default \
- SamsungDAP
+ audio.usb.default
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \