CarPropertyManager: not found

165 views
Skip to first unread message

Rohit Iti

unread,
Nov 10, 2020, 5:52:45 AM11/10/20
to Android Automotive OS Discussion Group
        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 ? I am basically still struggling to see car speed printed in log.
Reply all
Reply to author
Forward
0 new messages