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

Change-Id: Ibae342909bc93ddeb7366a0da35f04938dd8846b