From 1d39eb76e82f9de4d9d91884542ed8753d4aa63a Mon Sep 17 00:00:00 2001
From: Soo-Hwan Na <69458352+roynatech2544@users.noreply.github.com>
Date: Fri, 19 Nov 2021 20:00:15 +0900
Subject: [PATCH] universal7885: SamsungParts: Match latest source changes
---
.../apps/SamsungParts/AndroidManifest.xml | 34 ++-------------
.../apps/SamsungParts/jni/GPUBridge.cpp | 2 +-
.../SamsungParts/res/drawable/ic_reset.xml | 11 +++++
.../apps/SamsungParts/res/values/colors.xml | 4 +-
.../apps/SamsungParts/res/values/strings.xml | 11 ++---
.../res/xml/preferences_samsung_parts.xml | 6 +--
.../eurekateam/samsungextras/BootReceiver.kt | 42 -------------------
.../{main => }/DeviceSettings.kt | 3 +-
.../{main => }/DeviceSettingsActivity.kt | 2 +-
.../com/eurekateam/samsungextras/Startup.kt | 36 ----------------
10 files changed, 29 insertions(+), 122 deletions(-)
create mode 100644 universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml
delete mode 100644 universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt
rename universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/{main => }/DeviceSettings.kt (98%)
rename universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/{main => }/DeviceSettingsActivity.kt (97%)
delete mode 100644 universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/Startup.kt
diff --git a/universal7885-common/apps/SamsungParts/AndroidManifest.xml b/universal7885-common/apps/SamsungParts/AndroidManifest.xml
index 391cc18..7ce8686 100644
--- a/universal7885-common/apps/SamsungParts/AndroidManifest.xml
+++ b/universal7885-common/apps/SamsungParts/AndroidManifest.xml
@@ -17,21 +17,6 @@
android:theme="@style/CustomOptionsTheme"
android:fullBackupOnly="true"
android:allowBackup="true">
-
-
-
-
-
-
-
-
-
-
-
@@ -74,7 +58,6 @@
android:name="com.eurekateam.samsungextras.flashlight.FlashLightActivity"
android:exported="true"
android:label="@string/flashlight_title">
-
@@ -100,18 +83,7 @@
-
-
-
-
-
service = IGpu::getService();
- if (enable == 1){
+ if (enable == 1){
service->setGpuWritable(Enable::ENABLE);
}else{
service->setGpuWritable(Enable::DISABLE);
diff --git a/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml b/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml
new file mode 100644
index 0000000..f37ece8
--- /dev/null
+++ b/universal7885-common/apps/SamsungParts/res/drawable/ic_reset.xml
@@ -0,0 +1,11 @@
+
+
+
+
\ No newline at end of file
diff --git a/universal7885-common/apps/SamsungParts/res/values/colors.xml b/universal7885-common/apps/SamsungParts/res/values/colors.xml
index fcdd84d..1f8aec7 100644
--- a/universal7885-common/apps/SamsungParts/res/values/colors.xml
+++ b/universal7885-common/apps/SamsungParts/res/values/colors.xml
@@ -15,5 +15,7 @@
#66000000
#FFFF6700
-
+ #FF0000
+ #00FF00
+ #0000FF
diff --git a/universal7885-common/apps/SamsungParts/res/values/strings.xml b/universal7885-common/apps/SamsungParts/res/values/strings.xml
index fc9ec67..2eabf24 100644
--- a/universal7885-common/apps/SamsungParts/res/values/strings.xml
+++ b/universal7885-common/apps/SamsungParts/res/values/strings.xml
@@ -20,7 +20,6 @@
Display
-
FPS info overlay
Show overlay with current frames per second
@@ -48,9 +47,6 @@
Game 1 Profile
Game 2 Profile
Special Audio Profile
-
-
-
Eureka Kernel Features
@@ -62,8 +58,13 @@
Use this feature to adjust low or high flashlight brightness. Ranges from 0 to 10.
- GPU
+ Misc
+
+ Input Devices Control
+ Control sensor\'s power. Can be used to save battery.
+ Manage Sensor\'s Power here.
+ If you are really low on battery, perhaps this settings can help
Exynos GPU (Mali) Throttling
Disable/Enable GPU Throttling
diff --git a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml b/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
index b93e952..7e57b00 100644
--- a/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
+++ b/universal7885-common/apps/SamsungParts/res/xml/preferences_samsung_parts.xml
@@ -49,8 +49,8 @@
+ android:key="misc"
+ android:title="@string/misc_category">
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 e0fe655..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/BootReceiver.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2020 The Xiaomi-SM6250 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
-
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import androidx.preference.PreferenceManager
-import com.eurekateam.samsungextras.fps.FPSInfoService
-import com.eurekateam.samsungextras.interfaces.GPU
-import com.eurekateam.samsungextras.main.DeviceSettings
-
-class BootReceiver : BroadcastReceiver() {
- override fun onReceive(context: Context, intent: Intent) {
- if (intent.action.equals(Intent.ACTION_BOOT_COMPLETED, ignoreCase = true)) {
- val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context)
- val fpsenabled = sharedPrefs.getBoolean(DeviceSettings.PREF_KEY_FPS_INFO, false)
- if (fpsenabled) {
- context.startService(Intent(context, FPSInfoService::class.java))
- }
- val gpuenabled = sharedPrefs.getBoolean(DeviceSettings.PREF_GPUEXYNOS, true)
- if (gpuenabled) {
- GPU.GPU = 1
- }else{
- GPU.GPU = 0
- }
- }
- }
-}
\ No newline at end of file
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettings.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt
similarity index 98%
rename from universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettings.kt
rename to universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt
index ad3192b..f92faee 100644
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettings.kt
+++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettings.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License
*/
-package com.eurekateam.samsungextras.main
+package com.eurekateam.samsungextras
import android.content.Intent
import android.os.Bundle
@@ -22,7 +22,6 @@ import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import androidx.preference.SwitchPreference
-import com.eurekateam.samsungextras.R
import com.eurekateam.samsungextras.battery.BatteryActivity
import com.eurekateam.samsungextras.flashlight.FlashLightActivity
import com.eurekateam.samsungextras.fps.FPSInfoService
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettingsActivity.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt
similarity index 97%
rename from universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettingsActivity.kt
rename to universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt
index 582ab8c..3302af4 100644
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/main/DeviceSettingsActivity.kt
+++ b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/DeviceSettingsActivity.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License
*/
-package com.eurekateam.samsungextras.main
+package com.eurekateam.samsungextras
import android.os.Bundle
import android.view.MenuItem
diff --git a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/Startup.kt b/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/Startup.kt
deleted file mode 100644
index 2453d32..0000000
--- a/universal7885-common/apps/SamsungParts/src/com/eurekateam/samsungextras/Startup.kt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 The OmniROM Project
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-package com.eurekateam.samsungextras
-
-import android.content.BroadcastReceiver
-import android.content.Context
-import android.content.Intent
-import androidx.preference.PreferenceManager
-import com.eurekateam.samsungextras.fps.FPSInfoService
-import com.eurekateam.samsungextras.main.DeviceSettings
-
-class Startup : BroadcastReceiver() {
- override fun onReceive(context: Context, bootintent: Intent) {
- val enabled: Boolean
- val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context)
- enabled = sharedPrefs.getBoolean(DeviceSettings.PREF_KEY_FPS_INFO, false)
- if (enabled) {
- context.startService(Intent(context, FPSInfoService::class.java))
- }
- }
-}
\ No newline at end of file