当前位置:   article > 正文

Android Automotive架构与流程:VehicleHAL,CarService_vehicle hal

vehicle hal

case DYSENSOR_SERVICE: manager = new CarDYSensorManager(binder, mContext, mEventHandler);break;

case INFO_SERVICE: manager = new CarInfoManager(binder);break;

case APP_FOCUS_SERVICE: manager = new CarAppFocusManager(binder, mEventHandler);break;

case PACKAGE_SERVICE: manager = new CarPackageManager(binder, mContext);break;

case CAR_NAVIGATION_SERVICE: manager = new CarNavigationStatusManager(binder);break;

case CABIN_SERVICE: manager = new CarCabinManager(binder, mContext, mEventHandler);break;

case DIAGNOSTIC_SERVICE: manager = new CarDiagnosticManager(binder, mContext, mEventHandler);break;

case HVAC_SERVICE: manager = new CarHvacManager(binder, mContext, mEventHandler);break;

case DYHVAC_SERVICE: manager = new CarDYHvacManager(binder, mContext, mEventHandler);break;

case POWER_SERVICE: manager = new CarPowerManager(binder, mContext, mEventHandler);break;

case PROJECTION_SERVICE:manager = new CarProjectionManager(binder, mEventHandler);break;

case PROPERTY_SERVICE:

manager = new CarPropertyManager(binder, mEventHandler, false, “CarPropertyManager”);break;

case VENDOR_EXTENSION_SERVICE: manager = new CarVendorExtensionManager(binder, mEventHandler);break;

case CAR_INSTRUMENT_CLUSTER_SERVICE:

manager = new CarInstrumentClusterManager(binder, mEventHandler);break;

case TEST_SERVICE:

/* CarTestManager exist in static library. So instead of constructing it here,

  • only pass binder wrapper so that CarTestManager can be constructed outside. */

manager = new CarTestManagerBinderWrapper(binder);break;

case VMS_SUBSCRIBER_SERVICE: manager = new VmsSubscriberManager(binder); break;

case BLUETOOTH_SERVICE: manager = new CarBluetoothManager(binder, mContext);break;

case TBOX_SERVICE: manager = TboxManager.getInstance(); break;

case STORAGE_MONITORING_SERVICE: manager = new CarStorageMonitoringManager(binder, mEventHandler); break;

case CAR_DRIVING_STATE_SERVICE:

manager = new CarDrivingStateManager(binder, mContext, mEventHandler);break;

case CAR_UX_RESTRICTION_SERVICE:

manager = new CarUxRestrictionsManager(binder, mContext, mEventHandler);break;

case CAR_CONFIGURATION_SERVICE: manager = new CarConfigurationManager(binder);break;

case CAR_MCU_SERVICE: manager = new CarMcuManager(binder, mContext, mEventHandler);break;

case DYCABIN_SERVICE: manager = new CarDYCabinManager(binder, mContext, mEventHandler);break;

default:break;

}

return manager;

}

  1. 具体的Manager -> 注册/反注册回调, set/get 属性CarProperty:

public final class CarHvacManager implements CarManagerBase {

private void handleOnChangeEvent(CarPropertyValue value) {

Collection callbacks;

synchronized (this) { callbacks = new ArraySet<>(mCallbacks); }

if (!callbacks.isEmpty()) {

for (CarHvacEventCallback l: callbacks) {

if (DBG) Log.d(TAG, “onChangeEvent value=” + value.toString());

l.onChangeEvent(value);

}

}

}

private void handleOnErrorEvent(int propertyId, int zone) {

Collection callbacks;

synchronized (this) { callbacks = new ArraySet<>(mCallbacks); }

if (!callbacks.isEmpty()) {

for (CarHvacEventCallback l: callbacks) {

l.onErrorEvent(propertyId, zone);

}

}

}

public CarHvacManager(IBinder serv

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/636461
推荐阅读
相关标签
  

闽ICP备14008679号