5.38 emphasizing time and duration

If you want to emphasize the recentness and the duration of a continuous activity which took place before a particular time in the past, you use the past perfect continuous.