The default layout should be set when language changes, which does not require users enter the keyboard panel. 
However, I was wondering is settings app the only place for setting the default layout? Is it possible to place the code in keyboard manager?