From 5822f98bbbc3b96a90ff09551de8252ca18bca22 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Tue, 15 Aug 2023 20:23:33 +0200 Subject: Migrate layouts preferences The new `layouts` preference replaces three previous preferences: layout second_layout custom_layout Add a preference migration function, which first migration is to migrate layouts into the new preference. The migration must also be called from the SettingsActivity as it might use a different preference store due to the boot-aware preference copy. --- srcs/juloo.keyboard2/Logs.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'srcs/juloo.keyboard2/Logs.java') diff --git a/srcs/juloo.keyboard2/Logs.java b/srcs/juloo.keyboard2/Logs.java index a09c83f..8843052 100644 --- a/srcs/juloo.keyboard2/Logs.java +++ b/srcs/juloo.keyboard2/Logs.java @@ -27,9 +27,25 @@ public final class Logs _debug_logs.println("actionLabel: "+conf.actionLabel); } + public static void debug_config_migration(int from_version, int to_version) + { + debug("Migrating config version from " + from_version + " to " + to_version); + } + public static void debug(String s) { if (_debug_logs != null) _debug_logs.println(s); } + + public static void exn(String msg, Exception e) + { + Log.e(TAG, msg, e); + } + + public static void trace() + { + if (_debug_logs != null) + _debug_logs.println(Log.getStackTraceString(new Exception())); + } } -- cgit v1.2.3