What the software sees when the hall sensor is tripped is essentially a key press (on contact, e.g., cover closed) and a key lift (on lift, e.g., cover opened), so it's as "simple" as ignoring those.
(Note the quotes, because said events might actually wake the device up if alseep regardless of what userland does with it, so it requires further trickery to avoid false wakeups, but a sane implementation should be transparent to the user on that front... when it works (c.f., the varied history of battery issues with wonky covers

)).
Note that some/all (never had one with a cover myself) Kindles went the extra mile to cover (ha!) more of those potential cover issues by having *multiple* hall sensors, some calibrated for the front of the device, and some calibrated for the back.