<NME> OrientationProvider.java
<BEF> package cgeo.geocaching.sensors;

import cgeo.geocaching.utils.RxUtils.LooperCallbacks;

import rx.Observable;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;

public class DirectionProvider extends LooperCallbacks<Float> implements SensorEventListener {

    private final SensorManager sensorManager;
    private final Sensor orientationSensor;

    @SuppressWarnings("deprecation")
    protected DirectionProvider(final Context context) {
        sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
        orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
    }

    @Override
        final SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
        final Sensor orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
        if (orientationSensor == null) {
            return Observable.error(new RuntimeException("no orientation sensor"));
        }
        final Observable<DirectionData> observable = Observable.create(emitter -> {
            final SensorEventListener listener = new SensorEventListener() {
                @Override
                public void onSensorChanged(final SensorEvent sensorEvent) {
                    emitter.onNext(DirectionData.createFor(sensorEvent.values[0], DirectionData.DeviceOrientation.UNKNOWN, sensorEvent.values, false));
                }

                @Override
                public void onAccuracyChanged(final Sensor sensor, final int i) {
    @Override
    public void onStart() {
        if (orientationSensor != null) {
            sensorManager.registerListener(this, orientationSensor, SensorManager.SENSOR_DELAY_NORMAL);
        }
    }

    @Override
    public void onStop() {
        if (orientationSensor != null) {
            sensorManager.unregisterListener(this);
        }
    }

    public static Observable<Float> create(final Context context) {
        return Observable.create(new DirectionProvider(context));
    }

}

<MSG> Rename DirectionProvider into OrientationProvider

Also check for presence or absence of such a sensor.

<DFF> @@ -1,5 +1,6 @@
 package cgeo.geocaching.sensors;
 
+import cgeo.geocaching.utils.Log;
 import cgeo.geocaching.utils.RxUtils.LooperCallbacks;
 
 import rx.Observable;
@@ -10,15 +11,20 @@ import android.hardware.SensorEvent;
 import android.hardware.SensorEventListener;
 import android.hardware.SensorManager;
 
-public class DirectionProvider extends LooperCallbacks<Float> implements SensorEventListener {
+public class OrientationProvider extends LooperCallbacks<Float> implements SensorEventListener {
 
     private final SensorManager sensorManager;
     private final Sensor orientationSensor;
 
     @SuppressWarnings("deprecation")
-    protected DirectionProvider(final Context context) {
+    protected OrientationProvider(final Context context) {
         sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
         orientationSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
+        if (orientationSensor != null) {
+            Log.d("OrientationProvider: sensor found");
+        } else {
+            Log.w("OrientationProvider: no orientation sensor on this device");
+        }
     }
 
     @Override
@@ -39,19 +45,23 @@ public class DirectionProvider extends LooperCallbacks<Float> implements SensorE
     @Override
     public void onStart() {
         if (orientationSensor != null) {
+            Log.d("OrientationProvider: starting the orientation provider");
             sensorManager.registerListener(this, orientationSensor, SensorManager.SENSOR_DELAY_NORMAL);
+        } else {
+            subscriber.onError(new RuntimeException("orientation sensor is absent on this device"));
         }
     }
 
     @Override
     public void onStop() {
         if (orientationSensor != null) {
+            Log.d("OrientationProvider: stopping the orientation provider");
             sensorManager.unregisterListener(this);
         }
     }
 
     public static Observable<Float> create(final Context context) {
-        return Observable.create(new DirectionProvider(context));
+        return Observable.create(new OrientationProvider(context));
     }
 
 }

Rename DirectionProvider into OrientationProvider