services: WindowOrientationListener: bail out if rotation resolver service instance is null

* this shouldn't be happening at all, so I'm just gonna add a null check here

* here's the stack trace

E SensorManager: Exception dispatching input event.
E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: android.ui
E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.rotationresolver.RotationResolverInternal.resolveRotation(android.rotationresolver.RotationResolverInternal$RotationResolverCallbackInternal, java.lang.String, int, int, long, android.os.CancellationSignal)' on a null object reference
E AndroidRuntime: 	at com.android.server.wm.WindowOrientationListener$OrientationSensorJudge.onSensorChanged(WindowOrientationListener.java:1193)
E AndroidRuntime: 	at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:886)
E AndroidRuntime: 	at android.os.MessageQueue.nativePollOnce(Native Method)
E AndroidRuntime: 	at android.os.MessageQueue.next(MessageQueue.java:335)
E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:161)
E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:67)
E AndroidRuntime: 	at com.android.server.ServiceThread.run(ServiceThread.java:44)
E AndroidRuntime: 	at com.android.server.UiThread.run(UiThread.java:45)

Change-Id: I5e6f9c4af8bb9fba2e9d85696958232878c7a815
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Ayan Mukherjee <mukherjeeayan725@gmail.com>
1 file changed