forked from SeattleTestbed/repy_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
It can happen that Sensibility doesn't have the permission to access a sensor. This then leads to an exception like this:
Exception (with type 'exceptions.Exception'): java.lang.SecurityException: getAllCellInfo:
Neither user 10106 nor current process has android.permission.ACCESS_COARSE_LOCATION.
How are we going to deal with this?
- Make proper Python/Repy/Sensor exceptions. This makes sense in terms of handling these issues in a Repy program, but also means that handling is required! For every sensor in your program, you must always expect that the permission to use it is revoked. Thus,
try/excepteverywhere. - Alternatively, hide these exceptions from the experiment. You try to access the sensor, but it ... returns
None? The previous reading? Or it blocks indefinitely? Something else that makes sense? - The middle ground: Provide a wrapper layer, base the lower-layer implementation on (1), and provide (2) as the experimenter's interface. Downside: Messing with
securitylayers to set the wrappers up.
Reactions are currently unavailable