Merge "Stops the loop when all files are closed." am: d8d7fc6717 am: 920b02906f
am: ac982d2644

Change-Id: I2701ed231c58f2adeebfba3c6302586432f19a59