How does a smart phone measure battery percentage?