summaryrefslogtreecommitdiff
path: root/tests/testdata/trigger_watchdog.sh
blob: 9e03c7d510927e079f699d8beda12fd7db6ae800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# To trigger native watchdog on install of version 300000000 of
# the com.android.tzdata apex:
# $ adb shell setprop persist.debug.trigger_watchdog.apex com.android.tzdata@300000000
apex=/apex/`/system/bin/getprop persist.debug.trigger_watchdog.apex`
/system/bin/log -t TriggerWatchdog "Checking for presence of $apex"
/system/bin/setprop debug.trigger_watchdog.status check
if [ -a $apex ]
then
    /system/bin/log -t TriggerWatchdog "Detected presence of $apex"
    /system/bin/log -t TriggerWatchdog "KILLING SYSTEM SERVER"
    /system/bin/setprop debug.trigger_watchdog.status kill
    while :
    do
        pid=`pidof system_server`
        if [ ! -z "$pid" ]
        then
            /system/bin/log -t TriggerWatchdog "Killing system_server pid=$pid ..."
            kill $pid
        fi
        sleep 1
    done
fi