1# Copyright (C) 2020 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15service carwatchdogd /system/bin/carwatchdogd
16    class core
17    user system
18    group system readproc
19    capabilities SYS_NICE
20    disabled
21
22on early-init && property:ro.build.type=userdebug
23    # Below intervals are in seconds
24    setprop ro.carwatchdog.system_event_collection_interval 1
25    setprop ro.carwatchdog.periodic_collection_interval 60
26    setprop ro.carwatchdog.periodic_monitor_interval 5
27
28    # Below durations are in seconds
29    setprop ro.carwatchdog.post_system_event_duration 30
30    setprop ro.carwatchdog.user_switch_timeout 30
31    setprop ro.carwatchdog.wake_up_event_duration 30
32
33on early-init && property:ro.build.type=eng
34    # Below intervals are in seconds
35    setprop ro.carwatchdog.system_event_collection_interval 1
36    setprop ro.carwatchdog.periodic_collection_interval 60
37    setprop ro.carwatchdog.periodic_monitor_interval 5
38
39    # Below durations are in seconds
40    setprop ro.carwatchdog.post_system_event_duration 30
41    setprop ro.carwatchdog.user_switch_timeout 30
42    setprop ro.carwatchdog.wake_up_event_duration 30
43
44on early-init && property:ro.build.type=user
45    # Below intervals are in seconds
46    setprop ro.carwatchdog.system_event_collection_interval 20
47    setprop ro.carwatchdog.periodic_collection_interval 120
48    setprop ro.carwatchdog.periodic_monitor_interval 5
49
50    # Below durations are in seconds
51    setprop ro.carwatchdog.post_system_event_duration 30
52    setprop ro.carwatchdog.user_switch_timeout 30
53    setprop ro.carwatchdog.wake_up_event_duration 30
54
55on init
56    # Number of top stats per category
57    setprop ro.carwatchdog.top_n_stats_per_category 10
58
59    # Number of top stats per sub-category
60    setprop ro.carwatchdog.top_n_stats_per_subcategory 5
61
62    # Cache size for the user switch events
63    setprop ro.carwatchdog.max_user_switch_events 5
64
65    # Duration in seconds that a system event's data is cached
66    setprop ro.carwatchdog.system_event_data_cache_duration 3600
67
68    # Cache size for the periodically collected records
69    setprop ro.carwatchdog.periodic_collection_buffer_size 180
70
71    # Cache size for the periodically monitored records
72    setprop ro.carwatchdog.periodic_monitor_buffer_size 360
73
74    # Start the service only after initializing the properties.
75    start carwatchdogd
76