From 4a989235d0d1916b3c5490ca3ee1b84a5bbc1445 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 11 Jan 2024 14:08:24 +0530 Subject: [PATCH] camera: Turn off edge mode algorithm for one - Over sharpen images --- .../net/sourceforge/opencamera/DeviceSettings.java | 7 +++++++ .../net/sourceforge/opencamera/MainActivity.java | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/sourceforge/opencamera/DeviceSettings.java b/app/src/main/java/net/sourceforge/opencamera/DeviceSettings.java index bf98703a7..ed6011b1c 100644 --- a/app/src/main/java/net/sourceforge/opencamera/DeviceSettings.java +++ b/app/src/main/java/net/sourceforge/opencamera/DeviceSettings.java @@ -31,4 +31,11 @@ public class DeviceSettings { final boolean is_GS290 = Build.DEVICE != null && Build.DEVICE.equals("GS290"); return is_fairphone || is_xiaomi || is_GS290; } + + public static boolean isMurenaOne() { + final boolean isMurena = Build.MANUFACTURER.equals("Secure_Phone") + || Build.MANUFACTURER.equals("Murena"); + final boolean isOne = Build.DEVICE.equals("one") || Build.DEVICE.equals("X2"); + return isMurena && isOne; + } } diff --git a/app/src/main/java/net/sourceforge/opencamera/MainActivity.java b/app/src/main/java/net/sourceforge/opencamera/MainActivity.java index de596e265..628c82617 100644 --- a/app/src/main/java/net/sourceforge/opencamera/MainActivity.java +++ b/app/src/main/java/net/sourceforge/opencamera/MainActivity.java @@ -367,11 +367,20 @@ public class MainActivity extends AppCompatActivity { if( MyDebug.LOG ) Log.d(TAG, "onCreate: time after updating folder history: " + (System.currentTimeMillis() - debug_time)); + SharedPreferences.Editor editor = sharedPreferences.edit(); + if (DeviceSettings.isMurenaOne()) { + boolean isFirstTime = sharedPreferences.getBoolean("isFirstTimeMurenaOne", true); + if (isFirstTime && applicationInterface.getEdgeModePref().equals("default")) { + editor.putString(PreferenceKeys.EdgeModePreferenceKey, "off"); + editor.putBoolean("isFirstTimeMurenaOne", false); + editor.apply(); + } + } + boolean isFirstTimeSaveLocation = sharedPreferences.getBoolean("isFirstTimeSaveLocation", true); String save_location = sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"); if (isFirstTimeSaveLocation && save_location.equals("OpenCamera")) { - SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"); editor.putBoolean("isFirstTimeSaveLocation", false); editor.apply(); @@ -739,7 +748,6 @@ public class MainActivity extends AppCompatActivity { // We set the latest_version whether or not the dialog is shown - if we showed the first time dialog, we don't // want to then show the What's New dialog next time we run! Similarly if the user had disabled showing the dialog, // but then enables it, we still shouldn't show the dialog until the new time Open Camera upgrades. - SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putInt(PreferenceKeys.LatestVersionPreferenceKey, version_code); editor.apply(); } -- GitLab