Simplify the cancel logic for input and display settings

Change-Id: I2afe78edad31b00a35d0589384e4091b61091275