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

Change-Id: If2d271322d717b2fc530dcc11d7b341d886f1212