Merge "Reduce unnecessary calculation from input device change" into main