Copying platform detection from joist's HomeScreen for refactoring