Class VehicleInformationContract


  • public final class VehicleInformationContract
    extends java.lang.Object
    Defines the contract for the OpenCab Vehicle Information provider. An OpenCab Vehicle Information provider app should define an Android ContentProvider class that follows this contract or should subclass the AbstractVehicleInformationProvider class and implement the abstract methods.
    sequenceDiagram participant A as OpenCab Consumer participant B as OpenCab Provider Note over A,B: consumer app launches, no driver logged in A->>+B: provider.call(METHOD_GET_VEHICLE_INFORMATION, version: 1) B->>A: {VEHICLE_INFORMATION: null} Note over A,B: driver logs in or connects to a vehicle mount B->>A: ACTION_VEHICLE_INFORMATION_CHANGED A->>+B: provider.call(METHOD_GET_VEHICLE_INFORMATION, version: 1) B->>A: {VEHICLE_INFORMATION: {VIN: "JH4NA1150RT000268", inGear: false}} Note over A,B: driver switches to D status or puts vehicle in gear B->>A: ACTION_VEHICLE_INFORMATION_CHANGED A->>+B: provider.call(METHOD_GET_VEHICLE_INFORMATION, version: 1) B->>A: {VEHICLE_INFORMATION: {VIN: "JH4NA1150RT000268", inGear: true}} Note over A,B: driver logs out or detaches tablet B->>A: ACTION_VEHICLE_INFORMATION_CHANGED A->>+B: provider.call(METHOD_GET_VEHICLE_INFORMATION, version: 1) B->>A: {VEHICLE_INFORMATION: null}
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ACTION_VEHICLE_INFORMATION_CHANGED
      This Action is broadcast when the vehicle information changes, perhaps because the driver chooses to associate with another vehicle, or if the device removed from a vehicle in a slip-seat scenario.
      static java.lang.String AUTHORITY
      This authority is declared in the manifest for the app that acts as the vehicle information provider.
      static java.lang.String KEY_ERROR
      If an error has occurred in one of the provider method calls, use this key to retrieve the error from the Bundle object returned from the provider call method.
      static java.lang.String KEY_VEHICLE_INFORMATION
      Use this key to retrieve the VIN from the Bundle object that is returned from the VehicleInformationContract.METHOD_GET_VEHICLE_INFORMATION method call.
      static java.lang.String METHOD_GET_VEHICLE_INFORMATION
      Provider method for retrieving the vehicle information.
      static java.lang.String VERSION
      This is the current version of the VehicleInformationContract for the OpenCab Standard.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VERSION

        public static final java.lang.String VERSION
        This is the current version of the VehicleInformationContract for the OpenCab Standard. The version will be passed as an argument to all method calls to the provider. The provider may reject or handle appropriately if the VERSION does not match the expected value. An OpenCab vehicle information provider allows access to details about the vehicle, if any, associated with the mobile device running the app or associated with the driver who is logged into the mobile app.
        See Also:
        Constant Field Values
      • AUTHORITY

        public static final java.lang.String AUTHORITY
        This authority is declared in the manifest for the app that acts as the vehicle information provider. It is then used by the consumer app to identify any providers installed on the device.
        See Also:
        Constant Field Values
      • ACTION_VEHICLE_INFORMATION_CHANGED

        public static final java.lang.String ACTION_VEHICLE_INFORMATION_CHANGED
        This Action is broadcast when the vehicle information changes, perhaps because the driver chooses to associate with another vehicle, or if the device removed from a vehicle in a slip-seat scenario.
        See Also:
        Constant Field Values
    • Constructor Detail

      • VehicleInformationContract

        public VehicleInformationContract()