Apple gets a patent to improve battery life by tracking everything