It is an issue many with older devices face: once the battery percentage hits the 15% or so, the device simply shuts down without any notice. What’s the reason for this problem? Battery aging. The process of battery aging isn’t inherently the cause, but as XDA Forum Member theGanymedes points out, it is the fact that your Desire thinks your battery is actually brand new. TheGanymedes puts it this way:
… your device thinks it has more capacity, when it’s actually empty (which occurs at 15-20% depending on the battery) and shutting down at weird percentages.
You’ve probably heard of ‘battery calibration’ before. It is a mod widely used for solving this exact problem. However, TheGanymedes points out that there are issues in the code of specific kernels that are the key to a properly calibrated battery. Fixing those issues would make an end to these 15% shutdowns. Luckily, the developer has come up with a patch and flashable zip that to do just that. These files and all (technical) details can be found in the development thread._________