diff --git a/universal7885-common/apps/SamsungParts/Android.bp b/universal7885-common/apps/SamsungParts/Android.bp
deleted file mode 100644
index 1043278..0000000
--- a/universal7885-common/apps/SamsungParts/Android.bp
+++ /dev/null
@@ -1,18 +0,0 @@
-android_app {
- name: "SamsungParts",
- srcs: [
- "src/**/*.kt",
- ],
- platform_apis: true,
- certificate: "platform",
- jni_libs: [
- "libStorageHelper",
- "libSwapCallback",
- ],
- static_libs: [
- "androidx.preference_preference",
- "vendor.eureka.hardware.parts-V1-java",
- ],
- defaults: ["SettingsLibDefaults"],
- required: ["vendor.eureka.hardware.parts-service"],
-}
diff --git a/universal7885-common/apps/SamsungParts/AndroidManifest.xml b/universal7885-common/apps/SamsungParts/AndroidManifest.xml
deleted file mode 100644
index edb47e7..0000000
--- a/universal7885-common/apps/SamsungParts/AndroidManifest.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/jni/Android.bp b/universal7885-common/apps/SamsungParts/jni/Android.bp
deleted file mode 100644
index 1534d14..0000000
--- a/universal7885-common/apps/SamsungParts/jni/Android.bp
+++ /dev/null
@@ -1,26 +0,0 @@
-cc_library_shared {
- name: "libStorageHelper",
- cflags: [
- "-Wall",
- "-Wextra",
- "-Wno-unused-parameter",
- "-Werror",
- ],
- srcs: ["Storage.cpp"],
- header_libs: ["jni_headers"],
- static_libs: ["libc++fs"],
-}
-
-cc_library_shared {
- name: "libSwapCallback",
- srcs: [
- "SwapCallbackImpl.cpp",
- "SwapCallbackNative.cpp",
- ],
- header_libs: ["jni_headers"],
- shared_libs: [
- "vendor.eureka.hardware.parts-V1-ndk",
- "libbase",
- "libbinder_ndk",
- ],
-}
diff --git a/universal7885-common/apps/SamsungParts/jni/Storage.cpp b/universal7885-common/apps/SamsungParts/jni/Storage.cpp
deleted file mode 100644
index f94f832..0000000
--- a/universal7885-common/apps/SamsungParts/jni/Storage.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include
-#include
-#include
-#include
-
-namespace fs = std::filesystem;
-
-extern "C" JNIEXPORT jdouble JNICALL
-Java_com_eurekateam_samsungextras_interfaces_Swap_getFreeSpace(JNIEnv /*env*/,
- jclass /*clazz*/) {
- fs::space_info data = fs::space("/data");
- auto freespace = data.free / 1024 / 1024;
- return std::round((static_cast(freespace) / 1024) / 0.1) * 0.1;
-}
-
-extern "C" JNIEXPORT jlong JNICALL
-Java_com_eurekateam_samsungextras_interfaces_Swap_getSwapSize(JNIEnv /*env*/,
- jclass /*clazz*/) {
- struct stat stat_buf;
- int rc = stat("/data/swap/swapfile", &stat_buf);
- return rc == 0 ? stat_buf.st_size / 1024 / 1024 : -1;
-}
diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp
deleted file mode 100644
index 6e7f9e2..0000000
--- a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#include "SwapCallbackImpl.h"
-
-::ndk::ScopedAStatus SwapCallbackImpl::respondToBool(bool result) {
- jmethodID mid_callback = env->GetMethodID(cls, "reactToCallbackNative", "()V");
- env->CallBooleanMethod(cls, mid_callback, result);
- return ::ndk::ScopedAStatus::ok();
-}
diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h b/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h
deleted file mode 100644
index 9c94456..0000000
--- a/universal7885-common/apps/SamsungParts/jni/SwapCallbackImpl.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-
-#include
-
-using namespace aidl::vendor::eureka::hardware::parts;
-
-struct SwapCallbackImpl : public BnBoolCallback {
- public:
- SwapCallbackImpl(JNIEnv *_env, jclass _cls) {
- env = _env;
- cls = _cls;
- };
-
- // Methods from aidl::vendor::eureka::hardware::parts::IBoolCallback follow.
- ::ndk::ScopedAStatus respondToBool(bool result) override;
-
- private:
- JNIEnv *env;
- jclass cls;
-};
diff --git a/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp b/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp
deleted file mode 100644
index 2d956a7..0000000
--- a/universal7885-common/apps/SamsungParts/jni/SwapCallbackNative.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "SwapCallbackImpl.h"
-
-#include
-
-#include
-
-extern "C" JNIEXPORT void JNICALL
-Java_com_eurekateam_samsungextras_interfaces_Swap_setSwapOn
-(JNIEnv *env, jclass clazz, jboolean cb) {
- auto svc = ISwapOnData::fromBinder(ndk::SpAIBinder(AServiceManager_waitForService("vendor.eureka.hardware.parts.ISwapOnData/default")));
- svc->setSwapOn(cb ? ndk::SharedRefBase::make(env, clazz) : nullptr);
-}
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/action_presets.xml b/universal7885-common/apps/SamsungParts/res/drawable/action_presets.xml
deleted file mode 100644
index bcdb267..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/action_presets.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/action_reset.xml b/universal7885-common/apps/SamsungParts/res/drawable/action_reset.xml
deleted file mode 100644
index 88b285e..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/action_reset.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_battery.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_battery.xml
deleted file mode 100644
index 85f9055..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_battery.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_bolt.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_bolt.xml
deleted file mode 100644
index af1b64b..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_bolt.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_cabc.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_cabc.xml
deleted file mode 100644
index 6b5884a..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_cabc.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_charge.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_charge.xml
deleted file mode 100644
index 20ae941..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_charge.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_device.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_device.xml
deleted file mode 100644
index c9e1045..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_device.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_doze.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_doze.xml
deleted file mode 100644
index e50723e..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_doze.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_fps_info.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_fps_info.xml
deleted file mode 100644
index 09ba3a0..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_fps_info.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_gpu.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_gpu.xml
deleted file mode 100644
index d746bc0..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_gpu.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_hand.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_hand.xml
deleted file mode 100644
index ca7a27a..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_hand.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_hbm.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_hbm.xml
deleted file mode 100644
index 3e31577..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_hbm.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_headphone.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_headphone.xml
deleted file mode 100644
index 5f33a56..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_headphone.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_led.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_led.xml
deleted file mode 100644
index c037a8a..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_led.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_memory.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_memory.xml
deleted file mode 100644
index 41aea55..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_memory.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_qs_log.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_qs_log.xml
deleted file mode 100644
index 8d27a99..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_qs_log.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml
deleted file mode 100644
index b152021..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml
deleted file mode 100644
index 8caf113..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml
deleted file mode 100644
index cd04892..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_sound.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_speaker_cleaner_icon.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_speaker_cleaner_icon.xml
deleted file mode 100644
index ea17801..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_speaker_cleaner_icon.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_vibrate.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_vibrate.xml
deleted file mode 100644
index 58fc0a1..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/ic_vibrate.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/switchbar_background.xml b/universal7885-common/apps/SamsungParts/res/drawable/switchbar_background.xml
deleted file mode 100644
index 0ded880..0000000
--- a/universal7885-common/apps/SamsungParts/res/drawable/switchbar_background.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/raw/clear_speaker_sound.mp3 b/universal7885-common/apps/SamsungParts/res/raw/clear_speaker_sound.mp3
deleted file mode 100644
index a67b135..0000000
Binary files a/universal7885-common/apps/SamsungParts/res/raw/clear_speaker_sound.mp3 and /dev/null differ
diff --git a/universal7885-common/apps/SamsungParts/res/values-es/strings.xml b/universal7885-common/apps/SamsungParts/res/values-es/strings.xml
deleted file mode 100644
index 9ae77c0..0000000
--- a/universal7885-common/apps/SamsungParts/res/values-es/strings.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
- Partes de Samsung
- Ajustes específicos del dispositivo
-
- Pantalla
-
- Superposición de FPS
- Muestra una superposición con los fotogramas actuales por segundo
-
- Audio
-
- Limpiar altavoz
- Reproduce un audio de 30 segundos para limpiar el altavoz
- Ejecuta esta función una o varias veces si encuentra que su altavoz está ligeramente bloqueado por el polvo. Establezca el volumen multimedia al máximo.\n\nSi el altavoz está muy bloqueado, ejecute esta función de 2 a 5 veces mientras agita el dispositivo con el altavoz hacia abajo.
-
- Dolby Atmos
- Habilita el efecto de audio Dolby Atmos
- Habilita el audio Dolby, como en One UI.
- Modos Dolby disponibles
- Elige uno de estos
- Perfil Automático
- Perfil de Pelicula
- Perfil de Musica
- Perfil de Voz
- Perfil de Juego
- Sin Perfil
- Perfil de Juego 1
- Perfil de Juego 2
- Perfil de audio especial
-
- Características de Eureka Kernel
-
- Brillo de la linterna
- Ajusta el brillo de la linterna
- Samsung OneUI Tiene una opción para ajustar el brillo de la linterna. AOSP no tiene esta función.\n\nUtilice esta función para ajustar el brillo de la linterna bajo o alto. el rango es del 1 a 10.
-
- Varios
-
- Batería
- Configuración de Carga rápida
- Configuración de carga
- Habilite / deshabilite la carga aquí.
- Información y configuración de la batería
- Habilitar / deshabilitar la función de carga rápida
- Administre la función de carga aquí.
- Info Variada de la batería
- Sección para geeks
- Capacidad máxima de la batería (mAh)
- Estado de la batería
- Batería cargada hasta (%)
- Batería cargada hasta (mAh)
- Temperatura actual de la batería
- Corriente de la batería (mA)
-
- Encendido
-
- Apagado
-
- Valor: %s
- Por defecto
- Valor por defecto: %s\nMantenga presionado para establecer
- Se establece el valor predeterminado
-
- Implementación simple de carga inteligente
- Habilitar la implementación
- Ajustar el limite de carga %
- Toque aqui para modificar el ajuste
- limite de readunación de carga
- Limite de carga actual
- reanudación de la carga actual
- Estadisticas del conteo del limite de carga desde el ultimo inicio
- Estadisticas del conteo de reanudaciónes de carga desde el ultimo inicio
- Mueva la barra para ajustar los valores
- desde la izquierda el valor se movera de -10 -1 0 1 10
- \'Testa\' es una implementación simple de la carga inteligente
- basada en el porcentaje de la bateria, Si el porcentaje esta por encima del limite
- la carga se detendra y si el porcentaje baja del limite la carga se readunará,
- el objetivo de esta herramienta es mejorar la salud y la vida de la bateria a largo plazo
-
diff --git a/universal7885-common/apps/SamsungParts/res/values-ru/strings.xml b/universal7885-common/apps/SamsungParts/res/values-ru/strings.xml
deleted file mode 100644
index 94b34c3..0000000
--- a/universal7885-common/apps/SamsungParts/res/values-ru/strings.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
- Опции Samsung
- Дополнительные функции
- Не отображается из-за пользовательских настроек
- Показать данные батареи
-
- Экран
-
- Включить счётчик FPS
- Показать наложение с текущими кадрами в секунду
-
- Звук
- Включить опцию управленя вспышкой (от Eureka)
-
- Очистка динмика
- Воспроизведение 30-секундного звука для очистки динамика
- Запустите эту функцию один или два раза, если вы обнаружите, что ваш динамик слегка забит пылью. Установите громкость на максимум.\n\nЕсли динамик сильно заблокирован, запустите эту функцию 2-5 раза, встряхивая устройство так, чтобы динамик был направлен вниз.
-
- Включить аудио эффекты от Dolby Atmos
-
- Dolby Atmos
-
- Включить Dolby Atmos
-
- Испытайте революционный звук при воспроизведении мультимедиа, который струиться над вами и вокруг вас
-
- Авто
- Игра
- Игра 1
- Игра 2
- Фильм
- Музыка
- Без профиля
- Пространственный звук
- Голос
-
- Возможности Eureka Kernel
-
- Яркость вспышки
- Отрегулируйте яркость фонарика
- Данная возможность перенесена из системы Samsung OneUI. По-умолчанию данная опция отсутствует в AOSP.\n\nИспользуйте эту функцию для регулировки низкой или высокой яркости фонарика. Диапазон от 0 до 10.
- Файл подкачки (SWAP)
- Включить подкачку на EMMC
- Размер подкачки
- Отрегулируйте размер подкачки
- Создайте файл подкачки (не ZRam) на /data разделе. Полезно для устройств с низким объемом памяти
- Количество свободного места на /data
- Размер файла подкачки
-
- Разное
- Двойное нажатие для пробуждения
- Режим перчаток
-
- Батарея
- Быстрая зарядка
- Зарядка
- Включить/Отключить зарядку
- Информация о батареи и настройки
- Включить/Отключить быструю зарядку
- Управление функцией зарядки.
- Разная информация о батарее
- Раздел для инженеров
- Максимальный объем батареи (mAh)
- Статус батареи
- Аккумулятор заряжен до (%)
- Аккумулятор заряжен до (mAh)
- Текущая температура батареи
- Ток батареи (mA)
-
- Включено
-
- Выключено
-
- Смарт-зарядка
- Включить данную реализацию
- Отрегулируйте предел заряда (%)
- Нажмите, чтобы изменить настройки
- Отрегулируйте перезапуск заряда (%)
- Настройка предельного заряда по току (%)
- Настройка заряда при перезапуске (%)
- Статистика количества зарядок с момента последней загрузки
- Статистика количества перезапущенных зарядок с момента последней загрузки
- Перемещайте ползунок, чтобы настроить значения
- Начиная с самого левого, значение будет перемещаться на -10 -1 0 1 10
- Это простая реализация интеллектуальной зарядки, основанная на проценте батареи. Если процент заряда батареи выше предела, зарядка прекращается, или если ниже, она продолжаеться снова. Поможет увеличить срок службы батареи в долгосрочной перспективе.
-
diff --git a/universal7885-common/apps/SamsungParts/res/values/strings.xml b/universal7885-common/apps/SamsungParts/res/values/strings.xml
deleted file mode 100644
index c7a8474..0000000
--- a/universal7885-common/apps/SamsungParts/res/values/strings.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
- SamsungParts
- Device specific tweaks
- Not shown due to user settings
- Show the battery data
-
- Display
-
- FPS info overlay
- Show overlay with current frames per second
-
- Audio
- Enable Eureka flash control feature
-
- 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.
-
- Enable the Dolby Atmos audio effect
-
- Dolby Atmos
-
- Enable Dolby Atmos
-
- Experience breakthrough audio for media playback that flows above and around you
-
- Auto Profile
- Game Profile
- Game 1 Profile
- Game 2 Profile
- Movie Profile
- Music Profile
- No Profile
- Spacial Audio Profile
- Voice Profile
-
- Eureka Kernel Features
-
- FlashLight Brightness
- Adjust FlashLight Brightness
- Samsung\'s OneUI Has An Option to Adjust
- Flashlight Brightness. AOSP doesn\'t have this feature.\n\n
- Use this feature to adjust low or high flashlight brightness. Ranges from 0 to 10.
- Swap on userdata
- Enable swap on EMMC
- Swap size
- Adjust the size of swap
- Creates the swap (not zram) on /data partiton. Useful for low memory devices.
- Free space on /data
- Swap file size
-
- Misc
- Toggle for double tap to wake
- Toggle for glove mode
-
- Battery
- FastCharge Settings
- Charging Settings
- Enable/Disable Charging here.
- Battery Info and Settings
- Enable/Disable Fastcharge Feature
- Manage Charging Feature here.
- Battery Misc Info
- Section for geeks
- Battery Max Capacity (mAh)
- Battery Status
- Battery Charged Up To (%)
- Battery Charged Up To (mAh)
- Battery Current Temperature
- Battery Current (mA)
-
- On
-
- Off
-
- Simple SmartCharge Implementation
- Enable The Implementation
- Adjust Charge Limit %
- Tap here to adjust the settings
- Adjust Charge Restart %
- Current Limit Charge % Setting
- Current Restart Charge % Setting
- Stats of limited charging count since last boot
- Stats of restarted charging count since last boot
- Move the seekbar to adjust values
- From the most left, the value will move by -10 -1 0 1 10
- This is a simple smartcharge implementation based on
- battery percentage. If the battery percent is above limit, the charging stops, or if it is
- below restart, it charges again. Said to improve battery life in long term
-
diff --git a/universal7885-common/apps/SamsungParts/res/values/styles.xml b/universal7885-common/apps/SamsungParts/res/values/styles.xml
deleted file mode 100644
index 2742154..0000000
--- a/universal7885-common/apps/SamsungParts/res/values/styles.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/battery_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/battery_settings.xml
deleted file mode 100644
index 3e86850..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/battery_settings.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml
deleted file mode 100644
index 65e2457..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/clear_speaker_settings.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/dolby_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/dolby_settings.xml
deleted file mode 100644
index 096885d..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/dolby_settings.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/flashlight_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/flashlight_settings.xml
deleted file mode 100644
index aca83f8..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/flashlight_settings.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml b/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
deleted file mode 100644
index ae022f5..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/smartcharge_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/smartcharge_settings.xml
deleted file mode 100644
index 3d375b6..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/smartcharge_settings.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/res/xml/swap_settings.xml b/universal7885-common/apps/SamsungParts/res/xml/swap_settings.xml
deleted file mode 100644
index 91919f2..0000000
--- a/universal7885-common/apps/SamsungParts/res/xml/swap_settings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt
deleted file mode 100644
index 92dcb5c..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt
+++ /dev/null
@@ -1,65 +0,0 @@
-package com.eurekateam.samsungextras
-
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import android.util.Log
-import androidx.preference.PreferenceManager
-import com.eurekateam.samsungextras.battery.BatteryFragment
-import com.eurekateam.samsungextras.dolby.DolbyCore
-import com.eurekateam.samsungextras.dolby.DolbyFragment
-import com.eurekateam.samsungextras.flashlight.FlashLightFragment
-import com.eurekateam.samsungextras.smartcharge.SmartChargeFragment
-import com.eurekateam.samsungextras.interfaces.Battery
-import com.eurekateam.samsungextras.interfaces.Display
-import com.eurekateam.samsungextras.interfaces.FlashLight
-import com.eurekateam.samsungextras.interfaces.Swap
-import com.eurekateam.samsungextras.interfaces.SmartCharge
-import com.eurekateam.samsungextras.swap.SwapFragment
-
-class BootReceiver : BroadcastReceiver() {
- override fun onReceive(p0: Context?, p1: Intent?) {
- val mSharedPreferences = p0?.let { PreferenceManager.getDefaultSharedPreferences(it) }
- if (p1 != null && mSharedPreferences != null) {
- if (p1.action == Intent.ACTION_LOCKED_BOOT_COMPLETED) {
- System.loadLibrary("StorageHelper")
- System.loadLibrary("SwapCallback")
- // Battery
- val mBattery = Battery()
- mBattery.Charge = mSharedPreferences.getBoolean(BatteryFragment.PREF_CHARGE, true)
- mBattery.FastCharge = mSharedPreferences.getBoolean(BatteryFragment.PREF_FASTCHARGE, true)
- // Dolby
- DolbyCore.setEnabled(
- mSharedPreferences
- .getBoolean(DolbyFragment.PREF_DOLBY_ENABLE, true)
- )
- DolbyCore.setProfile(
- mSharedPreferences
- .getInt(DolbyFragment.PREF_DOLBY_PROFILE, 8)
- )
-
- // FlashLight
- val mFlash = FlashLight()
- mFlash.setFlash(mSharedPreferences.getInt(FlashLightFragment.PREF_FLASHLIGHT, 5))
-
- // ZRAM
- val mSwap = Swap()
- if (mSharedPreferences.getBoolean(SwapFragment.PREF_SWAP_ENABLE, false)) {
- mSwap.setSwapOn(false)
- }
-
- // Display
- val mDisplay = Display()
- mDisplay.DT2W = mSharedPreferences.getBoolean(DeviceSettings.PREF_DOUBLE_TAP, true)
- mDisplay.GloveMode = mSharedPreferences.getBoolean(DeviceSettings.PREF_GLOVE_MODE, false)
-
- val limit = mSharedPreferences.getInt(SmartChargeFragment.PREF_LIMIT, 20)
- val restart = mSharedPreferences.getInt(SmartChargeFragment.PREF_RESTART, 80)
- val mSmartCharge = SmartCharge()
- mSmartCharge.setConfig(limit, restart)
-
- Log.i("SamsungParts", "Applied settings")
- }
- }
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt
deleted file mode 100644
index fdfe856..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras
-
-import android.content.Intent
-import android.content.SharedPreferences
-import android.os.Build
-import android.os.Bundle
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import androidx.preference.SwitchPreference
-import com.eurekateam.samsungextras.battery.BatteryActivity
-import com.eurekateam.samsungextras.flashlight.FlashLightActivity
-import com.eurekateam.samsungextras.fps.FPSInfoService
-import com.eurekateam.samsungextras.interfaces.Display
-import com.eurekateam.samsungextras.speaker.ClearSpeakerActivity
-import com.eurekateam.samsungextras.smartcharge.SmartChargeActivity
-
-class DeviceSettings : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener {
-
- private lateinit var mPrefs: SharedPreferences
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- System.loadLibrary("StorageHelper")
- System.loadLibrary("SwapCallback")
- setPreferencesFromResource(R.xml.preferences_samsung_parts, rootKey)
- mPrefs = PreferenceManager.getDefaultSharedPreferences(requireContext())
- val mClearSpeakerPref = findPreference(PREF_CLEAR_SPEAKER)!!
- mClearSpeakerPref.onPreferenceClickListener =
- Preference.OnPreferenceClickListener {
- val intent = Intent(requireActivity().applicationContext, ClearSpeakerActivity::class.java)
- startActivity(intent)
- true
- }
- val mFpsInfo = findPreference(PREF_KEY_FPS_INFO)!!
- mFpsInfo.isChecked = mPrefs.getBoolean(PREF_KEY_FPS_INFO, false)
- mFpsInfo.onPreferenceChangeListener = this
- val mDT2W = findPreference(PREF_DOUBLE_TAP)!!
- mDT2W.onPreferenceChangeListener = this
- mDT2W.isEnabled = !(Build.PRODUCT.contains("a10") || Build.PRODUCT.contains("a20e"))
- mDT2W.isChecked = mPrefs.getBoolean(PREF_DOUBLE_TAP, false)
- val mGloveMode = findPreference(PREF_GLOVE_MODE)!!
- mGloveMode.onPreferenceChangeListener = this
- mGloveMode.isEnabled = !Build.PRODUCT.contains("a10")
- mGloveMode.isChecked = mPrefs.getBoolean(PREF_GLOVE_MODE, false)
- val mFlashLight = findPreference(PREF_FLASHLIGHT)!!
- mFlashLight.onPreferenceClickListener =
- Preference.OnPreferenceClickListener {
- val intent = Intent(requireActivity().applicationContext, FlashLightActivity::class.java)
- startActivity(intent)
- true
- }
- val mFastCharge = findPreference(PREF_BATTERY)!!
- mFastCharge.onPreferenceClickListener =
- Preference.OnPreferenceClickListener {
- val intent = Intent(requireActivity().applicationContext, BatteryActivity::class.java)
- startActivity(intent)
- true
- }
- val mSmartCharge = findPreference(PREF_SMARTCHARGE)!!
- mSmartCharge.onPreferenceClickListener =
- Preference.OnPreferenceClickListener {
- val intent = Intent(requireActivity().applicationContext, SmartChargeActivity::class.java)
- startActivity(intent)
- true
- }
- }
-
- override fun onPreferenceChange(preference: Preference, value: Any): Boolean {
- val mDisplay = Display()
- when (preference.key) {
- PREF_KEY_FPS_INFO -> {
- val mEnabled = value as Boolean
- val mFPSService = Intent(this.context, FPSInfoService::class.java)
- if (mEnabled) {
- requireContext().startService(mFPSService)
- } else {
- requireContext().stopService(mFPSService)
- }
- mPrefs.edit().putBoolean(PREF_KEY_FPS_INFO, mEnabled).apply()
- }
- PREF_DOUBLE_TAP -> {
- mDisplay.DT2W = value as Boolean
- mPrefs.edit().putBoolean(PREF_DOUBLE_TAP, value).apply()
- }
- PREF_GLOVE_MODE -> {
- mDisplay.GloveMode = value as Boolean
- mPrefs.edit().putBoolean(PREF_GLOVE_MODE, value).apply()
- }
- else -> {
- return false
- }
- }
- return true
- }
-
- companion object {
- const val PREF_KEY_FPS_INFO = "fps_info"
- private const val PREF_CLEAR_SPEAKER = "clear_speaker_settings"
- private const val PREF_FLASHLIGHT = "flashlight_settings"
- const val PREF_DOUBLE_TAP = "dt2w_settings"
- const val PREF_GLOVE_MODE = "glove_mode_settings"
- const val PREF_BATTERY = "battery_settings"
- const val PREF_SMARTCHARGE = "smartcharge_settings"
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt
deleted file mode 100644
index fe52965..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class DeviceSettingsActivity : CollapsingToolbarBaseActivity() {
- public override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- DeviceSettings()
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/SurfaceFlingerFPS.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/SurfaceFlingerFPS.kt
deleted file mode 100644
index cf11761..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/SurfaceFlingerFPS.kt
+++ /dev/null
@@ -1,176 +0,0 @@
-package com.eurekateam.samsungextras
-
-import android.os.Parcel
-import android.os.ServiceManager
-
-/*
- * Copyright (C) 2020-2021 Samsung Electronics Co. Ltd
- * This Class is based on Samsung's OneUI 3.1
- * /system/frameworks/gamesdk.jar
- */
-class SurfaceFlingerFPS private constructor() {
- private var mFps: Double
- private val mLock: Any = Any()
- private var mPrevFPSCheckStartTime: Long
- private var mPrevFlipCount: Int
- private var mPrevFps: Double
- private var running = false
- private var mPrevPrevCheckStartTime: Long
- private var mPrevPrevFlipCount: Int
-
- @Volatile
- private var mSkipUpdate = false
-
- @Volatile
- private var mStopThread = false
- private var mThread: ThreadGetFlip? = null
-
- /**
- * Starts the thread
- */
- fun start() {
- synchronized(this) {
- if (mThread == null || mStopThread) {
- mStopThread = false
- val threadGetFlip = ThreadGetFlip()
- mThread = threadGetFlip
- threadGetFlip.start()
- running = true
- }
- }
- }
-
- /**
- * Stops the thread
- */
- fun stop() {
- synchronized(this) {
- mStopThread = true
- if (mThread != null) {
- mThread!!.interrupt()
- }
- mThread = null
- running = false
- }
- }
-
- /**
- * Check if the fps monitor is able to start
- * @return true if able to start, else false
- */
- private val isAvailable: Boolean
- get() = mStopThread || mThread == null
-
- private fun updateCurrentFps() {
- try {
- synchronized(mLock) {
- mSkipUpdate = true
- val curTime = System.currentTimeMillis()
- val curFlipCount = flipCount
- mFps = if (curTime - mPrevFPSCheckStartTime < 200) {
- (curFlipCount - mPrevPrevFlipCount).toDouble() / ((curTime - mPrevPrevCheckStartTime).toDouble() / 1000.0)
- } else {
- (curFlipCount - mPrevFlipCount).toDouble() / ((curTime - mPrevFPSCheckStartTime).toDouble() / 1000.0)
- }
- if (mFps < 1.0) {
- mFps = mPrevFps
- }
- mPrevFlipCount = curFlipCount
- mPrevFPSCheckStartTime = curTime
- mPrevFps = mFps
- mSkipUpdate = false
- }
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
-
- /**
- * Gets the fps value from internal thread
- * @return fps value in Double
- */
- val fps: Double
- get() {
- if (isAvailable) {
- return -999.0
- }
- updateCurrentFps()
- return mFps
- }
-
- /**
- * Gets the flip count from SurfaceFlinger Service
- * @return flip count
- */
- private val flipCount: Int
- get() {
- var flipCount = -1
- try {
- val data = Parcel.obtain()
- val reply = Parcel.obtain()
- try {
- val surfaceFlinger = ServiceManager.getService("SurfaceFlinger")
- data.writeInterfaceToken("android.ui.ISurfaceComposer")
- if (surfaceFlinger != null && surfaceFlinger.transact(1013, data, reply, 0)) {
- flipCount = reply.readInt()
- }
- } catch (e: Exception) {
- e.printStackTrace()
- }
- data.recycle()
- reply.recycle()
- } catch (e2: Exception) {
- e2.printStackTrace()
- }
- return flipCount
- }
-
- /* access modifiers changed from: private */
- fun updateFlipCountRecord() {
- try {
- synchronized(mLock) {
- mPrevPrevCheckStartTime = mPrevFPSCheckStartTime
- mPrevPrevFlipCount = mPrevFlipCount
- mPrevFPSCheckStartTime = System.currentTimeMillis()
- mPrevFlipCount = flipCount
- }
- } catch (e: Exception) {
- e.printStackTrace()
- }
- }
-
- /* access modifiers changed from: private */ /* loaded from: classes.dex */
- inner class ThreadGetFlip : Thread() {
- // java.lang.Thread, java.lang.Runnable
- override fun run() {
- while (!mStopThread) {
- if (!mSkipUpdate) {
- updateFlipCountRecord()
- try {
- sleep(300)
- } catch (e: InterruptedException) {
- e.printStackTrace()
- }
- }
- }
- }
- }
-
- companion object {
- /**
- * Gets an instance of this class
- * @return new instance
- */
- val instance: SurfaceFlingerFPS
- get() = SurfaceFlingerFPS()
- }
-
- init {
- mFps = 0.0
- mPrevFps = 0.0
- mPrevFlipCount = 0
- mPrevFPSCheckStartTime = 0
- mPrevPrevFlipCount = 0
- mPrevPrevCheckStartTime = 0
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryActivity.kt
deleted file mode 100644
index 1e74284..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryActivity.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.battery
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class BatteryActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : BatteryFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = BatteryFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryFragment.kt
deleted file mode 100644
index b12bb1a..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/battery/BatteryFragment.kt
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.battery
-
-import android.content.SharedPreferences
-import android.os.Bundle
-import android.widget.Switch
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import androidx.preference.SwitchPreference
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.eurekateam.samsungextras.R
-import com.eurekateam.samsungextras.interfaces.Battery
-import com.eurekateam.samsungextras.interfaces.BatteryIds
-import java.util.concurrent.ScheduledThreadPoolExecutor
-import java.util.concurrent.TimeUnit
-
-class BatteryFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
- private lateinit var mFastChargePref: SwitchPreference
- private var mPoolExecutor: ScheduledThreadPoolExecutor? = null
- private lateinit var mChargePref: SwitchPreference
- private lateinit var mShowDataPref: MainSwitchPreference
- private lateinit var mSharedPreferences: SharedPreferences
- private val mBattery = Battery()
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.battery_settings)
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
- mFastChargePref = findPreference(PREF_FASTCHARGE)!!
- mFastChargePref.onPreferenceChangeListener = this
- mFastChargePref.isChecked = mSharedPreferences.getBoolean(PREF_FASTCHARGE, true)
- mChargePref = findPreference(PREF_CHARGE)!!
- mChargePref.onPreferenceChangeListener = this
- mChargePref.isChecked = mSharedPreferences.getBoolean(PREF_CHARGE, true)
- mShowDataPref = findPreference(PREF_SHOW_DATA)!!
- mShowDataPref.isChecked = mSharedPreferences.getBoolean(PREF_SHOW_DATA, true)
- mShowDataPref.addOnSwitchChangeListener(this)
- if (mShowDataPref.isChecked) {
- mPoolExecutor = ScheduledThreadPoolExecutor(3)
- mPoolExecutor!!.scheduleWithFixedDelay(mScheduler, 0, 2, TimeUnit.SECONDS)
- }
- }
-
- override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
- if (preference == mChargePref) {
- mBattery.Charge = newValue as Boolean
- mChargePref.isChecked = mBattery.Charge
- mSharedPreferences.edit().putBoolean(PREF_CHARGE, mBattery.Charge).apply()
- return true
- } else if (preference == mFastChargePref) {
- mBattery.FastCharge = newValue as Boolean
- mFastChargePref.isChecked = mBattery.FastCharge
- mSharedPreferences.edit().putBoolean(PREF_FASTCHARGE, mBattery.FastCharge).apply()
- return true
- }
- return false
- }
- private val mScheduler = Runnable {
- requireActivity().runOnUiThread {
- findPreference(INFO_MAX_CAP)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_MAX).toString() + " mAh"
- findPreference(INFO_CHARGED_UP_TO)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_CURRENT).toString() + " %"
- findPreference(INFO_CHARGED_MAH)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CAPACITY_CURRENT_MAH).toString() + " mAh"
- findPreference(INFO_CURRENT)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_CURRENT).toString() + " mA"
- findPreference(INFO_STATUS)!!.summary = if (mBattery.getGeneralBatteryStats(BatteryIds.CHARGING_STATE) == 1) "Charging" else "Discharging"
- findPreference(INFO_TEMP)!!.summary = mBattery.getGeneralBatteryStats(BatteryIds.BATTERY_TEMP).toString() + " \u2103"
- }
- }
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- if (isChecked) {
- if (mPoolExecutor == null) {
- mPoolExecutor = ScheduledThreadPoolExecutor(2)
- mPoolExecutor!!.scheduleWithFixedDelay(
- mScheduler,
- 0,
- 2,
- TimeUnit.SECONDS
- )
- }
- } else {
- if (mPoolExecutor != null) {
- mPoolExecutor!!.shutdown()
- mPoolExecutor = null
- }
- val mNotShown = requireContext().getString(R.string.not_shown)
- findPreference(INFO_MAX_CAP)!!.summary = mNotShown
- findPreference(INFO_CHARGED_UP_TO)!!.summary = mNotShown
- findPreference(INFO_CHARGED_MAH)!!.summary = mNotShown
- findPreference(INFO_CURRENT)!!.summary = mNotShown
- findPreference(INFO_STATUS)!!.summary = mNotShown
- findPreference(INFO_TEMP)!!.summary = mNotShown
- }
- mSharedPreferences.edit().putBoolean(PREF_SHOW_DATA, isChecked).apply()
- }
-
- companion object {
- const val PREF_FASTCHARGE = "fastcharge_pref"
- const val PREF_CHARGE = "charge_pref"
- const val INFO_MAX_CAP = "battery_capacity"
- const val INFO_CHARGED_UP_TO = "battery_charged_up_to"
- const val INFO_CHARGED_MAH = "battery_charged_up_to_mah"
- const val INFO_CURRENT = "battery_current"
- const val INFO_STATUS = "battery_status"
- const val INFO_TEMP = "battery_temp"
- const val PREF_SHOW_DATA = "show_data"
- private const val BATTERY_INFO = "battery_info"
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyActivity.kt
deleted file mode 100644
index 8f76b1d..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyActivity.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.eurekateam.samsungextras.dolby
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class DolbyActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : DolbyFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = DolbyFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyCore.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyCore.kt
deleted file mode 100644
index c68d3b8..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyCore.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.eurekateam.samsungextras.dolby
-
-import android.content.Context
-import android.media.audiofx.AudioEffect
-import com.eurekateam.samsungextras.dolby.DolbyFragment.Companion.PREF_DOLBY_MODES
-import java.util.UUID
-
-object DolbyCore {
- private const val EFFECT_PARAM_PROFILE = 0
- private const val EFFECT_PARAM_EFF_ENAB = 19
-
- private val EFFECT_TYPE_DAP = UUID.fromString("46d279d9-9be7-453d-9d7c-ef937f675587")
-
- const val PROFILE_AUTO = 0
- const val PROFILE_MOVIE = 1
- const val PROFILE_MUSIC = 2
- const val PROFILE_VOICE = 3
- const val PROFILE_GAME = 4
- const val PROFILE_OFF = 5
- const val PROFILE_GAME_1 = 6
- const val PROFILE_GAME_2 = 7
- const val PROFILE_SPACIAL_AUDIO = 8
-
- private val audioEffect = runCatching {
- AudioEffect(EFFECT_TYPE_DAP, AudioEffect.EFFECT_TYPE_NULL, 0, 0)
- }.getOrNull()
-
- fun getProfile(): Int {
- val out = intArrayOf(PROFILE_AUTO)
- audioEffect?.getParameter(EFFECT_PARAM_PROFILE, out)
- return out.first().coerceIn(PROFILE_AUTO, PROFILE_SPACIAL_AUDIO)
- }
-
- fun getProfileName(context: Context): String {
- val profile = getProfile()
- val resourceName = PREF_DOLBY_MODES.filter { it.value == profile }.keys.first()
-
- return context.resources.getString(
- context.resources.getIdentifier(
- resourceName,
- "string",
- context.packageName
- )
- )
- }
-
- fun setProfile(profile: Int) {
- audioEffect?.setParameter(EFFECT_PARAM_EFF_ENAB, 1)
- audioEffect?.setParameter(EFFECT_PARAM_PROFILE, profile)
- }
-
- fun setEnabled(enabled: Boolean) {
- audioEffect?.enabled = enabled
- }
-
- fun isEnabled() = audioEffect?.enabled ?: false
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyFragment.kt
deleted file mode 100644
index 8f9c927..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyFragment.kt
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.eurekateam.samsungextras.dolby
-
-import android.content.SharedPreferences
-import android.os.Bundle
-import android.widget.Switch
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.android.settingslib.widget.RadioButtonPreference
-import com.eurekateam.samsungextras.R
-
-class DolbyFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener {
-
- private lateinit var switchBar: MainSwitchPreference
- private lateinit var mSharedPreferences: SharedPreferences
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.dolby_settings)
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
- switchBar = findPreference(PREF_DOLBY_ENABLE)!!
- switchBar.addOnSwitchChangeListener(this)
- switchBar.isChecked = DolbyCore.isEnabled()
-
- for ((key, value) in PREF_DOLBY_MODES) {
- val preference = findPreference(key)!!
- preference.setOnPreferenceClickListener {
- setProfile(value)
- true
- }
- }
- }
-
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- DolbyCore.setEnabled(isChecked)
- mSharedPreferences.edit().putBoolean(PREF_DOLBY_ENABLE, true).apply()
- }
-
- private fun setProfile(profile: Int) {
- DolbyCore.setProfile(profile)
-
- for ((key, value) in PREF_DOLBY_MODES) {
- val preference = findPreference(key)!!
- preference.isChecked = value == profile
- }
- mSharedPreferences.edit().putInt(PREF_DOLBY_PROFILE, profile).apply()
- }
-
- companion object {
- const val PREF_DOLBY_ENABLE = "dolby_enable"
- const val PREF_DOLBY_PROFILE = "dolby_profile"
- val PREF_DOLBY_MODES = mapOf(
- "dolby_profile_auto" to DolbyCore.PROFILE_AUTO,
- "dolby_profile_movie" to DolbyCore.PROFILE_MOVIE,
- "dolby_profile_music" to DolbyCore.PROFILE_MUSIC,
- "dolby_profile_voice" to DolbyCore.PROFILE_VOICE,
- "dolby_profile_game" to DolbyCore.PROFILE_GAME,
- "dolby_profile_off" to DolbyCore.PROFILE_OFF,
- "dolby_profile_game_1" to DolbyCore.PROFILE_GAME_1,
- "dolby_profile_game_2" to DolbyCore.PROFILE_GAME_2,
- "dolby_profile_spacial_audio" to DolbyCore.PROFILE_SPACIAL_AUDIO
- )
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbySearchIndexablesProvider.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbySearchIndexablesProvider.kt
deleted file mode 100644
index 8f6d23f..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbySearchIndexablesProvider.kt
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.eurekateam.samsungextras.dolby
-
-import android.database.Cursor
-import android.database.MatrixCursor
-import android.provider.SearchIndexableResource
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_CLASS_NAME
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_ICON_RESID
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_ACTION
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RANK
-import android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RESID
-import android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS
-import android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS
-import android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS
-import android.provider.SearchIndexablesProvider
-import com.eurekateam.samsungextras.R
-
-class DolbySearchIndexablesProvider : SearchIndexablesProvider() {
- override fun onCreate(): Boolean = true
-
- override fun queryXmlResources(projection: Array?): Cursor {
- val cursor = MatrixCursor(INDEXABLES_XML_RES_COLUMNS)
- INDEXABLE_RES.forEach {
- cursor.addRow(generateResourceRef(it))
- }
- return cursor
- }
-
- override fun queryRawData(projection: Array?): Cursor {
- return MatrixCursor(INDEXABLES_RAW_COLUMNS)
- }
-
- override fun queryNonIndexableKeys(projection: Array?): Cursor {
- return MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS)
- }
-
- private fun generateResourceRef(sir: SearchIndexableResource): Array {
- val ref = arrayOfNulls(7)
- ref[COLUMN_INDEX_XML_RES_RANK] = sir.rank
- ref[COLUMN_INDEX_XML_RES_RESID] = sir.xmlResId
- ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null
- ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId
- ref[COLUMN_INDEX_XML_RES_INTENT_ACTION] = "com.android.settings.action.EXTRA_SETTINGS"
- ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "com.eurekateam.samsungextras.dolby"
- ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className
- return ref
- }
-
- companion object {
- private const val TAG = "DolbySearchIndexablesProvider"
-
- private val INDEXABLE_RES = arrayOf(
- SearchIndexableResource(
- 1,
- R.xml.dolby_settings,
- DolbyActivity::class.java.name,
- 0
- )
- )
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyTile.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyTile.kt
deleted file mode 100644
index 115ae63..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/dolby/DolbyTile.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2022 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 com.eurekateam.samsungextras.dolby
-
-import android.service.quicksettings.Tile
-import android.service.quicksettings.TileService
-import androidx.preference.PreferenceManager
-import com.eurekateam.samsungextras.dolby.DolbyFragment.Companion.PREF_DOLBY_ENABLE
-
-class DolbyTile : TileService() {
- private var isEnabled = false
- set(value) {
- field = value
- qsTile.state = if (value) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
- qsTile.subtitle = DolbyCore.getProfileName(this)
- qsTile.updateTile()
- }
-
- override fun onStartListening() {
- super.onStartListening()
- isEnabled = DolbyCore.isEnabled()
- }
-
- override fun onClick() {
- isEnabled = !isEnabled
- DolbyCore.setEnabled(isEnabled)
- PreferenceManager.getDefaultSharedPreferences(this)
- .edit()
- .putBoolean(PREF_DOLBY_ENABLE, isEnabled)
- .apply()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightActivity.kt
deleted file mode 100644
index 3ecd79f..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightActivity.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.flashlight
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class FlashLightActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : FlashLightFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = FlashLightFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightFragment.kt
deleted file mode 100644
index 445d38c..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/flashlight/FlashLightFragment.kt
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.flashlight
-
-import android.content.SharedPreferences
-import android.os.Build
-import android.os.Bundle
-import android.widget.Switch
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import androidx.preference.SeekBarPreference
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.eurekateam.samsungextras.R
-import com.eurekateam.samsungextras.interfaces.FlashLight
-
-class FlashLightFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
- private lateinit var mFlashLightPref: SeekBarPreference
- private lateinit var mSharedPreferences: SharedPreferences
- private lateinit var mFlashLightEnable: MainSwitchPreference
- private val mFlashLight = FlashLight()
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.flashlight_settings)
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
- mFlashLightPref = findPreference(PREF_FLASHLIGHT)!!
- mFlashLightPref.onPreferenceChangeListener = this
- mFlashLightPref.setMax(10)
- mFlashLightPref.setMin(1)
- mFlashLightPref.value = mFlashLight.getFlash(Build.DEVICE.contains("a10"))
- mFlashLightPref.showSeekBarValue = true
- mFlashLightEnable = findPreference(PREF_FLASHLIGHT_ENABLE)!!
- mFlashLightEnable.isChecked = mSharedPreferences.getBoolean(PREF_FLASHLIGHT_ENABLE, true)
- mFlashLightEnable.addOnSwitchChangeListener(this)
- mFlashLightPref.isEnabled = mFlashLightEnable.isChecked
- }
-
- override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
- if (preference == mFlashLightPref) {
- val value = newValue as Int
- mFlashLight.setFlash(value)
- mSharedPreferences.edit().putInt(PREF_FLASHLIGHT, value).apply()
- return true
- }
- return false
- }
-
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- mFlashLight.setEnabled(isChecked)
- mSharedPreferences.edit().putBoolean(PREF_FLASHLIGHT_ENABLE, isChecked)
- mFlashLightPref.isEnabled = isChecked
- }
-
- companion object {
- const val PREF_FLASHLIGHT = "flashlight_pref"
- const val PREF_FLASHLIGHT_ENABLE = "flashlight_enable"
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSInfoService.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSInfoService.kt
deleted file mode 100644
index 9e199fd..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSInfoService.kt
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.fps
-
-import android.app.Service
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import android.content.IntentFilter
-import android.graphics.*
-import android.os.*
-import android.service.dreams.DreamService
-import android.service.dreams.IDreamManager
-import android.util.Log
-import android.view.Gravity
-import android.view.View
-import android.view.WindowManager
-import com.eurekateam.samsungextras.SurfaceFlingerFPS
-import kotlin.math.roundToInt
-
-open class FPSInfoService : Service() {
- private var mView: View? = null
- private var mCurFPSThread: Thread? = null
- private val TAG = "FPSInfoService"
- private var fPSInfoString: String? = null
- private var mDreamManager: IDreamManager? = null
-
- private inner class FPSView(c: Context) : View(c) {
- private val mOnlinePaint: Paint?
- private val mAscent: Float
- private var mMaxWidth = 0
- private var mNeededWidth = 0
- private var mNeededHeight = 0
- private var mDataAvail = false
- private val mCurFPSHandler: Handler = object : Handler(Looper.getMainLooper()) {
- override fun handleMessage(msg: Message) {
- if (msg.obj == null || msg.what != 1) {
- return
- }
- val msgData = msg.obj as String
- fPSInfoString = "$msgData FPS"
- mDataAvail = true
- updateDisplay()
- }
- }
-
- override fun onDetachedFromWindow() {
- super.onDetachedFromWindow()
- mCurFPSHandler.removeMessages(1)
- }
-
- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
- setMeasuredDimension(
- resolveSize(mNeededWidth, widthMeasureSpec),
- resolveSize(mNeededHeight, heightMeasureSpec)
- )
- }
-
- public override fun onDraw(canvas: Canvas) {
- super.onDraw(canvas)
- if (!mDataAvail) {
- return
- }
- val LEFT = width - 1
- val y = mPaddingTop - mAscent.toInt()
- val s = fPSInfoString
- canvas.drawText(
- s,
- (LEFT - mPaddingLeft - mMaxWidth).toFloat(),
- (
- y - 1
- ).toFloat(),
- mOnlinePaint
- )
- }
-
- fun updateDisplay() {
- if (!mDataAvail) {
- return
- }
- if (mOnlinePaint != null) {
- mMaxWidth = mOnlinePaint.measureText(fPSInfoString).toInt()
- }
- val neededWidth = mPaddingLeft + mPaddingRight + mMaxWidth
- val neededHeight = mPaddingTop + mPaddingBottom + 40
- if (neededWidth != mNeededWidth || neededHeight != mNeededHeight) {
- mNeededWidth = neededWidth
- mNeededHeight = neededHeight
- requestLayout()
- } else {
- invalidate()
- }
- }
-
- override fun getHandler(): Handler {
- return mCurFPSHandler
- }
-
- init {
- val density = c.resources.displayMetrics.density
- val paddingPx = (5 * density).roundToInt()
- setPadding(paddingPx, paddingPx, paddingPx, paddingPx)
- setBackgroundColor(Color.argb(0x60, 0, 0, 0))
- val textSize = (12 * density).roundToInt()
- val typeface = Typeface.create("monospace", Typeface.NORMAL)
- mOnlinePaint = Paint()
- mOnlinePaint.typeface = typeface
- mOnlinePaint.isAntiAlias = true
- mOnlinePaint.textSize = textSize.toFloat()
- mOnlinePaint.color = Color.WHITE
- mOnlinePaint.setShadowLayer(5.0f, 0.0f, 0.0f, Color.BLACK)
- mAscent = mOnlinePaint.ascent()
- mOnlinePaint.descent()
- updateDisplay()
- }
- }
-
- /**
- * Thead to monitor fps
- */
- protected class CurFPSThread(private val mHandler: Handler) : Thread() {
- private var mInterrupt = false
- override fun interrupt() {
- mInterrupt = true
- }
-
- override fun run() {
- try {
- while (!mInterrupt) {
- sleep(500)
- StringBuilder()
- val fpsVal = surfaceFlingerFPS?.fps?.roundToInt().toString()
- mHandler.sendMessage(mHandler.obtainMessage(1, fpsVal))
- }
- } catch (ignored: InterruptedException) {
- }
- }
- }
-
- override fun onCreate() {
- super.onCreate()
- mView = FPSView(this)
- val params = WindowManager.LayoutParams(
- WindowManager.LayoutParams.WRAP_CONTENT,
- WindowManager.LayoutParams.WRAP_CONTENT,
- WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY,
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
- WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
- PixelFormat.TRANSLUCENT
- )
- params.y = 50
- params.gravity = Gravity.START or Gravity.TOP
- params.title = "FPS Info"
- surfaceFlingerFPS = SurfaceFlingerFPS.instance
- startThread()
- mDreamManager = IDreamManager.Stub.asInterface(
- ServiceManager.checkService(DreamService.DREAM_SERVICE)
- )
- val screenStateFilter = IntentFilter(Intent.ACTION_SCREEN_ON)
- screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF)
- registerReceiver(mScreenStateReceiver, screenStateFilter)
- val wm = getSystemService(WINDOW_SERVICE) as WindowManager
- wm.addView(mView, params)
- }
-
- override fun onDestroy() {
- super.onDestroy()
- stopThread()
- (getSystemService(WINDOW_SERVICE) as WindowManager).removeView(mView)
- mView = null
- unregisterReceiver(mScreenStateReceiver)
- }
-
- override fun onBind(intent: Intent): IBinder? {
- return null
- }
-
- private val mScreenStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
- override fun onReceive(context: Context, intent: Intent) {
- if (intent.action == Intent.ACTION_SCREEN_ON) {
- Log.d(TAG, "ACTION_SCREEN_ON $isDozeMode")
- if (!isDozeMode) {
- startThread()
- mView!!.visibility = View.VISIBLE
- }
- } else if (intent.action == Intent.ACTION_SCREEN_OFF) {
- Log.d(TAG, "ACTION_SCREEN_OFF")
- mView!!.visibility = View.GONE
- stopThread()
- }
- }
- }
-
- /**
- * Find is the device is in doze mode
- * @return true if device is in doze mode, else false
- */
- private val isDozeMode: Boolean
- get() {
- try {
- if (mDreamManager != null && mDreamManager!!.isDreaming) {
- return true
- }
- } catch (e: RemoteException) {
- return false
- }
- return false
- }
-
- private fun startThread() {
- Log.d(TAG, "started CurFPSThread")
- mRunning = true
- mCurFPSThread = CurFPSThread(mView!!.handler)
- surfaceFlingerFPS!!.start()
- mCurFPSThread?.start()
- }
-
- private fun stopThread() {
- if (mCurFPSThread != null && mCurFPSThread!!.isAlive) {
- Log.d(TAG, "stopping CurFPSThread")
- surfaceFlingerFPS!!.stop()
- mCurFPSThread!!.interrupt()
- try {
- mCurFPSThread!!.join()
- } catch (e: InterruptedException) {
- e.printStackTrace()
- }
- }
- mRunning = false
- mCurFPSThread = null
- }
-
- fun getRunning(): Boolean {
- return mRunning
- }
- companion object {
- private var surfaceFlingerFPS: SurfaceFlingerFPS? = null
- private var mRunning: Boolean = false
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSTileService.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSTileService.kt
deleted file mode 100644
index 3794886..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/fps/FPSTileService.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.fps
-
-import android.content.Intent
-import android.service.quicksettings.Tile
-import android.service.quicksettings.TileService
-
-// TODO: Add FPS drawables
-class FPSTileService : TileService() {
- private lateinit var fpsinfo: Intent
- private var isShowing = false
- override fun onStartListening() {
- super.onStartListening()
- fpsinfo = Intent(this, FPSInfoService::class.java)
- val fpsInfoService = FPSInfoService()
- isShowing = fpsInfoService.getRunning()
- updateTile()
- }
-
- override fun onClick() {
- if (!isShowing) startService(fpsinfo) else stopService(fpsinfo)
- isShowing = !isShowing
- updateTile()
- }
-
- private fun updateTile() {
- val tile = qsTile
- tile.state =
- if (isShowing) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
- tile.updateTile()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Battery.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Battery.kt
deleted file mode 100644
index 5c3d3f9..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Battery.kt
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.interfaces
-
-import android.os.ServiceManager
-import vendor.eureka.hardware.parts.BatterySys
-import vendor.eureka.hardware.parts.IBatteryStats
-
-class Battery {
- private val mBattery: IBatteryStats
-
- init {
- mBattery = IBatteryStats.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IBatteryStats/default"))
- }
-
- var Charge: Boolean
- get() {
- return mBattery.getBatteryStats(BatterySys.CHARGE) == 0
- }
- set(k) {
- mBattery.setBatteryWritable(BatterySys.CHARGE, !k)
- }
-
- var FastCharge: Boolean
- get() {
- return mBattery.getBatteryStats(BatterySys.FASTCHARGE) == 0
- }
- set(k) {
- mBattery.setBatteryWritable(BatterySys.FASTCHARGE, !k)
- }
-
- fun getGeneralBatteryStats(id: BatteryIds): Int = when (id) {
- BatteryIds.BATTERY_CAPACITY_MAX -> mBattery.getBatteryStats(BatterySys.CAPACITY_MAX) / 1000
- BatteryIds.BATTERY_CAPACITY_CURRENT -> mBattery.getBatteryStats(BatterySys.CAPACITY_CURRENT)
- BatteryIds.BATTERY_CAPACITY_CURRENT_MAH -> (mBattery.getBatteryStats(BatterySys.CAPACITY_CURRENT).toFloat() * mBattery.getBatteryStats(BatterySys.CAPACITY_MAX).toFloat() / 100000).toInt()
- BatteryIds.CHARGING_STATE -> if (mBattery.getBatteryStats(BatterySys.CURRENT) > 0) 1 else 0
- BatteryIds.BATTERY_TEMP -> mBattery.getBatteryStats(BatterySys.TEMP) / 10
- BatteryIds.BATTERY_CURRENT -> mBattery.getBatteryStats(BatterySys.CURRENT)
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/BatteryIds.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/BatteryIds.kt
deleted file mode 100644
index ec56132..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/BatteryIds.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.eurekateam.samsungextras.interfaces
-
-enum class BatteryIds {
- BATTERY_CAPACITY_MAX,
- BATTERY_CAPACITY_CURRENT,
- BATTERY_CAPACITY_CURRENT_MAH,
- CHARGING_STATE,
- BATTERY_TEMP,
- BATTERY_CURRENT
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Display.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Display.kt
deleted file mode 100644
index 44e5b48..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Display.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.interfaces
-
-import android.os.ServiceManager
-import vendor.eureka.hardware.parts.DisplaySys
-import vendor.eureka.hardware.parts.IDisplayConfigs
-
-class Display {
- private val mDisplay: IDisplayConfigs
-
- init {
- mDisplay = IDisplayConfigs.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IDisplayConfigs/default"))
- }
-
- var DT2W: Boolean = false
- set(k) = mDisplay.writeDisplay(k, DisplaySys.DOUBLE_TAP)
-
- var GloveMode: Boolean = false
- set(k) = mDisplay.writeDisplay(k, DisplaySys.GLOVE_MODE)
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/FlashLight.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/FlashLight.kt
deleted file mode 100644
index 3d677d4..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/FlashLight.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.interfaces
-
-import android.os.ServiceManager
-import vendor.eureka.hardware.parts.IFlashBrightness
-
-class FlashLight {
- private val mFlash: IFlashBrightness
-
- init {
- mFlash = IFlashBrightness.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.IFlashBrightness/default"))
- }
-
- fun setFlash(value: Int) = mFlash.setFlashlightWritable(value)
-
- fun getFlash(a10: Boolean): Int = mFlash.readFlashlightstats(!a10)
- fun setEnabled(enable: Boolean) = mFlash.setFlashlightEnable(enable)
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/SmartCharge.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/SmartCharge.kt
deleted file mode 100644
index 2a778aa..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/SmartCharge.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.interfaces
-
-import android.os.ServiceManager
-import vendor.eureka.hardware.parts.ISmartCharge
-
-class SmartCharge {
- private val mSmartCharge: ISmartCharge
-
- init {
- mSmartCharge = ISmartCharge.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.ISmartCharge/default"))
- }
-
- fun start() = mSmartCharge.start()
- fun stop() = mSmartCharge.stop()
- fun setConfig(limit: Int, restart: Int) = mSmartCharge.setConfig(limit, restart)
-
- fun getStats(type: StatsType): Int = when (type) {
- StatsType.TYPE_LIMITED_CNT -> mSmartCharge.getLimitCnt()
- StatsType.TYPE_RESTARTED_CNT -> mSmartCharge.getRestartCnt()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/StatsType.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/StatsType.kt
deleted file mode 100644
index 86e719d..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/StatsType.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.eurekateam.samsungextras.interfaces
-
-enum class StatsType {
- TYPE_LIMITED_CNT,
- TYPE_RESTARTED_CNT
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt
deleted file mode 100644
index 98b9229..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/interfaces/Swap.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.interfaces
-
-import android.os.ServiceManager
-import vendor.eureka.hardware.parts.ISwapOnData
-
-class Swap {
- private val mSwap: ISwapOnData
- init {
- mSwap = ISwapOnData.Stub.asInterface(ServiceManager.waitForDeclaredService("vendor.eureka.hardware.parts.ISwapOnData/default"))
- }
-
- external fun setSwapOn(mCallBackEnabled: Boolean)
- fun setSwapOff() = mSwap.setSwapOff()
- fun mkFile(mSize: Int) = mSwap.makeSwapFile(mSize)
- fun delFile() = mSwap.removeSwapFile()
- fun isLocked(): Boolean = mSwap.isMutexLocked()
- external fun getFreeSpace(): Double
- external fun getSwapSize(): Long
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SelectedOption.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SelectedOption.kt
deleted file mode 100644
index c4adfe6..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SelectedOption.kt
+++ /dev/null
@@ -1,6 +0,0 @@
-package com.eurekateam.samsungextras.smartcharge
-
-enum class SelectedOption {
- SELECTED_LIMIT,
- SELECTED_RESTART
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeActivity.kt
deleted file mode 100644
index 839d62c..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeActivity.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.smartcharge
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class SmartChargeActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : SmartChargeFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = SmartChargeFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeFragment.kt
deleted file mode 100644
index 51dd495..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/smartcharge/SmartChargeFragment.kt
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.smartcharge
-
-import android.content.SharedPreferences
-import android.os.Bundle
-import android.os.Handler
-import android.os.Looper
-import android.view.View
-import android.widget.Switch
-import android.widget.Toast
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import androidx.preference.SeekBarPreference
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.android.settingslib.widget.SelectorWithWidgetPreference
-import com.eurekateam.samsungextras.R
-import com.eurekateam.samsungextras.interfaces.StatsType
-import com.eurekateam.samsungextras.interfaces.SmartCharge
-import java.util.concurrent.ScheduledThreadPoolExecutor
-import java.util.concurrent.TimeUnit
-
-class SmartChargeFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener, Preference.OnPreferenceChangeListener, SelectorWithWidgetPreference.OnClickListener {
- private lateinit var mLimit: SelectorWithWidgetPreference
- private lateinit var mRestart: SelectorWithWidgetPreference
- private lateinit var mSharedPreferences: SharedPreferences
- private lateinit var mSmartChargeBtn: MainSwitchPreference
- private lateinit var mAdjust: SeekBarPreference
- private lateinit var mLimitShow: Preference
- private lateinit var mRestartShow: Preference
- private lateinit var mLimitStat: Preference
- private lateinit var mRestartStat: Preference
- private val mPoolExecutor = ScheduledThreadPoolExecutor(3)
- private var mSelected = SelectedOption.SELECTED_LIMIT
- private val mSmartCharge = SmartCharge()
- private val mMainHandler = Handler(Looper.getMainLooper())
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.smartcharge_settings)
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
-
- mSmartChargeBtn = findPreference(PREF_SMARTCHARGE_MAIN)!!
- mAdjust = findPreference(PREF_ADJUST)!!
- mLimit = findPreference(PREF_LIMIT_SELECT)!!
- mRestart = findPreference(PREF_RESTART_SELECT)!!
-
- mLimitShow = findPreference(PREF_LIMIT)!!
- mRestartShow = findPreference(PREF_RESTART)!!
- mLimitStat = findPreference(PREF_LIMIT_STAT)!!
- mRestartStat = findPreference(PREF_RESTART_STAT)!!
-
- mSmartChargeBtn.addOnSwitchChangeListener(this)
- mSmartChargeBtn.isChecked = mSharedPreferences.getBoolean(PREF_SMARTCHARGE_MAIN, false)
- mAdjust.min = 1
- mAdjust.max = 5
- mAdjust.value = 3
- mAdjust.onPreferenceChangeListener = this
- mLimit.setOnClickListener(this)
- mRestart.setOnClickListener(this)
- mLimitShow.summary = "${mSharedPreferences.getInt(PREF_LIMIT, 20)} %"
- mRestartShow.summary = "${mSharedPreferences.getInt(PREF_RESTART, 80)} %"
- if (!mRestart.isChecked) mLimit.isChecked = true
- }
-
- override fun onRadioButtonClicked(btn: SelectorWithWidgetPreference) {
- when (btn) {
- mLimit -> {
- mSelected = SelectedOption.SELECTED_LIMIT
- mMainHandler.post({ mLimit.isChecked = true })
- mMainHandler.post({ mRestart.isChecked = false })
- }
- mRestart -> {
- mSelected = SelectedOption.SELECTED_RESTART
- mMainHandler.post({ mLimit.isChecked = false })
- mMainHandler.post({ mRestart.isChecked = true })
- }
- else -> {}
- }
- }
-
- private inline fun fromStringToNum(s: String): Int {
- return if (s.contains("ten")) 10 else if (s.contains("one")) 1 else 0
- }
-
- private inline fun fromSelectedToId(): String = when (mSelected) {
- SelectedOption.SELECTED_LIMIT -> PREF_LIMIT
- SelectedOption.SELECTED_RESTART -> PREF_RESTART
- }
-
- override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
- if (preference == mAdjust) {
- var tmp = mSharedPreferences.getInt(fromSelectedToId(), 50)
- val toAdd = when (newValue as Int) {
- 1 -> -10
- 2 -> -1
- 4 -> 1
- 5 -> 10
- else -> 0
- }
- if (tmp + toAdd > 99) tmp = 99 else if (tmp + toAdd < 1) tmp = 1 else tmp += toAdd
- mSharedPreferences.edit().putInt(fromSelectedToId(), tmp).apply()
- when (mSelected) {
- SelectedOption.SELECTED_LIMIT -> {
- mLimitShow
- }
- SelectedOption.SELECTED_RESTART -> {
- mRestartShow
- }
- }.summary = "$tmp %"
- mMainHandler.post({ mAdjust.value = 3 })
- return true
- }
- return false
- }
-
- private val mScheduler = Runnable {
- requireActivity().runOnUiThread {
- mLimitStat.summary = "${mSmartCharge.getStats(StatsType.TYPE_LIMITED_CNT)} times"
- mRestartStat.summary = "${mSmartCharge.getStats(StatsType.TYPE_RESTARTED_CNT)} times"
- }
- }
-
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- if (isChecked) {
- val limit = mSharedPreferences.getInt(PREF_LIMIT, 80)
- val restart = mSharedPreferences.getInt(PREF_RESTART, 20)
- if (limit > restart) {
- mSmartCharge.setConfig(limit, restart)
- mMainHandler.post({
- for (i in listOf(mAdjust, mLimit, mRestart))
- i.isEnabled = false
- })
- } else {
- Toast.makeText(requireContext(), "Limit percent should be bigger than restart percent", Toast.LENGTH_SHORT).show()
- mMainHandler.post({ mSmartChargeBtn.isEnabled = false })
- return
- }
- mSmartCharge.start()
- mPoolExecutor.scheduleWithFixedDelay(mScheduler, 0, 3, TimeUnit.MINUTES)
- } else {
- mSmartCharge.stop()
- mMainHandler.post({
- for (i in listOf(mAdjust, mLimit, mRestart))
- i.isEnabled = true
- })
- }
- mSharedPreferences.edit().putBoolean(PREF_SMARTCHARGE_MAIN, isChecked).apply()
- }
-
- companion object {
- const val PREF_SMARTCHARGE_MAIN = "smartcharge"
- const val PREF_LIMIT_SELECT = "choose_limit"
- const val PREF_RESTART_SELECT = "choose_restart"
- const val PREF_LIMIT = "limit"
- const val PREF_RESTART = "restart"
- const val PREF_LIMIT_STAT = "limit_stat"
- const val PREF_RESTART_STAT = "restart_stat"
- const val PREF_ADJUST = "adjust"
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerActivity.kt
deleted file mode 100644
index b55b4b3..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerActivity.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.speaker
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class ClearSpeakerActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : ClearSpeakerFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = ClearSpeakerFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerFragment.kt
deleted file mode 100644
index 2fbad7a..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/speaker/ClearSpeakerFragment.kt
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.speaker
-
-import android.media.AudioManager
-import android.media.MediaPlayer
-import android.os.Bundle
-import android.os.Handler
-import android.os.Looper
-import android.util.Log
-import android.widget.Switch
-import androidx.preference.PreferenceFragmentCompat
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.eurekateam.samsungextras.R
-import java.io.IOException
-
-class ClearSpeakerFragment : PreferenceFragmentCompat(), OnMainSwitchChangeListener {
- private lateinit var mHandler: Handler
- private lateinit var mMediaPlayer: MediaPlayer
- private lateinit var mClearSpeakerPref: MainSwitchPreference
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.clear_speaker_settings)
- mClearSpeakerPref = findPreference(PREF_CLEAR_SPEAKER)!!
- mClearSpeakerPref.addOnSwitchChangeListener(this)
- mHandler = Handler(Looper.getMainLooper())
- }
-
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- if (isChecked) {
- if (startPlaying()) {
- mHandler.removeCallbacksAndMessages(null)
- mHandler.postDelayed({ stopPlaying() }, 30000)
- }
- }
- }
-
- override fun onStop() {
- stopPlaying()
- super.onStop()
- }
-
- /**
- * Start playing speaker-clearing audio
- * @return true on success, else false
- */
- private fun startPlaying(): Boolean {
- mMediaPlayer = MediaPlayer()
- requireActivity().volumeControlStream = AudioManager.STREAM_MUSIC
- mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
- mMediaPlayer.isLooping = true
- try {
- resources.openRawResourceFd(R.raw.clear_speaker_sound).use { file ->
- mMediaPlayer.setDataSource(
- file.fileDescriptor,
- file.startOffset,
- file.length
- )
- }
- mClearSpeakerPref.isEnabled = false
- mMediaPlayer.setVolume(1.0f, 1.0f)
- mMediaPlayer.prepare()
- mMediaPlayer.start()
- } catch (ioe: IOException) {
- Log.e(TAG, "Failed to play speaker clean sound!", ioe)
- return false
- }
- return true
- }
-
- /**
- * Stops and invalidates
- */
- private fun stopPlaying() {
- if (::mMediaPlayer.isInitialized) {
- mMediaPlayer.stop()
- mMediaPlayer.reset()
- mMediaPlayer.release()
- }
- mClearSpeakerPref.isEnabled = true
- mClearSpeakerPref.isChecked = false
- }
-
- companion object {
- private val TAG = ClearSpeakerFragment::class.java.simpleName
- private const val PREF_CLEAR_SPEAKER = "clear_speaker_pref"
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapActivity.kt
deleted file mode 100644
index 1c8123d..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapActivity.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.swap
-
-import android.os.Bundle
-import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity
-import com.android.settingslib.widget.R
-
-class SwapActivity : CollapsingToolbarBaseActivity() {
- private var mInstance : SwapFragment? = null
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (mInstance == null) mInstance = SwapFragment()
- supportFragmentManager.beginTransaction().replace(
- R.id.content_frame,
- mInstance!!
- ).commit()
- }
-}
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt
deleted file mode 100644
index 99e5da3..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/swap/SwapFragment.kt
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2022 Eureka Team
- *
- * 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 com.eurekateam.samsungextras.swap
-
-import android.content.SharedPreferences
-import android.os.Bundle
-import android.os.Handler
-import android.os.Looper
-import android.widget.Switch
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import androidx.preference.PreferenceManager
-import androidx.preference.SeekBarPreference
-import com.android.settingslib.widget.MainSwitchPreference
-import com.android.settingslib.widget.OnMainSwitchChangeListener
-import com.eurekateam.samsungextras.R
-import com.eurekateam.samsungextras.interfaces.Swap
-import java.util.concurrent.ScheduledThreadPoolExecutor
-import java.util.concurrent.TimeUnit
-
-class SwapFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, OnMainSwitchChangeListener {
- private lateinit var mSwapSizePref: SeekBarPreference
- private lateinit var mSharedPreferences: SharedPreferences
- private lateinit var mSwapEnable: MainSwitchPreference
- private lateinit var mFreeSpace: Preference
- private lateinit var mSwapFileSize: Preference
- private var mPoolExecutor = ScheduledThreadPoolExecutor(3)
- private var mSwapSize = 0
- private val mSwap = Swap()
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- addPreferencesFromResource(R.xml.swap_settings)
- mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
- mSwapSizePref = findPreference(PREF_SWAP_SIZE)!!
- mSwapSizePref.onPreferenceChangeListener = this
- mSwapSizePref.setMax(100)
- mSwapSizePref.setMin(10)
- mSwapSizePref.value = mSharedPreferences.getInt(PREF_SWAP_SIZE, 50)
- mSwapEnable = findPreference(PREF_SWAP_ENABLE)!!
- mSwapEnable.isChecked = mSharedPreferences.getBoolean(PREF_SWAP_ENABLE, false)
- mSwapEnable.addOnSwitchChangeListener(this)
- mSwapSizePref.isEnabled = !mSwapEnable.isChecked
- mSwapSizePref.showSeekBarValue = true
- mFreeSpace = findPreference(INFO_FREE_SPACE)!!
- mFreeSpace.summary = "${mSwap.getFreeSpace()} GB"
- mSwapFileSize = findPreference(INFO_SWAP_FILE_SIZE)!!
- mSwapFileSize.summary = "${mSwap.getSwapSize()} MB"
- mPoolExecutor.scheduleWithFixedDelay(mScheduler, 0, 3, TimeUnit.SECONDS)
- }
-
- private val mScheduler = Runnable { requireActivity().runOnUiThread {
- mSwapEnable.isEnabled = !mSwap.isLocked()
- mFreeSpace.summary = "${mSwap.getFreeSpace()} GB"
- mSwapFileSize.summary = "${mSwap.getSwapSize()} MB"
- } }
-
- override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
- if (preference == mSwapSizePref) {
- val value = newValue as Int
- mSwapSize = value
- mSharedPreferences.edit().putInt(PREF_SWAP_SIZE, value).apply()
- return true
- }
- return false
- }
-
- // This is called from native - DO NOT CHANGE SIGNATURE
- fun reactToCallbackNative(res: Boolean) {
- if (!res) {
- mSwap.delFile()
- mSharedPreferences.edit().putBoolean(PREF_SWAP_ENABLE, false).apply()
- mSwapSizePref.isEnabled = true
- }
- }
-
- override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
- mSwapEnable.isEnabled = false
- val mSwap = Swap()
- if (isChecked) {
- mSwap.mkFile(mSwapSize)
- mSwap.setSwapOn(true)
- } else {
- mSwap.setSwapOff()
- mSwap.delFile()
- }
- mSwapEnable.isEnabled = true
- mSharedPreferences.edit().putBoolean(PREF_SWAP_ENABLE, isChecked).apply()
- mSwapSizePref.isEnabled = !isChecked
- }
-
- companion object {
- const val PREF_SWAP_SIZE = "swap_size"
- const val PREF_SWAP_ENABLE = "swap_enable"
- const val INFO_FREE_SPACE = "free_space"
- const val INFO_SWAP_FILE_SIZE = "swap_file_size"
- }
-}
diff --git a/universal7885-common/apps/aidl-support/parts/Android.bp b/universal7885-common/apps/aidl-support/parts/Android.bp
deleted file mode 100644
index fb975fe..0000000
--- a/universal7885-common/apps/aidl-support/parts/Android.bp
+++ /dev/null
@@ -1,26 +0,0 @@
-aidl_interface {
- name: "vendor.eureka.hardware.parts",
- srcs: ["vendor/eureka/hardware/parts/*.aidl"],
- stability: "vintf",
- owner: "Eureka Team",
- backend: {
- ndk: {
- enabled: true,
- },
- java: {
- platform_apis: true,
- },
- },
- versions_with_info: [
- {
- version: "1",
- imports: [],
- },
- {
- version: "2",
- imports: [],
- },
-
- ],
-
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash
deleted file mode 100644
index 498aaf5..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/.hash
+++ /dev/null
@@ -1 +0,0 @@
-48bdd89bd2780de4c4254e0d52a8c4e53e416d00
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/BatterySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/BatterySys.aidl
deleted file mode 100644
index 8319e13..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/BatterySys.aidl
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@Backing(type="int")
-@VintfStability
-enum BatterySys {
- CAPACITY_MAX,
- TEMP,
- CAPACITY_CURRENT,
- CURRENT,
- FASTCHARGE,
- CHARGE,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/DisplaySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/DisplaySys.aidl
deleted file mode 100644
index ea24a3e..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/DisplaySys.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@Backing(type="int")
-@VintfStability
-enum DisplaySys {
- DOUBLE_TAP,
- GLOVE_MODE,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBatteryStats.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBatteryStats.aidl
deleted file mode 100644
index 2344946..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBatteryStats.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.BatterySys;
-
-@VintfStability
-interface IBatteryStats {
- int getBatteryStats(in BatterySys stats);
-
- oneway void setBatteryWritable(in BatterySys stats, in boolean value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl
deleted file mode 100644
index 32bc47d..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IBoolCallback.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface IBoolCallback {
- void respondToBool(in boolean result);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IDisplayConfigs.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
deleted file mode 100644
index d89b3ff..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.DisplaySys;
-
-@VintfStability
-interface IDisplayConfigs {
- oneway void writeDisplay(in boolean enable, in DisplaySys type);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IFlashBrightness.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IFlashBrightness.aidl
deleted file mode 100644
index 05efc7c..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/IFlashBrightness.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface IFlashBrightness {
- int readFlashlightstats(in boolean s2mu106);
-
- oneway void setFlashlightEnable(in boolean enable);
-
- oneway void setFlashlightWritable(in int value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISmartCharge.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISmartCharge.aidl
deleted file mode 100644
index 4cdcb12..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISmartCharge.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface ISmartCharge {
- int getLimitCnt();
-
- int getRestartCnt();
-
- oneway void setConfig(in int limit, in int restart);
-
- oneway void start();
-
- oneway void stop();
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl
deleted file mode 100644
index 24f10df..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/1/vendor/eureka/hardware/parts/ISwapOnData.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.IBoolCallback;
-
-@VintfStability
-interface ISwapOnData {
-
- boolean isMutexLocked();
-
- oneway void removeSwapFile();
-
- oneway void setSwapOff();
-
- oneway void setSwapOn(in IBoolCallback cb);
-
- oneway void makeSwapFile(in int size);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/.hash b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/.hash
deleted file mode 100644
index cba0f22..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/.hash
+++ /dev/null
@@ -1 +0,0 @@
-dad5105afc869ca8a3c4621e51c4e575b1425e0c
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/BatterySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/BatterySys.aidl
deleted file mode 100644
index ed1ad55..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/BatterySys.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@Backing(type="int") @VintfStability
-enum BatterySys {
- CAPACITY_MAX = 0,
- TEMP = 1,
- CAPACITY_CURRENT = 2,
- CURRENT = 3,
- FASTCHARGE = 4,
- CHARGE = 5,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/DisplaySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/DisplaySys.aidl
deleted file mode 100644
index 4a538cc..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/DisplaySys.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@Backing(type="int") @VintfStability
-enum DisplaySys {
- DOUBLE_TAP = 0,
- GLOVE_MODE = 1,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBatteryStats.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBatteryStats.aidl
deleted file mode 100644
index c9a3e20..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBatteryStats.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IBatteryStats {
- int getBatteryStats(in vendor.eureka.hardware.parts.BatterySys stats);
- oneway void setBatteryWritable(in vendor.eureka.hardware.parts.BatterySys stats, in boolean value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBoolCallback.aidl
deleted file mode 100644
index b0734b6..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IBoolCallback.aidl
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IBoolCallback {
- void respondToBool(in boolean result);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IDisplayConfigs.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
deleted file mode 100644
index 927944d..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IDisplayConfigs {
- oneway void writeDisplay(in boolean enable, in vendor.eureka.hardware.parts.DisplaySys type);
- boolean readDisplay(in vendor.eureka.hardware.parts.DisplaySys type);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IFlashBrightness.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IFlashBrightness.aidl
deleted file mode 100644
index 125d695..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/IFlashBrightness.aidl
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IFlashBrightness {
- int readFlashlightstats(in boolean s2mu106);
- oneway void setFlashlightEnable(in boolean enable);
- oneway void setFlashlightWritable(in int value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISmartCharge.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISmartCharge.aidl
deleted file mode 100644
index 4c51f6e..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISmartCharge.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface ISmartCharge {
- int getLimitCnt();
- int getRestartCnt();
- oneway void setConfig(in int limit, in int restart);
- oneway void start();
- oneway void stop();
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISwapOnData.aidl
deleted file mode 100644
index 8dc63ee..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/2/vendor/eureka/hardware/parts/ISwapOnData.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface ISwapOnData {
- boolean isMutexLocked();
- oneway void removeSwapFile();
- oneway void setSwapOff();
- oneway void setSwapOn(in vendor.eureka.hardware.parts.IBoolCallback cb);
- oneway void makeSwapFile(in int size);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/BatterySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/BatterySys.aidl
deleted file mode 100644
index ed1ad55..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/BatterySys.aidl
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@Backing(type="int") @VintfStability
-enum BatterySys {
- CAPACITY_MAX = 0,
- TEMP = 1,
- CAPACITY_CURRENT = 2,
- CURRENT = 3,
- FASTCHARGE = 4,
- CHARGE = 5,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/DisplaySys.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/DisplaySys.aidl
deleted file mode 100644
index 4a538cc..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/DisplaySys.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@Backing(type="int") @VintfStability
-enum DisplaySys {
- DOUBLE_TAP = 0,
- GLOVE_MODE = 1,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBatteryStats.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBatteryStats.aidl
deleted file mode 100644
index c9a3e20..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBatteryStats.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IBatteryStats {
- int getBatteryStats(in vendor.eureka.hardware.parts.BatterySys stats);
- oneway void setBatteryWritable(in vendor.eureka.hardware.parts.BatterySys stats, in boolean value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl
deleted file mode 100644
index b0734b6..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IBoolCallback.aidl
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IBoolCallback {
- void respondToBool(in boolean result);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IDisplayConfigs.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
deleted file mode 100644
index 927944d..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IDisplayConfigs {
- oneway void writeDisplay(in boolean enable, in vendor.eureka.hardware.parts.DisplaySys type);
- boolean readDisplay(in vendor.eureka.hardware.parts.DisplaySys type);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IFlashBrightness.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IFlashBrightness.aidl
deleted file mode 100644
index 125d695..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/IFlashBrightness.aidl
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface IFlashBrightness {
- int readFlashlightstats(in boolean s2mu106);
- oneway void setFlashlightEnable(in boolean enable);
- oneway void setFlashlightWritable(in int value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISmartCharge.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISmartCharge.aidl
deleted file mode 100644
index 4c51f6e..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISmartCharge.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface ISmartCharge {
- int getLimitCnt();
- int getRestartCnt();
- oneway void setConfig(in int limit, in int restart);
- oneway void start();
- oneway void stop();
-}
diff --git a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl
deleted file mode 100644
index 8dc63ee..0000000
--- a/universal7885-common/apps/aidl-support/parts/aidl_api/vendor.eureka.hardware.parts/current/vendor/eureka/hardware/parts/ISwapOnData.aidl
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
-///////////////////////////////////////////////////////////////////////////////
-
-// This file is a snapshot of an AIDL file. Do not edit it manually. There are
-// two cases:
-// 1). this is a frozen version file - do not edit this in any case.
-// 2). this is a 'current' file. If you make a backwards compatible change to
-// the interface (from the latest frozen version), the build system will
-// prompt you to update this file with `m -update-api`.
-//
-// You must not make a backward incompatible change to any AIDL file built
-// with the aidl_interface module type with versions property set. The module
-// type is used to build AIDL files in a way that they can be used across
-// independently updatable components of the system. If a device is shipped
-// with such a backward incompatible change, it has a high risk of breaking
-// later when a module using the interface is updated, e.g., Mainline modules.
-
-package vendor.eureka.hardware.parts;
-@VintfStability
-interface ISwapOnData {
- boolean isMutexLocked();
- oneway void removeSwapFile();
- oneway void setSwapOff();
- oneway void setSwapOn(in vendor.eureka.hardware.parts.IBoolCallback cb);
- oneway void makeSwapFile(in int size);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/default/Android.bp b/universal7885-common/apps/aidl-support/parts/default/Android.bp
deleted file mode 100644
index aa4651f..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Android.bp
+++ /dev/null
@@ -1,20 +0,0 @@
-cc_binary {
- name: "vendor.eureka.hardware.parts-service",
- srcs: [
- "Battery.cpp",
- "FlashLight.cpp",
- "Display.cpp",
- "Swap.cpp",
- "SmartCharge.cpp",
- "service.cpp",
- ],
- shared_libs: [
- "libbase",
- "libbinder_ndk",
- "libfileio",
- "vendor.eureka.hardware.parts-V1-ndk",
- ],
- header_libs: ["logformat"],
- init_rc: ["vendor.eureka.hardware.parts-service.rc"],
- vintf_fragments: ["vendor.eureka.hardware.parts.xml"],
-}
diff --git a/universal7885-common/apps/aidl-support/parts/default/Battery.cpp b/universal7885-common/apps/aidl-support/parts/default/Battery.cpp
deleted file mode 100644
index 985a1b8..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Battery.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#include
-
-#include "Battery.h"
-#include "BatteryConstants.h"
-
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-static inline const char *BatterySysToPath(BatterySys type) {
- switch (type) {
- case BatterySys::CAPACITY_MAX:
- return BATTERY_CAPACITY_MAX;
- case BatterySys::TEMP:
- return BATTERY_TEMP;
- case BatterySys::CAPACITY_CURRENT:
- return BATTERY_CAPACITY_CURRENT;
- case BatterySys::CURRENT:
- return BATTERY_CURRENT;
- case BatterySys::FASTCHARGE:
- return BATTERY_FASTCHARGE;
- case BatterySys::CHARGE:
- return BATTERY_CHARGE;
- default:
- return "";
- }
-}
-
-// Methods from ::android::hardware::battery::V1_0::IBattery follow.
-::ndk::ScopedAStatus BatteryStats::getBatteryStats(BatterySys stats,
- int32_t *_aidl_return) {
- *_aidl_return = FileIO::readint(BatterySysToPath(stats));
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus BatteryStats::setBatteryWritable(BatterySys stats,
- bool value) {
- FileIO::writeline(BatterySysToPath(stats), value ? 1 : 0);
- return ::ndk::ScopedAStatus::ok();
-}
-
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/Battery.h b/universal7885-common/apps/aidl-support/parts/default/Battery.h
deleted file mode 100644
index e64386b..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Battery.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-
-#define ANDROID_SYSTEM_UID 1000
-#define ANDROID_ROOT_UID 0
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-struct BatteryStats : public BnBatteryStats {
- // Methods from ::aidl::::vendor::eureka::hardware::parts::IBatteryStats
- // follow.
- ::ndk::ScopedAStatus getBatteryStats(BatterySys stats,
- int32_t *_aidl_return) override;
- ::ndk::ScopedAStatus setBatteryWritable(BatterySys stats,
- bool value) override;
-};
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/BatteryConstants.h b/universal7885-common/apps/aidl-support/parts/default/BatteryConstants.h
deleted file mode 100644
index c066181..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/BatteryConstants.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-constexpr const char *BATTERY_CAPACITY_MAX =
- "/sys/devices/platform/battery/power_supply/battery/charge_full";
-constexpr const char *BATTERY_TEMP =
- "/sys/devices/platform/battery/power_supply/battery/batt_temp";
-constexpr const char *BATTERY_CAPACITY_CURRENT =
- "/sys/devices/platform/battery/power_supply/battery/capacity";
-constexpr const char *BATTERY_CURRENT =
- "/sys/devices/platform/battery/power_supply/battery/current_now";
-constexpr const char *BATTERY_FASTCHARGE = "/sys/class/sec/switch/afc_disable";
-constexpr const char *BATTERY_CHARGE =
- "/sys/devices/platform/battery/power_supply/battery/batt_slate_mode";
diff --git a/universal7885-common/apps/aidl-support/parts/default/Display.cpp b/universal7885-common/apps/aidl-support/parts/default/Display.cpp
deleted file mode 100644
index f99b341..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Display.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#define LOG_TAG "PartsHAL-Display"
-
-#include "Display.h"
-
-#include
-#include
-
-#include
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-constexpr const char *SEC_TSP_CMD = "/sys/class/sec/tsp/cmd";
-constexpr const char *SEC_TSP_CMD_RESULT = "/sys/class/sec/tsp/cmd_result";
-
-static std::string DisplayStrBuilder(bool enable, DisplaySys type) {
- std::stringstream builder;
- switch (type) {
- case DisplaySys::DOUBLE_TAP:
- builder << "aot_enable";
- break;
- case DisplaySys::GLOVE_MODE:
- builder << "glove_mode";
- break;
- };
- builder << ",";
- builder << enable; // Implicit conversion
- return builder.str();
-}
-
-enum DisplayResult {
- OK,
- NOOP,
- INVALID,
-};
-
-constexpr const char *OK_STR = "OK";
-constexpr const char *NOOP_STR = "NOOP";
-
-static DisplayResult parseResult(std::string *result, DisplaySys from, bool enabled) {
- std::stringstream ss;
- std::string parsed;
- auto addEmpty = [](std::string *str) {
- if (str->empty())
- *str = std::string("(empty)");
- };
- ss << DisplayStrBuilder(enabled, from);
- ss << ":";
- if (result->find(ss.str()) == std::string::npos) {
- LOG_E("Unexpected: Failed to find built string in result string");
- goto error;
- }
- parsed = result->substr(result->find(ss.str()) + 1);
- if (parsed == OK_STR) {
- return DisplayResult::OK;
- } else if (parsed == NOOP_STR) {
- return DisplayResult::NOOP;
- }
- addEmpty(&parsed);
- LOG_E("Unexpected: Failed to parse by matching parsed result string");
- LOG_E("Parsed string was %s", parsed.c_str());
-error:
- LOG_W("Falling back to find");
- if (result->find(OK_STR) != std::string::npos)
- return DisplayResult::OK;
- else if (result->find(NOOP_STR) != std::string::npos)
- return DisplayResult::NOOP;
- else {
- addEmpty(result);
- LOG_E("Failed to find result string in result string");
- LOG_E("Resulting string was: %s", result->c_str());
- return DisplayResult::INVALID;
- }
-}
-
-::ndk::ScopedAStatus DisplayConfigs::writeDisplay(bool enable,
- DisplaySys type) {
- FileIO::writeline(SEC_TSP_CMD, DisplayStrBuilder(enable, type));
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus DisplayConfigs::readDisplay(DisplaySys type,
- bool *_aidl_return) {
- std::string res;
- writeDisplay(true, type);
- res = FileIO::readline(SEC_TSP_CMD_RESULT);
- switch (parseResult(&res, type, true)) {
- case DisplayResult::NOOP: {
- *_aidl_return = true;
- break;
- }
- case DisplayResult::OK: {
- writeDisplay(true, type);
- res = FileIO::readline(SEC_TSP_CMD_RESULT);
- switch (parseResult(&res, type, true)) {
- case DisplayResult::NOOP: {
- *_aidl_return = false;
- writeDisplay(false, type);
- break;
- }
- case DisplayResult::OK: {
- LOG_W("Double enable returns OK: function not implemented.");
- return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
- }
- case DisplayResult::INVALID:
- return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
- };
- } break;
- case DisplayResult::INVALID:
- return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
- };
- return ::ndk::ScopedAStatus::ok();
-}
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/Display.h b/universal7885-common/apps/aidl-support/parts/default/Display.h
deleted file mode 100644
index b8fb563..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Display.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-struct DisplayConfigs : public BnDisplayConfigs {
- // Methods from ::aidl::vendor::eureka::hardware::parts::IDisplayConfigs
- // follow.
- ::ndk::ScopedAStatus writeDisplay(bool enable, DisplaySys type);
- ::ndk::ScopedAStatus readDisplay(DisplaySys type, bool *_aidl_return);
-};
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/FlashLight.cpp b/universal7885-common/apps/aidl-support/parts/default/FlashLight.cpp
deleted file mode 100644
index 98bc69d..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/FlashLight.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#include "FlashLight.h"
-
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-constexpr const char *TORCH_ENABLE =
- "/sys/class/camera/flash/torch_brightness_lvl_enable";
-constexpr const char *TORCH_LVL =
- "/sys/class/camera/flash/torch_brightness_lvl";
-
-// Methods from ::android::hardware::parts::V1_0::IFlashLight follow.
-::ndk::ScopedAStatus FlashBrightness::setFlashlightEnable(bool enable) {
- FileIO::writeline(TORCH_ENABLE, enable ? 1 : 0);
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus FlashBrightness::setFlashlightWritable(int32_t value) {
- FileIO::writeline(TORCH_LVL, value);
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus
-FlashBrightness::readFlashlightstats(bool s2mu106, int32_t *_aidl_return) {
- *_aidl_return =
- s2mu106 ? FileIO::readint(TORCH_LVL) / 21 : FileIO::readint(TORCH_LVL);
- return ::ndk::ScopedAStatus::ok();
-}
-
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/FlashLight.h b/universal7885-common/apps/aidl-support/parts/default/FlashLight.h
deleted file mode 100644
index f268780..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/FlashLight.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-struct FlashBrightness : public BnFlashBrightness {
- // Methods from ::aidl::vendor::eureka::hardware::parts::IFlashBrightness
- // follow.
- ::ndk::ScopedAStatus setFlashlightEnable(bool enable);
- ::ndk::ScopedAStatus setFlashlightWritable(int32_t value);
- ::ndk::ScopedAStatus readFlashlightstats(bool s2mu106, int32_t *_aidl_return);
-};
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp
deleted file mode 100644
index ecf2e35..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#include "SmartCharge.h"
-
-#include "BatteryConstants.h"
-#include
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-void SmartCharge::battery_monitor(void) {
- while (kShouldRun) {
- auto batt = FileIO::readint(BATTERY_CAPACITY_CURRENT);
- if (batt >= limit) {
- if (kTookAction)
- goto sleep;
- FileIO::writeline(BATTERY_CHARGE, 1);
- kTookAction = true;
- limit_stat += 1;
- } else if (batt <= restart) {
- if (kTookAction)
- goto sleep;
- FileIO::writeline(BATTERY_CHARGE, 0);
- kTookAction = true;
- restart_stat += 1;
- } else {
- if (!kTookAction)
- goto sleep;
- kTookAction = false;
- }
- sleep:
- std::this_thread::sleep_for(std::chrono::seconds(5));
- }
-}
-
-::ndk::ScopedAStatus SmartCharge::start(void) {
- if (limit == 0 || restart == 0)
- return ::ndk::ScopedAStatus::fromExceptionCodeWithMessage(
- EX_ILLEGAL_ARGUMENT, "Start called without configuring.");
-
- kShouldRun = true;
- monitor_th = new std::thread([this] { battery_monitor(); });
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus SmartCharge::stop(void) {
- kShouldRun = false;
- if (monitor_th != nullptr) {
- monitor_th = nullptr;
- }
- FileIO::writeline(BATTERY_CHARGE, 0);
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus SmartCharge::setConfig(int32_t limit_user,
- int32_t restart_user) {
- limit = limit_user;
- restart = restart_user;
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus SmartCharge::getLimitCnt(int32_t *_aidl_return) {
- *_aidl_return = limit_stat;
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus SmartCharge::getRestartCnt(int32_t *_aidl_return) {
- *_aidl_return = restart_stat;
- return ::ndk::ScopedAStatus::ok();
-}
-
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h
deleted file mode 100644
index 1419897..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-struct SmartCharge : public BnSmartCharge {
-public:
- // Methods from ::aidl::vendor::eureka::hardware::parts::ISmartCharge
- // follow.
- ::ndk::ScopedAStatus start(void);
- ::ndk::ScopedAStatus stop(void);
- ::ndk::ScopedAStatus setConfig(int32_t limit, int32_t restart);
- ::ndk::ScopedAStatus getLimitCnt(int32_t *_aidl_return);
- ::ndk::ScopedAStatus getRestartCnt(int32_t *_aidl_return);
-
-private:
- int limit;
- int restart;
- int limit_stat;
- int restart_stat;
- bool kShouldRun;
- bool kTookAction;
- std::thread *monitor_th;
- void battery_monitor(void);
-};
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp b/universal7885-common/apps/aidl-support/parts/default/Swap.cpp
deleted file mode 100644
index d60378f..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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.
-
-#include "Swap.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace {
-
-/* XXX This needs to be obtained from kernel headers. See b/9336527 */
-struct linux_swap_header {
- char bootbits[1024]; /* Space for disklabel etc. */
- u_int32_t version;
- u_int32_t last_page;
- u_int32_t nr_badpages;
- unsigned char sws_uuid[16];
- unsigned char sws_volume[16];
- u_int32_t padding[117];
- u_int32_t badpages[1];
-};
-
-void mkfile(int filesize, const char *path) {
- std::vector empty(1024, 0);
- std::ofstream ofs(std::string(path), std::ios::binary | std::ios::out);
-
- for (int i = 0; i < 1024 * filesize; i++) {
- ofs.write(empty.data(), empty.size());
- }
-}
-
-#define MAGIC_SWAP_HEADER "SWAPSPACE2"
-#define MAGIC_SWAP_HEADER_LEN 10
-#define MIN_PAGES 10
-
-int mkswap(const char *filename) {
- int err = 0;
- int fd;
- ssize_t len;
- off_t swap_size;
- int pagesize;
- struct linux_swap_header sw_hdr;
- fd = open(filename, O_WRONLY | O_CLOEXEC);
- if (fd < 0) {
- err = errno;
- return err;
- }
- pagesize = getpagesize();
- /* Determine the length of the swap file */
- swap_size = lseek(fd, 0, SEEK_END);
- if (swap_size < MIN_PAGES * pagesize) {
- err = -ENOSPC;
- goto err;
- }
- if (lseek(fd, 0, SEEK_SET)) {
- err = errno;
- goto err;
- }
- memset(&sw_hdr, 0, sizeof(sw_hdr));
- sw_hdr.version = 1;
- sw_hdr.last_page = (swap_size / pagesize) - 1;
- len = write(fd, &sw_hdr, sizeof(sw_hdr));
- if (len != sizeof(sw_hdr)) {
- err = errno;
- goto err;
- }
- /* Write the magic header */
- if (lseek(fd, pagesize - MAGIC_SWAP_HEADER_LEN, SEEK_SET) < 0) {
- err = errno;
- goto err;
- }
- len = write(fd, MAGIC_SWAP_HEADER, MAGIC_SWAP_HEADER_LEN);
- if (len != MAGIC_SWAP_HEADER_LEN) {
- err = errno;
- goto err;
- }
- if (fsync(fd) < 0) {
- err = errno;
- goto err;
- }
-err:
- close(fd);
- return err;
-}
-
-} // namespace
-
-constexpr const char *SWAP_PATH = "/data/swap/swapfile";
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-static std::mutex thread_lock;
-
-static inline bool swapfile_exist(void) { return access(SWAP_PATH, R_OK | W_OK) == 0; }
-
-static void makeFile(int32_t mSwapSize) {
- const std::lock_guard lock(thread_lock);
- mkfile(mSwapSize * 10, SWAP_PATH);
- mkswap(SWAP_PATH);
-}
-
-::ndk::ScopedAStatus SwapOnData::makeSwapFile(int32_t size) {
- if (swapfile_exist())
- return ::ndk::ScopedAStatus::ok();
- std::thread makefile_thread(makeFile, size);
- makefile_thread.detach();
-
- return ::ndk::ScopedAStatus::ok();
-}
-
-static void rmswap(void) {
- const std::lock_guard lock(thread_lock);
- std::remove(SWAP_PATH);
-}
-
-::ndk::ScopedAStatus SwapOnData::removeSwapFile(void) {
- if (!swapfile_exist())
- return ::ndk::ScopedAStatus::ok();
- std::thread rmswap_thread(rmswap);
- rmswap_thread.detach();
- return ::ndk::ScopedAStatus::ok();
-}
-
-static void swapon_func(cb_t cb) {
- const std::lock_guard lock(thread_lock);
- int res =
- swapon(SWAP_PATH, (10 << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK);
- if (cb != nullptr)
- cb->respondToBool(res == 0);
-}
-
-::ndk::ScopedAStatus SwapOnData::setSwapOn(cb_t cb) {
- if (!swapfile_exist())
- return ::ndk::ScopedAStatus::ok();
- std::thread swapon_thread(swapon_func, cb);
- swapon_thread.detach();
- return ::ndk::ScopedAStatus::ok();
-}
-
-static void swapoff_func(void) {
- const std::lock_guard lock(thread_lock);
- swapoff(SWAP_PATH);
-}
-
-::ndk::ScopedAStatus SwapOnData::setSwapOff() {
- if (!swapfile_exist())
- return ::ndk::ScopedAStatus::ok();
- std::thread swapoff_thread(swapoff_func);
- swapoff_thread.detach();
- return ::ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus SwapOnData::isMutexLocked(bool *_aidl_return) {
- if (thread_lock.try_lock()) {
- thread_lock.unlock();
- *_aidl_return = false;
- } else {
- *_aidl_return = true;
- }
- return ::ndk::ScopedAStatus::ok();
-}
-
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/Swap.h b/universal7885-common/apps/aidl-support/parts/default/Swap.h
deleted file mode 100644
index ea7cfed..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/Swap.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#pragma once
-
-#include
-
-namespace aidl::vendor::eureka::hardware::parts {
-
-using cb_t = const std::shared_ptr &;
-
-struct SwapOnData : public BnSwapOnData {
- // Methods from ::aidl::vendor::eureka::hardware::parts::ISwapOnData
- // follow.
- ::ndk::ScopedAStatus makeSwapFile(int32_t size);
- ::ndk::ScopedAStatus setSwapOn(cb_t cb);
- ::ndk::ScopedAStatus removeSwapFile(void);
- ::ndk::ScopedAStatus setSwapOff(void);
- ::ndk::ScopedAStatus isMutexLocked(bool *_aidl_return);
-};
-} // namespace aidl::vendor::eureka::hardware::parts
diff --git a/universal7885-common/apps/aidl-support/parts/default/service.cpp b/universal7885-common/apps/aidl-support/parts/default/service.cpp
deleted file mode 100644
index 4cbf266..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/service.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2021 Eureka Team
-//
-// 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.
-
-#include
-#include
-#include
-
-#include "Battery.h"
-#include "Display.h"
-#include "FlashLight.h"
-#include "SmartCharge.h"
-#include "Swap.h"
-
-using ::aidl::vendor::eureka::hardware::parts::BatteryStats;
-using ::aidl::vendor::eureka::hardware::parts::DisplayConfigs;
-using ::aidl::vendor::eureka::hardware::parts::FlashBrightness;
-using ::aidl::vendor::eureka::hardware::parts::SmartCharge;
-using ::aidl::vendor::eureka::hardware::parts::SwapOnData;
-
-template static void registerAsService(std::shared_ptr service) {
- const std::string instance = std::string() + C::descriptor + "/default";
- binder_status_t status =
- AServiceManager_addService(service->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
- LOG(INFO) << "Register done for " << C::descriptor;
-}
-
-int main() {
- ABinderProcess_setThreadPoolMaxThreadCount(3);
-
- registerAsService(ndk::SharedRefBase::make());
- registerAsService(ndk::SharedRefBase::make());
- registerAsService(ndk::SharedRefBase::make());
- registerAsService(ndk::SharedRefBase::make());
- registerAsService(ndk::SharedRefBase::make());
-
- ABinderProcess_joinThreadPool();
- return -1; // should never get here
-}
diff --git a/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts-service.rc b/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts-service.rc
deleted file mode 100644
index 26bbdab..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts-service.rc
+++ /dev/null
@@ -1,7 +0,0 @@
-service parts-hal-aidl /system/bin/vendor.eureka.hardware.parts-service
- class hal
- user root
- group root
-
-on post-fs-data
- mkdir /data/swap 0755 root root encryption=None
diff --git a/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts.xml b/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts.xml
deleted file mode 100644
index 8a0f97f..0000000
--- a/universal7885-common/apps/aidl-support/parts/default/vendor.eureka.hardware.parts.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- vendor.eureka.hardware.parts
- IBatteryStats/default
- IDisplayConfigs/default
- IFlashBrightness/default
- ISwapOnData/default
- ISmartCharge/default
-
-
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/BatterySys.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/BatterySys.aidl
deleted file mode 100644
index 8319e13..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/BatterySys.aidl
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@Backing(type="int")
-@VintfStability
-enum BatterySys {
- CAPACITY_MAX,
- TEMP,
- CAPACITY_CURRENT,
- CURRENT,
- FASTCHARGE,
- CHARGE,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/DisplaySys.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/DisplaySys.aidl
deleted file mode 100644
index ea24a3e..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/DisplaySys.aidl
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@Backing(type="int")
-@VintfStability
-enum DisplaySys {
- DOUBLE_TAP,
- GLOVE_MODE,
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBatteryStats.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBatteryStats.aidl
deleted file mode 100644
index 2344946..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBatteryStats.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.BatterySys;
-
-@VintfStability
-interface IBatteryStats {
- int getBatteryStats(in BatterySys stats);
-
- oneway void setBatteryWritable(in BatterySys stats, in boolean value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl
deleted file mode 100644
index 32bc47d..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IBoolCallback.aidl
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface IBoolCallback {
- void respondToBool(in boolean result);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IDisplayConfigs.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
deleted file mode 100644
index 30edadb..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IDisplayConfigs.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.DisplaySys;
-
-@VintfStability
-interface IDisplayConfigs {
- oneway void writeDisplay(in boolean enable, in DisplaySys type);
- boolean readDisplay(in DisplaySys type);
-}
-
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IFlashBrightness.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IFlashBrightness.aidl
deleted file mode 100644
index 05efc7c..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/IFlashBrightness.aidl
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface IFlashBrightness {
- int readFlashlightstats(in boolean s2mu106);
-
- oneway void setFlashlightEnable(in boolean enable);
-
- oneway void setFlashlightWritable(in int value);
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISmartCharge.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISmartCharge.aidl
deleted file mode 100644
index 4cdcb12..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISmartCharge.aidl
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-@VintfStability
-interface ISmartCharge {
- int getLimitCnt();
-
- int getRestartCnt();
-
- oneway void setConfig(in int limit, in int restart);
-
- oneway void start();
-
- oneway void stop();
-}
diff --git a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl b/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl
deleted file mode 100644
index 24f10df..0000000
--- a/universal7885-common/apps/aidl-support/parts/vendor/eureka/hardware/parts/ISwapOnData.aidl
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (C) 2022 Eureka Team
-//
-// 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 vendor.eureka.hardware.parts;
-
-import vendor.eureka.hardware.parts.IBoolCallback;
-
-@VintfStability
-interface ISwapOnData {
-
- boolean isMutexLocked();
-
- oneway void removeSwapFile();
-
- oneway void setSwapOff();
-
- oneway void setSwapOn(in IBoolCallback cb);
-
- oneway void makeSwapFile(in int size);
-}
diff --git a/universal7885-common/sepolicy/private/file_contexts b/universal7885-common/sepolicy/private/file_contexts
index 26526ee..83879da 100644
--- a/universal7885-common/sepolicy/private/file_contexts
+++ b/universal7885-common/sepolicy/private/file_contexts
@@ -2,15 +2,11 @@
### DATA
/data/zram(/.*)? u:object_r:zram_data_file:s0
-/data/swap(/.*)? u:object_r:parts_data_file:s0
# Eureka Bootlogger
/system/bin/eklogger u:object_r:eklogger_exec:s0
/data/debug(/.*)? u:object_r:eklogger_data_file:s0
-# SamsungParts
-/system/bin/vendor\.eureka\.hardware\.parts-service u:object_r:hal_parts_default_exec:s0
-
# FMRadio
/system/bin/vendor\.eureka\.hardware\.fmradio-service u:object_r:hal_fmradio_default_exec:s0
/system/bin/vendor\.eureka\.hardware\.audio_route-service u:object_r:hal_audio_route_default_exec:s0
diff --git a/universal7885-common/sepolicy/private/hal_parts_default.te b/universal7885-common/sepolicy/private/hal_parts_default.te
deleted file mode 100644
index b075825..0000000
--- a/universal7885-common/sepolicy/private/hal_parts_default.te
+++ /dev/null
@@ -1,33 +0,0 @@
-type hal_parts_default, domain, coredomain;
-type hal_parts_default_exec, exec_type, file_type, system_file_type;
-
-add_service(hal_parts_default, hal_parts_service);
-init_daemon_domain(hal_parts_default);
-
-binder_use(hal_parts_default);
-
-# Battery
-allow hal_parts_default sysfs_sec_switch:dir { search };
-allow hal_parts_default sysfs_sec_switch_writable:file rw_file_perms;
-allow hal_parts_default sysfs_battery_writable:file rw_file_perms;
-allow hal_parts_default sysfs_sec_switch_writable:dir { search };
-allow hal_parts_default sysfs_battery_writable:dir { search };
-allow hal_parts_default sysfs_battery:dir { search };
-allow hal_parts_default sysfs_virtual:dir search;
-allow hal_parts_default self:capability setuid;
-
-# FlashLight
-allow hal_parts_default sysfs_flashlight:file { read open write getattr };
-allow hal_parts_default sysfs_flashlight:dir search;
-allow hal_parts_default sysfs_virtual:dir search;
-
-# Display
-allow hal_parts_default sysfs_sec_touchscreen:dir search;
-allow hal_parts_default sysfs_touchscreen_writable:file rw_file_perms;
-
-# Swap
-type parts_data_file, file_type, data_file_type, core_data_file_type;
-allow hal_parts_default parts_data_file:dir rw_dir_perms;
-allow hal_parts_default parts_data_file:file rw_file_perms;
-allow hal_parts_default parts_data_file:file create_file_perms;
-allow hal_parts_default self:capability sys_admin;
diff --git a/universal7885-common/sepolicy/private/service.te b/universal7885-common/sepolicy/private/service.te
index cb4bc06..b7cd8f6 100644
--- a/universal7885-common/sepolicy/private/service.te
+++ b/universal7885-common/sepolicy/private/service.te
@@ -1,3 +1,2 @@
-type hal_parts_service, service_manager_type;
type hal_fmradio_service, service_manager_type;
type hal_audio_route_service, service_manager_type;
diff --git a/universal7885-common/sepolicy/private/service_contexts b/universal7885-common/sepolicy/private/service_contexts
index 952f639..7740c7d 100644
--- a/universal7885-common/sepolicy/private/service_contexts
+++ b/universal7885-common/sepolicy/private/service_contexts
@@ -1,10 +1,3 @@
-# SamsungParts
-vendor.eureka.hardware.parts.IBatteryStats/default u:object_r:hal_parts_service:s0
-vendor.eureka.hardware.parts.IFlashBrightness/default u:object_r:hal_parts_service:s0
-vendor.eureka.hardware.parts.IDisplayConfigs/default u:object_r:hal_parts_service:s0
-vendor.eureka.hardware.parts.ISwapOnData/default u:object_r:hal_parts_service:s0
-vendor.eureka.hardware.parts.ISmartCharge/default u:object_r:hal_parts_service:s0
-
# FMRadio
vendor.eureka.hardware.fmradio.IFMDevControl/default u:object_r:hal_fmradio_service:s0
vendor.eureka.hardware.fmradio.IFMDevControl/support u:object_r:hal_fmradio_service:s0
diff --git a/universal7885-common/sepolicy/private/system_app.te b/universal7885-common/sepolicy/private/system_app.te
index 4903fd8..741887d 100644
--- a/universal7885-common/sepolicy/private/system_app.te
+++ b/universal7885-common/sepolicy/private/system_app.te
@@ -1,10 +1,3 @@
-# SamsungParts
-allow system_app hal_parts_service:service_manager find;
-
-binder_call(system_app, hal_parts_default)
-
-r_dir_file(system_app, parts_data_file)
-
# FMRadio
allow system_app hal_fmradio_service:service_manager find;
diff --git a/universal7885-common/universal7885-common.mk b/universal7885-common/universal7885-common.mk
index e16cda9..05f3370 100644
--- a/universal7885-common/universal7885-common.mk
+++ b/universal7885-common/universal7885-common.mk
@@ -384,10 +384,6 @@ PRODUCT_COPY_FILES += \
PRODUCT_CFI_INCLUDE_PATHS += hardware/samsung_slsi/scsc_wifibt/wpa_supplicant_lib
-# SamsungParts
-PRODUCT_PACKAGES += \
- SamsungParts
-
# Extra Command-Line Tools
PRODUCT_PACKAGES += \
sgdisk \