Enabling MTP as default

gekkehenkie11

Inactive Recognized Developer
Dec 9, 2010
2,767
5,582
0
So as Google made this very weird decision that you can't save the usb connection options, I wanted to change this to how it was on Lollipop (MTP enabled as default). So what happens here is that "MtpService.java" is responsible for doing this. If you want to simply enable MTP as default, look at the updateDisabledStateLocked() function and simply set mMtpDisabled to false in that function !

Of couse it would probably be even nicer to just really have the menu in the developer options save the settings and use that, but that would be a bit more work. Anyway, just thought I'd share it here for you guys to enjoy !
 

fury683

Senior Member
Dec 20, 2010
1,019
283
103
MSP
Yes but it doesnt stick: disconnect your phone, reconnect and MTP will be disabled again (unless you use my patch above).
I remember when I first flashed my 6p, I had to set my mode to PTP to get my PC to recognize. I remember setting it to always use PTP but it never stuck. Didn't bother me too much, so I probably won't use your method to stick it.
 

gekkehenkie11

Inactive Recognized Developer
Dec 9, 2010
2,767
5,582
0
I remember when I first flashed my 6p, I had to set my mode to PTP to get my PC to recognize. I remember setting it to always use PTP but it never stuck. Didn't bother me too much, so I probably won't use your method to stick it.
Sure thing mate. This is only for people who are bothered a lot by it, like me ;) BTW I realize not everybody can compile a ROM. So if there's any interest, let me know and I'll see if I can just post a flashable zip.
 
  • Like
Reactions: fury683

tech_head

Senior Member
Nov 22, 2007
3,725
1,225
243
California
My issue is different i want to be able to force the charge option. I have a DAC and there are no USB-C to micro adapters that support USB-OTG

Sent from my Nexus 6P using Tapatalk
 

hutzdani

Senior Member
May 9, 2010
1,222
357
103
London
My issue is different i want to be able to force the charge option. I have a DAC and there are no USB-C to micro adapters that support USB-OTG

Sent from my Nexus 6P using Tapatalk

You can ignore USB media when plugged into like a DAC or Car Headunit.

Settings > Dev Settings -> Media : Disable USB audio routing