2018-04-25 18:38:42 +00:00
|
|
|
{- Android stuff
|
|
|
|
-
|
|
|
|
- Copyright 2018 Joey Hess <id@joeyh.name>
|
|
|
|
-
|
|
|
|
- License: BSD-2-clause
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Utility.Android where
|
|
|
|
|
|
|
|
import Common
|
|
|
|
|
|
|
|
-- Detect when the Linux build is running on Android, eg in termux.
|
2018-04-25 20:57:57 +00:00
|
|
|
--
|
|
|
|
-- Note that this relies on termux's uname having been built with "Android"
|
|
|
|
-- as the os name. Often on Android, uname will report "Linux".
|
2018-04-25 18:38:42 +00:00
|
|
|
osAndroid :: IO Bool
|
2018-04-25 20:53:17 +00:00
|
|
|
osAndroid = ("Android" `isPrefixOf` ) <$> readProcess "uname" ["-o"]
|