Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sensormanager] Add plugin availability config and D-Bus queries. JB#…
…41369 Allow disabling / enabling sensors plugins via config entries like: [available] proximitysensor=True magnetometersensor=False lidsensor=Feature_CoverSensor orientationsensor=Feature_GyroSensor|Feature_AccelerationSensor Where: - "True" means that loading of the sensor plugin is made available via D-Bus interface and can be loaded. - "False" means the plugin will not be loaded and sensor is not made available via D-Bus - "Feature_*" means that sensor availability is checked from hw settings. If sensorfwd is compiled without ssu-sysinfo support these will be treated similarly to "True". - "" (or plugin that does not have config entry) is taken as "True", but a warning is logged in case of sensor plugins. If a plugin that is enabled in configuration fails to load, it is marked as not available until sensorfwd restart. Add new D-Bus method calls: - availablePlugins() lists all available plugins - availableSensorPlugins() lists available sensor plugins (which, when loaded, make new sensor objects and interfaces available) - pluginAvailable(name) can be used to check whether a named plugin is installed and available Package default sensor availability configuration file that disables all sensors except those that can be evaluated based on the hw settings configuration. Add example of device specific configuration file - these should be installed from hw adaptation packages and can override the defaults. Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
- Loading branch information
Showing
11 changed files
with
333 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[available] | ||
; Availability of some sensors can be defined in hw-settings configuration | ||
; files. By enabling ssu-sysinfo usage, sensorfwd configuration can be | ||
; written so that it just refers to hw-settings config. If ssu-sysinfo | ||
; is not used, these will default to "True". | ||
; | ||
; In case of virtual sensors can be implemented on top of multiple real | ||
; sensors, multiple '|' separated features can be given and the sensor | ||
; is enabled if at least one of those is set in hw-settings. | ||
|
||
accelerometersensor=Feature_AccelerationSensor | ||
alssensor=Feature_LightSensor | ||
compasssensor=Feature_CompassSensor | ||
gyroscopesensor=Feature_GyroSensor | ||
orientationsensor=Feature_GyroSensor|Feature_AccelerationSensor | ||
proximitysensor=Feature_ProximitySensor | ||
|
||
; In theory having Feature_CoverSensor == have lidsensor. However | ||
; in practice only mce is expected to track lidsensor and atm it | ||
; does it via suspend proofed evdev inputs rather than sensorfwd. | ||
; So, even if the lidsensor adaptors provided by sensorfwd would | ||
; work, they might interfere with the only user of the sensor. | ||
; lidsensor=Feature_CoverSensor | ||
lidsensor=False | ||
|
||
; To avoid revisiting config files for all old ports, the defaults | ||
; added sensors should be set "False" by default here, and to "True" | ||
; in device specific override config as appropriate. | ||
|
||
humiditysensor=False | ||
magnetometersensor=False | ||
pressuresensor=False | ||
rotationsensor=False | ||
stepcountersensor=False | ||
tapsensor=False | ||
temperaturesensor=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[available] | ||
|
||
; Sensors that are disabled by default. | ||
; -> Enable as appropriate | ||
|
||
;humiditysensor=True | ||
;magnetometersensor=True | ||
;pressuresensor=True | ||
;rotationsensor=True | ||
;stepcountersensor=True | ||
;tapsensor=True | ||
;temperaturesensor=True | ||
|
||
; Sensors that should/can be enabled/disabled based on | ||
; hw settings config - or are enabled if sensorfwd is | ||
; built without ssu-sysinfo support. | ||
; -> Override as appropriate. | ||
|
||
;accelerometersensor=False | ||
;alssensor=False | ||
;compasssensor=False | ||
;gyroscopesensor=False | ||
;lidsensor=False | ||
;orientationsensor=False | ||
;proximitysensor=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.