Fix for the crash on exit for older Samsung models

I committed this to master by mistake, this was reverted and placed onto this branch for review.
This if statement appears to be for running the unit tests on an actual device. As such, we would prefer this not to be commented out.