1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.automotive.watchdog.internal; 18 19 import android.automotive.watchdog.internal.PackageInfo; 20 import android.automotive.watchdog.internal.PackageIoOveruseStats; 21 import android.automotive.watchdog.internal.TimeoutLength; 22 23 /** 24 * ICarWatchdogServiceForSystem interface used by the watchdog server to communicate with the 25 * watchdog service. 26 * 27 * @hide 28 */ 29 interface ICarWatchdogServiceForSystem { 30 /** 31 * Checks if the client is alive. 32 * 33 * Watchdog server calls this method, expecting the clients will respond within timeout. 34 * The final timeout is decided by the server, considering the requested timeout on client 35 * registration. If no response from the clients, watchdog server will dump process information 36 * and kill them. 37 * 38 * @param sessionId Unique id to identify each health check session. 39 * @param timeout Final timeout given by the server based on client request. 40 */ checkIfAlive(in int sessionId, in TimeoutLength timeout)41 oneway void checkIfAlive(in int sessionId, in TimeoutLength timeout); 42 43 /** 44 * Notifies the client that it will be forcedly terminated in 1 second. 45 */ prepareProcessTermination()46 oneway void prepareProcessTermination(); 47 48 /** 49 * Returns the package information for the given UIDs. Only UIDs with package information will be 50 * returned. 51 * 52 * @param uids List of UIDs to resolve the package infos. 53 * @param vendorPackagePrefixes List of vendor package prefixes. 54 */ getPackageInfosForUids( in int[] uids, in @utf8InCpp List<String> vendorPackagePrefixes)55 List<PackageInfo> getPackageInfosForUids( 56 in int[] uids, in @utf8InCpp List<String> vendorPackagePrefixes); 57 58 /** 59 * Pushes the latest I/O overuse stats to the watchdog server. 60 * 61 * @param packageIoOveruseStats Latest package I/O overuse stats, for all packages, from the 62 * recent collection. 63 */ latestIoOveruseStats(in List<PackageIoOveruseStats> packageIoOveruseStats)64 oneway void latestIoOveruseStats(in List<PackageIoOveruseStats> packageIoOveruseStats); 65 66 /** 67 * Resets resource overuse stats on the watchdog server side. 68 * 69 * @param packageNames Package names for which to reset the stats. 70 */ resetResourceOveruseStats(in @tf8InCpp List<String> packageNames)71 oneway void resetResourceOveruseStats(in @utf8InCpp List<String> packageNames); 72 } 73