1 /* 2 * Copyright (C) 2021 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.car.telemetry; 18 19 import android.car.telemetry.MetricsConfigKey; 20 import java.util.List; 21 22 /** 23 * Binder interface implemented by {@code CarTelemetryManager}. Enables sending results from 24 * {@code CarTelemetryService} to {@code CarTelemetryManager}. 25 * 26 * @hide 27 */ 28 oneway interface ICarTelemetryServiceListener { 29 30 /** 31 * Called by {@code CarTelemetryService} to provide telemetry results. This call is destructive. 32 * The parameter will no longer be stored in {@code CarTelemetryService}. 33 * 34 * @param key the key that the result is associated with. 35 * @param result the serialized bytes of the script execution result message. 36 */ onResult(in MetricsConfigKey key, in byte[] result)37 void onResult(in MetricsConfigKey key, in byte[] result); 38 39 /** 40 * Called by {@code CarTelemetryService} to provide telemetry errors. This call is destructive. 41 * The parameter will no longer be stored in {@code CarTelemetryService}. 42 * 43 * @param error the serialized bytes of an error message. 44 */ onError(in MetricsConfigKey key, in byte[] error)45 void onError(in MetricsConfigKey key, in byte[] error); 46 47 /** 48 * Sends the {@link #addMetricsConfig(MetricsConfigKey, byte[])} status to the client. 49 * 50 * @param key the {@link MetricsConfigKey} that the status is associated with. 51 * @param statusCode indicating add status. 52 */ onAddMetricsConfigStatus(in MetricsConfigKey key, in int statusCode)53 void onAddMetricsConfigStatus(in MetricsConfigKey key, in int statusCode); 54 }