MOSES: supporting operation modes on smartphones