nisrulz/sensey

PickupDeviceListener.onDevicePutDown() is never called

FormallyMyles opened this issue · 0 comments

Do you want to request a feature or report a bug?
Bug Report

What is the current behaviour?
The PickupDeviceListener.onDevicePutDown() method is never called so any code using it is never triggered.

If the current behaviour is a bug, please provide the steps to reproduce.
Put down the phone, the event is not called (if you put System.out.println() statements)

What is the expected behavior?
The method should be called when the phone is placed down (I'm not entirely sure on the exact parameters to detect this).

Relevant Code

Interface:

Should be called somewhere around here:

protected void onSensorEvent(SensorEvent sensorEvent) {
float x = sensorEvent.values[0];
float y = sensorEvent.values[1];
float z = sensorEvent.values[2];
double vectorSum = Math.sqrt(x * x + y * y + z * z);
if (vectorSum > 11) {
pickupDeviceListener.onDevicePickedUp();
}
}