Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configs: sync hybris adaptation time with sailfish timezone. #266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sparse/usr/bin/droid/droid-listen-timezone.sh
Original file line number Diff line number Diff line change
@@ -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"

14 changes: 14 additions & 0 deletions sparse/usr/bin/droid/droid-set-timezone.sh
Original file line number Diff line number Diff line change
@@ -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

6 changes: 6 additions & 0 deletions sparse/usr/libexec/droid-hybris/system/etc/init/timezone.rc
Original file line number Diff line number Diff line change
@@ -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