1 /* 2 * Copyright (C) 2016 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.hardware.property; 18 19 import android.car.hardware.CarPropertyConfig; 20 import android.car.hardware.CarPropertyValue; 21 import android.car.hardware.property.ICarPropertyEventListener; 22 23 import com.android.car.internal.property.AsyncPropertyServiceRequest; 24 import com.android.car.internal.property.IAsyncPropertyResultCallback; 25 import com.android.car.internal.property.CarPropertyConfigList; 26 import com.android.car.internal.property.AsyncPropertyServiceRequestList; 27 28 /** 29 * @hide 30 */ 31 interface ICarProperty { 32 registerListener(int propId, float rate, in ICarPropertyEventListener callback)33 void registerListener(int propId, float rate, in ICarPropertyEventListener callback) = 0; 34 unregisterListener(int propId, in ICarPropertyEventListener callback)35 void unregisterListener(int propId, in ICarPropertyEventListener callback) = 1; 36 getPropertyList()37 CarPropertyConfigList getPropertyList() = 2; 38 getProperty(int prop, int zone)39 CarPropertyValue getProperty(int prop, int zone) = 3; 40 setProperty(in CarPropertyValue prop, in ICarPropertyEventListener callback)41 void setProperty(in CarPropertyValue prop, in ICarPropertyEventListener callback) = 4; 42 getReadPermission(int propId)43 String getReadPermission(int propId) = 5; 44 getWritePermission(int propId)45 String getWritePermission(int propId) = 6; 46 getPropertyConfigList(in int[] propIds)47 CarPropertyConfigList getPropertyConfigList(in int[] propIds) = 7; 48 49 /** 50 * Gets CarPropertyValues asynchronously. 51 */ getPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, in IAsyncPropertyResultCallback asyncPropertyResultCallback, long timeoutInMs)52 void getPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, 53 in IAsyncPropertyResultCallback asyncPropertyResultCallback, 54 long timeoutInMs) = 8; 55 56 /** 57 * Cancel on-going async requests. 58 * 59 * @param serviceRequestIds A list of async get/set property request IDs. 60 */ cancelRequests(in int[] serviceRequestIds)61 void cancelRequests(in int[] serviceRequestIds) = 9; 62 63 /** 64 * Sets CarPropertyValues asynchronously. 65 */ setPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, in IAsyncPropertyResultCallback asyncPropertyResultCallback, long timeoutInMs)66 void setPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, 67 in IAsyncPropertyResultCallback asyncPropertyResultCallback, 68 long timeoutInMs) = 10; 69 } 70