#They retain (at a hardware level) the ability to detecting tilting, but they can no longer detect tilt.
Regarding how gyros/accels work in phones, you can easily google the APIs for these on the two platforms. Example,
https://developer.apple.com/library/content/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GettingRotationalInformationfromtheGyroscopes.html
#Accels/gyros, in fact wrapped together at the OS level:
https://developer.apple.com/reference/coremotion/cmmotionmanager
in practice, for any fairly newly-written app (remembering that, let's say, about 25% of apps in the store are decayed / not updated regularly), it would come down to how the team at Apple which wrote (in their case) "Coremotion" handled (if at all!) the zero gravity environment case. (There's a similar situation for droid.)
Today almost any game you pick up and play on a phone was created in Unity3D, rather than as a native app. (And as a rule, if you look at the set of "apps which use the accel/gyros", 90% (more?) of them are just games.) So in fact (on all platforms) the software-writers are actually using's Unity's level of software wrappers.
(To wit, https://docs.unity3d.com/ScriptReference/Gyroscope.html etc)
#One confusing point...
that hasn't been clarified. When you're writing software for phones, it's totally commonplace to have to deal with "zero gravity" ... for short periods of time: that is, when the phone is in free-fall. (So if you're making one of the (100s of) apps for skateboarders, skiers or the like which measures hang-time and so on, you deal with this as a matter of course.)
http://www.livescience.com/40103-accelerometer-vs-gyroscope.html
By the way, gyros were introduced to phones about 2010; accels were in them from the start.
You can literally buy MEMS gyros or accels somewhere like this,
buy yourself a few thousand MEMS chips
if for example you are making an electronic toy that includes such a feature.
Regarding literally how MEMS accelerometers actually work at a substrate level, google things like http://www.instrumentationtoday.com/mems-accelerometer/2011/08/
Regarding MEMS gyros, http://electroiq.com/blog/2010/11/introduction-to-mems-gyroscopes/
A - it would, almost certainly, "totally fail!" in the whacky "you're in orbit" case. Since no gane or app engineer (I know) would be so OCD as to cover that case, but don't forget...
B - it's totally commonplace to have "zero gravity" .. during short periods of freefall (this applies as a commonplace matter if you're making one of those "action sports apps").