Skip to content

Commit

Permalink
meta-android: android-tools-conf: enable mtp
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Nizov <nizovn@gmail.com>
  • Loading branch information
nizovn authored and shr-project committed Aug 8, 2016
1 parent 7921c5c commit e6f2ad9
Showing 1 changed file with 14 additions and 2 deletions.
@@ -1,5 +1,17 @@
#!/bin/sh

if [ "$1" != "adb" ] && [ "$1" != "noadb" ]; then
exit 0
fi

functions="mtp"
if [ "$1" = "adb" ]; then
functions="$functions,adb"
fi

old_functions=`cat /sys/class/android_usb/android0/functions`
[ "$old_functions" != "$functions" ] || { exit 0; }

# TODO enable the lines below once we have support for getprop
# retrieve the product info from Android
# manufacturer=$(getprop ro.product.manufacturer Android)
Expand All @@ -18,8 +30,8 @@ echo $model > /sys/class/android_usb/android0/iProduct

echo "0" > /sys/class/android_usb/android0/enable
echo "18d1" > /sys/class/android_usbid_usb/android0/idVendor
echo "D002" > /sys/class/android_usb/android0/idProduct
echo "adb" > /sys/class/android_usb/android0/functions
echo "4EE2" > /sys/class/android_usb/android0/idProduct
echo "$functions" > /sys/class/android_usb/android0/functions
echo "1" > /sys/class/android_usb/android0/enable

sleep 4

0 comments on commit e6f2ad9

Please sign in to comment.