From ddae25b2813cbb88d88b926b9cfdac6c37ba0451 Mon Sep 17 00:00:00 2001 From: Franz-Josef Haider Date: Wed, 21 Feb 2024 13:50:22 +0200 Subject: [PATCH] configs: sync hybris adaptation time with sailfish timezone. [configs] Sync hybris adaptation time with sailfish timezone. JB#61593 --- sparse/usr/bin/droid/droid-listen-timezone.sh | 10 ++++++++++ sparse/usr/bin/droid/droid-set-timezone.sh | 14 ++++++++++++++ .../droid-hybris/system/etc/init/timezone.rc | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100755 sparse/usr/bin/droid/droid-listen-timezone.sh create mode 100755 sparse/usr/bin/droid/droid-set-timezone.sh create mode 100644 sparse/usr/libexec/droid-hybris/system/etc/init/timezone.rc diff --git a/sparse/usr/bin/droid/droid-listen-timezone.sh b/sparse/usr/bin/droid/droid-listen-timezone.sh new file mode 100755 index 0000000..58e4a2e --- /dev/null +++ b/sparse/usr/bin/droid/droid-listen-timezone.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +DIR=$(dirname "$(readlink /etc/localtime)") + +# initial value +setprop persist.sys.timezone UTC +/usr/bin/droid/droid-set-timezone.sh n "$DIR" localtime + +/system/bin/inotifyd /usr/bin/droid/droid-set-timezone.sh "$DIR" + diff --git a/sparse/usr/bin/droid/droid-set-timezone.sh b/sparse/usr/bin/droid/droid-set-timezone.sh new file mode 100755 index 0000000..e2ef9cd --- /dev/null +++ b/sparse/usr/bin/droid/droid-set-timezone.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +STATE=$1 +DIR=$2 +FILE=$3 +if [ "$STATE" = "n" ]; then + if [ "$FILE" = "localtime" ]; then + TIMEZ=$(readlink "$DIR/$FILE" | sed "s|.*/usr/share/zoneinfo/||g") + setprop persist.sys.timezone "$TIMEZ" + fi +fi + +exit 0 + diff --git a/sparse/usr/libexec/droid-hybris/system/etc/init/timezone.rc b/sparse/usr/libexec/droid-hybris/system/etc/init/timezone.rc new file mode 100644 index 0000000..26cbafa --- /dev/null +++ b/sparse/usr/libexec/droid-hybris/system/etc/init/timezone.rc @@ -0,0 +1,6 @@ +service hybris_timezone /bin/sh /usr/bin/droid/droid-listen-timezone.sh + class main + user system + group system + ioprio rt 4 +