Rohit Iti
unread,Nov 10, 2020, 5:51:44 AM11/10/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android Automotive OS Discussion Group, ambina...@gmail.com, Rohit Iti, Android Automotive OS Discussion Group, frankk...@gmail.com
private void initcar() {
if(!getBaseContext().getPackageManager().hasSystemFeature(getBaseContext().getPackageManager().FEATURE_AUTOMOTIVE)){
Log.d(TAG, "initcar: hasSystemFeature failed");
return;
}
mCar = Car.createCar(this);
carPropertyManager = (CarPropertyManager) mCar.getCarManager(Car.PROPERTY_SERVICE);
mpropertyids = carPropertyManager.getPropertyList();
Log.d(TAG, "initcar: List = " + mpropertyids.size()); // Always returns 0
carPropertyManager.registerCallback(this.carPropertyListener, VehiclePropertyIds.PERF_VEHICLE_SPEED,
CarPropertyManager.SENSOR_RATE_ONCHANGE);
}
public CarPropertyManager.CarPropertyEventCallback carPropertyListener = new CarPropertyManager.CarPropertyEventCallback() {
@Override
public void onChangeEvent(CarPropertyValue carPropertyValue) {
Log.d(TAG, "onChangeEvent: " + carPropertyValue.getValue());
}
@Override
public void onErrorEvent(int i, int i1) {
Log.d(TAG, "onErrorEvent: ");
}
};
When i run this code am getting "CarPropertyManager: registerListener: propId is not in config list: 291504647"
PERF_VEHICLE_SPEED = 291504647
I am assuming we need to add List<CarPropertyConfig> mpropertyids or register it somewhere .
Am not aware how to do this .
Can anyone help me get through this ?