Revert "Revert "Merge pull request #20353 from timdream/input-switch-flash""

This reverts commit 6ba0bc68738f70edc42d496cfede5ea09af334d4.