• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 import com.android.car.internal.property.CarSubscription;
28 import com.android.car.internal.property.GetPropertyConfigListResult;
29 
30 /**
31  * @hide
32  */
33 interface ICarProperty {
34 
registerListener(in List<CarSubscription> carSubscription, in ICarPropertyEventListener callback)35     void registerListener(in List<CarSubscription> carSubscription,
36                 in ICarPropertyEventListener callback);
37 
unregisterListener(int propId, in ICarPropertyEventListener callback)38     void unregisterListener(int propId, in ICarPropertyEventListener callback);
39 
getPropertyList()40     CarPropertyConfigList getPropertyList();
41 
getProperty(int prop, int zone)42     CarPropertyValue getProperty(int prop, int zone);
43 
setProperty(in CarPropertyValue prop, in ICarPropertyEventListener callback)44     void setProperty(in CarPropertyValue prop, in ICarPropertyEventListener callback);
45 
getReadPermission(int propId)46     String getReadPermission(int propId);
47 
getWritePermission(int propId)48     String getWritePermission(int propId);
49 
getPropertyConfigList(in int[] propIds)50     GetPropertyConfigListResult getPropertyConfigList(in int[] propIds);
51 
52     /**
53      * Gets CarPropertyValues asynchronously.
54      */
getPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, in IAsyncPropertyResultCallback asyncPropertyResultCallback, long timeoutInMs)55     void getPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests,
56                 in IAsyncPropertyResultCallback asyncPropertyResultCallback,
57                 long timeoutInMs);
58 
59     /**
60      * Cancel on-going async requests.
61      *
62      * @param serviceRequestIds A list of async get/set property request IDs.
63      */
cancelRequests(in int[] serviceRequestIds)64     void cancelRequests(in int[] serviceRequestIds);
65 
66     /**
67      * Sets CarPropertyValues asynchronously.
68      */
setPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests, in IAsyncPropertyResultCallback asyncPropertyResultCallback, long timeoutInMs)69     void setPropertiesAsync(in AsyncPropertyServiceRequestList asyncPropertyServiceRequests,
70                 in IAsyncPropertyResultCallback asyncPropertyResultCallback,
71                 long timeoutInMs);
72 
73     /**
74      * Returns the property IDs that are supported but the caller does not have read permission for.
75      */
getSupportedNoReadPermPropIds(in int[] propIds)76     int[] getSupportedNoReadPermPropIds(in int[] propIds);
77 
78     /**
79      * Returns whether the property is supported and the caller only has write permission, but
80      * no read permission for the property.
81      */
isSupportedAndHasWritePermissionOnly(int propId)82     boolean isSupportedAndHasWritePermissionOnly(int propId);
83 }
84