When USB is plugged into the phone, there is a Dialog Window coming out,
Here are the debugging infos as below,
130|[email protected]:/ # logcat | grep -i MtpService
D/MtpService( 2580): updating state; isCurrentUser=true, mMtpLocked=false
D/MtpService( 2580): addStorageLocked 65537 /storage/emulated/0
E/AndroidRuntime( 2580): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2580): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
W/ActivityManager( 2327): Scheduling restart of crashed service com.android.providers.media/.MtpService in 601944ms
I/ActivityManager( 2327): Start proc android.process.media for service com.android.providers.media/.MtpService: pid=2995 uid=10014 gids={50014, 1015, 1023, 1024, 1028, 2001, 3003, 3007}
D/MtpService( 2995): updating state; isCurrentUser=true, mMtpLocked=false
D/MtpService( 2995): addStorageLocked 65537 /storage/emulated/0
E/AndroidRuntime( 2995): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2995): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
W/ActivityManager( 2327): Timeout executing service: ServiceRecord{41e695d8 u0 com.android.providers.media/.MtpService}
I/ActivityManager( 2327): Crashing app skipping ANR: ProcessRecord{41dac510 2995:android.process.media/u0a10014} Executing service com.android.providers.media/.MtpService
W/ActivityManager( 2327): Service crashed 2 times, stopping: ServiceRecord{41e695d8 u0 com.android.providers.media/.MtpService}
^C
130|[email protected]:/ #
130|[email protected]:/ #
130|[email protected]:/ # logcat | grep AndroidRuntime
D/AndroidRuntime( 2580): Shutting down VM
E/AndroidRuntime( 2580): FATAL EXCEPTION: main
E/AndroidRuntime( 2580): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2580): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2587)
E/AndroidRuntime( 2580): at android.app.ActivityThread.access$1600(ActivityThread.java:141)
E/AndroidRuntime( 2580): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1338)
E/AndroidRuntime( 2580): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2580): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2580): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 2580): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2580): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 2580): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 2580): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 2580): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2580): Caused by: java.lang.IllegalArgumentException
E/AndroidRuntime( 2580): at android.os.Parcel.readException(Parcel.java:1435)
E/AndroidRuntime( 2580): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime( 2580): at android.os.storage.IMountService$Stub$Proxy.getVolumeState(IMountService.java:241)
E/AndroidRuntime( 2580): at android.os.storage.StorageManager.getVolumeState(StorageManager.java:558)
E/AndroidRuntime( 2580): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
E/AndroidRuntime( 2580): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2577)
E/AndroidRuntime( 2580): ... 10 more
D/AndroidRuntime( 2995): Shutting down VM
E/AndroidRuntime( 2995): FATAL EXCEPTION: main
E/AndroidRuntime( 2995): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2995): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2587)
E/AndroidRuntime( 2995): at android.app.ActivityThread.access$1600(ActivityThread.java:141)
E/AndroidRuntime( 2995): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1338)
E/AndroidRuntime( 2995): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2995): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2995): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 2995): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2995): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 2995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 2995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 2995): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2995): Caused by: java.lang.IllegalArgumentException
E/AndroidRuntime( 2995): at android.os.Parcel.readException(Parcel.java:1435)
E/AndroidRuntime( 2995): at android.os.Parcel.readException(Parcel.java:1385)
E/AndroidRuntime( 2995): at android.os.storage.IMountService$Stub$Proxy.getVolumeState(IMountService.java:241)
E/AndroidRuntime( 2995): at android.os.storage.StorageManager.getVolumeState(StorageManager.java:558)
E/AndroidRuntime( 2995): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
E/AndroidRuntime( 2995): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2577)
E/AndroidRuntime( 2995): ... 10 more
^C
130|[email protected]:/ # logcat | grep -i mtp
D/MountService( 2327): got storage path: null description: Internal storage primary: true removable: false emulated: true mtpReserve: 100 allowMassStorage: false maxFileSize: 0
D/MountService( 2327): addVolumeLocked() StorageVolume [mStorageId=65537 mPath=/storage/emulated/0 mDescriptionId=17040655 mPrimary=true mRemovable=false mEmulated=true mMtpReserveSpace=100 mAllowMassStorage=false mMaxFileSize=0 mOwner=UserHandle{0}]
D/MountService( 2327): got storage path: /mnt/extsd description: SD card primary: false removable: true emulated: false mtpReserve: 0 allowMassStorage: false maxFileSize: 0
D/MountService( 2327): addVolumeLocked() StorageVolume [mStorageId=0 mPath=/mnt/extsd mDescriptionId=17040656 mPrimary=false mRemovable=true mEmulated=false mMtpReserveSpace=0 mAllowMassStorage=false mMaxFileSize=0 mOwner=null]
D/MountService( 2327): got storage path: /mnt/udisk description: USB storage primary: false removable: true emulated: false mtpReserve: 0 allowMassStorage: false maxFileSize: 0
D/MountService( 2327): addVolumeLocked() StorageVolume [mStorageId=0 mPath=/mnt/udisk mDescriptionId=17040657 mPrimary=false mRemovable=true mEmulated=false mMtpReserveSpace=0 mAllowMassStorage=false mMaxFileSize=0 mOwner=null]
I/ActivityManager( 2327): Start proc android.process.media for broadcast com.android.providers.media/.MtpReceiver: pid=2580 uid=10014 gids={50014, 1015, 1023, 1024, 1028, 2001, 3003, 3007}
D/MtpService( 2580): updating state; isCurrentUser=true, mMtpLocked=false
D/MtpService( 2580): addStorageLocked 65537 /storage/emulated/0
E/AndroidRuntime( 2580): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2580): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
W/BroadcastQueue( 2327): Receiver during timeout: ResolveInfo{41d07b70 com.android.providers.media.MtpReceiver p=0 o=0 m=0x108000}
I/ActivityManager( 2327): Crashing app skipping ANR: ProcessRecord{41cbd0c8 2580:android.process.media/u0a10014} Broadcast of Intent { act=android.intent.action.BOOT_COMPLETED flg=0x10 cmp=com.android.providers.media/.MtpReceiver (has extras) }
W/ActivityManager( 2327): Scheduling restart of crashed service com.android.providers.media/.MtpService in 601944ms
I/ActivityManager( 2327): Start proc android.process.media for service com.android.providers.media/.MtpService: pid=2995 uid=10014 gids={50014, 1015, 1023, 1024, 1028, 2001, 3003, 3007}
D/MtpService( 2995): updating state; isCurrentUser=true, mMtpLocked=false
D/MtpService( 2995): addStorageLocked 65537 /storage/emulated/0
E/AndroidRuntime( 2995): java.lang.RuntimeException: Unable to create service com.android.providers.media.MtpService: java.lang.IllegalArgumentException
E/AndroidRuntime( 2995): at com.android.providers.media.MtpService.onCreate(MtpService.java:134)
W/ActivityManager( 2327): Timeout executing service: ServiceRecord{41e695d8 u0 com.android.providers.media/.MtpService}
I/ActivityManager( 2327): Crashing app skipping ANR: ProcessRecord{41dac510 2995:android.process.media/u0a10014} Executing service com.android.providers.media/.MtpService
W/ActivityManager( 2327): Service crashed 2 times, stopping: ServiceRecord{41e695d8 u0 com.android.providers.media/.MtpService}
^C
130|[email protected]:/ # logcat | grep -i MtpDatabase
^C
130|[email protected]:/ # logcat | grep -i getVolumeState
W/MountService( 2327): getVolumeState(/mnt/extsd): Unknown volume
E/AndroidRuntime( 2580): at android.os.storage.IMountService$Stub$Proxy.getVolumeState(IMountService.java:241)
E/AndroidRuntime( 2580): at android.os.storage.StorageManager.getVolumeState(StorageManager.java:558)
W/MountService( 2327): getVolumeState(/mnt/extsd): Unknown volume
E/AndroidRuntime( 2995): at android.os.storage.IMountService$Stub$Proxy.getVolumeState(IMountService.java:241)
E/AndroidRuntime( 2995): at android.os.storage.StorageManager.getVolumeState(StorageManager.java:558)
For this kind of errors, here comes the solution on my side,
In fstab.freescale,
/devices/platform/sdhci-esdhc-imx.0/mmc_host/mmc0 /mnt/extsd vfat defaults voldmanaged=sdcard:auto
/devices/platform/fsl-ehci.0 /mnt/udisk vfat defaults voldmanaged=sdcard:auto
In ueventd.freescale.rc,
/sys/devices/platform/sdhci-esdhc-imx.0/mmc_host/mmc0/mmc0:000* boot_bus_config 0660 root root
/sys/devices/platform/sdhci-esdhc-imx.0/mmc_host/mmc0/mmc0:000* boot_config 0660 root root
/sys/devices/platform/sdhci-esdhc-imx.2/mmc_host/mmc2/mmc2:000* boot_bus_config 0660 root root
/sys/devices/platform/sdhci-esdhc-imx.2/mmc_host/mmc2/mmc2:000* boot_config 0660 root root