How to set MTP file transfer mode as default on Android 6.0 Marshmallow (root req'd)
The latest Android 6.0 Marshmallow edition brings with it many great new features like the battery-preserving Doze mode, or choosing default apps yourself, instead of being stuck on stock. Marshmallow comes with a few persistent glitches or "security" features, though, and those are slowly emerging as common user complaints on forums and in Google's support pages.
One of these issues is the MTP (Media Transfer Protocol) connection option. It lets you copy any file back and forth between your phone and computer, but is not set as default on Marshmallow. Thus, when you plug an Android 6.0-laden handset in the USB port of your computer, it will start charging, as that Charge mode is the one set as default.
Unfortunately, there is no way to permanently set the default connection mode on Marshmallow as MTP, so you have to go to the notification bar and change the connection type manually each time you want to transfer something from your phone via cable. Fret not, though, as there is already a way around that drama, as long as you have a rooted handset:
1. Download and install the MTP enabler file on your phone;
2. On first run, the app will ask you to choose between a manual MTP switch ("Ask me for action" option) and an automatic one;
3. If you want MTP to be the default connection mode and be chosen automatically, leave the "Ask me for action" option upon initial setup unchecked. The phone will then try and initialize an MTP connection each time you plug it into a USB port;
4. Alternatively, you can place the app's small widget on your homescreen, and tap it once before you connect your phone to go into MTP mode.
source: tomas1pit (XDA-Devs)
Things that are NOT allowed: