There is a setting (which you can change) to set at what percentage the phone should warn you of low battery, and at what percentage it should shut off. If the shut-off percentage is higher than the warning percentage, the phone will shut off before warning you.
However ... letting the battery discharge lower than 40% is asking for a quickly-dead battery. If the phone is set to shut off at 30%, you should never see it, because you should plug the charger in or shut the phone off (if you can't get to an outlet) at 40%.
The points at which you get the warning and the shutoff could change with an update, because they may be cached, and if the update changes the cache locations, the shutoff is being triggered by some value that was saved by some other part of the Android system before the update. Try restarting into recovery mode and wiping the cache (only the cache, not any other part of storage). That's usually not needed, but it was in old versions of Android, and some developers (someone at HTC had to rewrite the stock Google update to work on each HTC phone that gets it) may not realize that moving storage locations in the system messes things up. (You can be a very experienced developer and not know everything about Android.)
08-28-2017 12:57 PM