Revert Build.getSerial to Build.SERIAL in MtpService
For some reason (perhaps because of sharedUid) the privileged app
MdiaProvider is sometimes not granted READ_PHONE_STATE permission
despite this being requested in its AndroidManifest.xml. As a result,
Build.getSerial() sometimes fails in MediaProvider leading to a crash
of com.android.media process when MTP mode is enabled.
This commit switches back from Build.getSerial to Build.SERIAL which
for now does not require any permissions.
Test: Enable MTP mode, check that there's no crash and mtp-detect returns serial number
Bug: 33700679
Change-Id: I4def622c5b24e04912aab58e772607b3c836299e
2 files changed