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

Change-Id: I3122226de3850a0a834e93444a66c20a726e580e