This paper introduces a joint charge and thermal management problem for batteries in a battery-supercapacitor hybrid power source of a portable system, which has been equipped with a forced convection cooling technique, such as a fan. A key consideration in such a system is that the battery aging depends strongly on the battery temperature, which is in turn a function of the workload running on the device and the control policy for the fan. More precisely, this paper presents a hierarchical algorithm for maximizing the battery lifespan under given workload conditions. The algorithm relies on a combination of reinforcement learning and dynamic programming techniques. Simulation results show that the proposed algorithm achieves up to 2x improvements in battery lifespan, resulting in completion of up to 80% additional workload before the battery expires.