I would like to have MTP selected by default (instead of charging) when I plug an Android 6.0.x device to a PC through a USB cable. What should I add or modify in the build.prop file of my rooted device to make this happen? I know that it's not possible to do that without root access but the device is rooted.
Google changed the USB protocol for Marshmallow to always default to charge.
The reason for this change because they brought back the ability to make external storage (SD card) become internal storage. Creating a new storage type called "Adoptable Storage".
Originally google removed the ability to swap storages because they viewed it as a huge security vulnerability.
In order to achieve your end goal it looks like you might have to compile marshmallow from source. Find the
MtpService.java and then with
The best I found so far is an application named MTPEnabler: http://forum.xda-developers.com/android/apps-games/app-mtp-enbaler-t3263467
Through Developers Options it was possible in my phone. Just goto
Developer option > USB configuration
By default its set to
Change it to
MTP. Try connecting USB, this should work.