Merge "Add API to get remaining lifetime as a percentage." into main