protected int findIndexFirstDataWithProximityValueEqualZero(boolean linear)
    {
        ArrayList<Reading> readingsToUse = readings;
        if (linear)
        {
            readingsToUse = readingsLinear;
        }
        if (readingsToUse != null)
        {
        for (int i = 0; i < readingsToUse.size(); i++)
            {
                if ((readingsToUse.get(i) != null) && readingsToUse.get(i).getProximityValue() == 0)
                {
                    return i;
                }
            }
        }
        return -1;
    }