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.IScriptExecutorListener; 20 import android.os.Bundle; 21 22 /** 23 * An internal API provided by isolated Script Executor process 24 * for executing Lua scripts in a sandboxed environment 25 * 26 * @hide 27 */ 28 interface IScriptExecutor { 29 /** 30 * Executes a specified function in provided Lua script with given input arguments. 31 * 32 * @param scriptBody complete body of Lua script that also contains the function to be invoked 33 * @param functionName the name of the function to execute 34 * @param publishedData input data provided by the source which the function handles 35 * @param savedState key-value pairs preserved from the previous invocation of the function 36 * @param listener callback for the sandboxed environent to report back script execution results, errors, and logs 37 */ invokeScript(String scriptBody, String functionName, in Bundle publishedData, in @nullable Bundle savedState, in IScriptExecutorListener listener)38 void invokeScript(String scriptBody, 39 String functionName, 40 in Bundle publishedData, 41 in @nullable Bundle savedState, 42 in IScriptExecutorListener listener); 43 } 44