By gregoiregentil


2015-12-19 03:30:09 8 Comments

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.

3 comments

@abhinandanbr 2017-10-25 06:25:19

Through Developers Options it was possible in my phone. Just goto

 Developer option > USB configuration

By default its set to Charging. Change it to MTP. Try connecting USB, this should work.

@acejavelin 2017-10-25 11:14:49

Have you tried it? It doesn't work, we only wish it was that simple...

@Izzy 2017-10-25 14:06:51

This works exactly one time. As soon as you disconnect, it reverts back. Note OP didn't want to know how to connect via MTP – but how to make that the default whenever the USB cable is connected. Your suggested approach works until Android 5 (Lollipop), but no longer with Marshmallow (Android 6) which OP explicitly asked for.

@abhinandanbr 2017-10-25 19:02:57

Yaa. It does reset back.

@Bo Lawson 2015-12-20 06:06:35

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.

Adoptable storage

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 updateDisabledStateLocked() change mMtpDisabled to false.

MtpService.java

@trejder 2017-03-02 16:27:30

Though your answer clearly answers the question (that requested functionality is not possible to achieve) I still don't understand what is the relation between using external storage as internal storage and default mode for USB connection. What SD card has to do with USB port?

@gregoiregentil 2015-12-20 18:47:55

The best I found so far is an application named MTPEnabler: http://forum.xda-developers.com/android/apps-games/app-mtp-enbaler-t3263467

Related Questions

Sponsored Content

1 Answered Questions

MTP not working under Android 6

3 Answered Questions

[SOLVED] What are my options for connecting my Android to Ubuntu?

1 Answered Questions

[SOLVED] Charging during filetransfer

1 Answered Questions

Sponsored Content