This looks like offtopic, but probably would help to track the original problem. I would think of a hang/freeze problem in some kind of messaging subsystem inside the kernel, which would give unpredictable random hangs in visually different and absolutely non-connected parts of the system (firefox/keyboard switcher,MTP/ADB devices).
Even more funny, with kernel 3.17 Firefox stopped hanging the on the page I have linked above http:// www.howtogeek. com/196655/ how-to- configure- the-grub2- boot-loaders- settings/ (on kernels starting from 3.18-rc1 the whole application would hang after few seconds during loading this page).
This looks like offtopic, but probably would help to track the original problem. I would think of a hang/freeze problem in some kind of messaging subsystem inside the kernel, which would give unpredictable random hangs in visually different and absolutely non-connected parts of the system (firefox/keyboard switcher,MTP/ADB devices).