Merge "use more correct case condition when consume input" am: 050861f957 am: d0198af634
am: ff99040d10

Change-Id: I4e6c5ffe50057e51d47e29818c120d23fc59b890