Add --legacy for easy of testing
am: 5bbb123cd1

Change-Id: Id84e31765d199c017dc1e85436b01222283ab67f