diff options
author | Mark Salyzyn <salyzyn@google.com> | 2016-07-21 14:00:30 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2016-07-21 14:19:39 -0700 |
commit | 6a7bfd8749982ef9f64179ca9da3d104ebd177f8 (patch) | |
tree | 56b8d2fe55d69f9c6efa36b0119664b6bd6bce8a /logcat/logpersist | |
parent | 02ccdc5db9bb39488a3fe22a907b3211c3a464b9 (diff) | |
download | core-6a7bfd8749982ef9f64179ca9da3d104ebd177f8.tar.gz core-6a7bfd8749982ef9f64179ca9da3d104ebd177f8.tar.bz2 core-6a7bfd8749982ef9f64179ca9da3d104ebd177f8.zip |
logcatd: logpersist.start to enable logd service if disabled
Bug: 28936216
Change-Id: I2f2878f138be6675bf00bd638df2bdd690a1fae5
Diffstat (limited to 'logcat/logpersist')
-rwxr-xr-x | logcat/logpersist | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/logcat/logpersist b/logcat/logpersist index e9982e2b7..f0e7d42e2 100755 --- a/logcat/logpersist +++ b/logcat/logpersist @@ -17,6 +17,7 @@ true) ;; ;; esac +log_tag_property=persist.log.tag data=/data/misc/logd service=logcatd size_default=256 @@ -65,6 +66,9 @@ if [ -n "${buffer}" ] && ! logcat -b ${buffer} -g >/dev/null 2>&1; then exit 1 fi +log_tag="`getprop ${log_tag_property}`" +logd_logpersistd="`getprop ${property}`" + case ${progname} in *.cat) if [ -n "${size}${buffer}" -o "true" = "${clear}" ]; then @@ -123,6 +127,12 @@ case ${progname} in while [ "clear" = "`getprop ${property#persist.}`" ]; do continue done + # Tell Settings that we are back on again if we turned logging off + tag="${log_tag#Settings}" + if [ X"${log_tag}" != X"${tag}" ]; then + echo "WARNING: enabling logd service" >&2 + setprop ${log_tag_property} "${tag#,}" + fi # ${service}.rc does the heavy lifting with the following trigger setprop ${property} ${service} # 20ms done, to permit process feedback check @@ -158,3 +168,9 @@ case ${progname} in echo "ERROR: Unexpected command ${0##*/} ${args}" >&2 exit 1 esac + +if [ X"${log_tag}" != X"`getprop ${log_tag_property}`" ] || + [ X"${logd_logpersistd}" != X"`getprop ${property}`" ]; then + echo "WARNING: killing Settings" >&2 + am force-stop com.android.settings +fi |