If you’re following Apple news closely, you may have heard rumblings that Apple is working on its own battery management chips. But in addition to hardware, Apple is also working on software meant to improve battery life on its devices. A new revelation indicates that Apple is looking to make battery management smarter in the near future, a move that could potentially have other beneficial side-effects, like preventing iPhones from exploding.

“Adaptive battery life extension” is the name of an Apple patent awarded to Apple on April 4th.

The documentation describes means through which an Apple device powered by a battery, such as the iPhone, iPad, or MacBook, could benefit from a smart power management system that would be able to interpret various battery parameters and then prolong battery life so that it lasts until the user is able to recharge said device.

Apple already offers means of extending battery life on an iPhone or iPad — the Low Power Mode — but that requires user interaction. The patent describes technology that would work behind the scenes to improve battery life on a device. Moreover, Apple says the adaptive battery life extension (ABLE) unit running within the operating system would constantly analyze battery life and actively adapt battery consumption to extend battery life.

Image Source: Apple via USPTO

“Users of battery powered devices generally prefer that the battery does not run out while they are using the device,” Apple says. “User level power management may try to extend the life of the battery by reducing power consumption at the cost of reduced performance as the battery approaches depletion. Most of the conventional systems perform such power management actions only when the battery is already very low. Sometimes this may amount to too little too late.”

To predict battery life consumption at any moment, the ABLE unit would keep track of the user’s behavior and the battery use and battery recharge history. The system would store information about the user’s past battery charge and discharge rates, and use it to determine whether the current discharge rate is within expected parameters and whether the battery will last until the next expected recharge cycle.

Image Source: Apple via USPTO

The ABLE unit would also instruct the system on whether certain energy intensive tasks should be allowed based on the battery levels and battery level predictions. Content download, video streaming, or system updates may be postponed to prevent a battery discharge.

On top of accessing battery status information, and relevant historical data, the software would also be able to interpret the user’s actions. Apple says that using a boarding pass to check into a flight on a plane would tell the iPhone that the user is about to enable flight mode. The ABLE unit would then try to make sure the iPhone lasts through the flight by reducing certain energy-intensive tasks, as it would also know how long the trip lasts.

If the user buys a drink in a coffee shop using Apple Pay, the iPhone would know that the user may want to read the news or play games on the device and improve performance even if that means battery life would take a hit. Similarly, the iPhone would be able to determine when the user is at work or when he or she is watching a movie, and adapt battery consumption accordingly.

Image Source: Apple via USPTO

All this would happen without bothering the user with notifications about battery life status and discharge rates. The system would optimize battery life without the user’s knowledge.

“Each user may have different behavior and pattern, by employing a user agent within the portable device, the user level power management system can ‘learn’ that particular user’s behavior and adapt to that particular user’s life style, even without the user knowledge,” Apple explains.

With enough information about what the user is doing, the system could also make sure the iPhone doesn’t overheat while in use. The obvious side effect here is that a smart battery monitoring software embedded in iOS and macOS could prevent battery-related explosions — the patent was filed in November 2015, well ahead of the Galaxy Note 7 fiasco, so this isn’t a response to Samsung’s battery problem.

Finally, the smart battery management tool can also be used to determine whether the device is coupled to a charger in good condition. The ABLE unit would determine whether the charger can be used to recharge the device while it’s in use, or whether it needs to throttle performance to accommodate charging.

It’s unclear when such a smart battery management system would be included in iOS and/or macOS, but it seems pretty clear that Apple is looking to safely improve battery life in its devices without increasing battery capacity. A recent patent revealed that Apple may want to keep tabs on what an iPhone user is doing to suggest automated tasks. If that’s indeed a feature of the next iPhone, it would be reasonable to assume that a smart battery management tool is also in the works, given the rather large metadata it needs to collect for it to work.