Support N on setup_adb.

In N, init.usb.rc in Android is updated, so that persist.sys.usb.config
is propagated to sys.usb.config only on booting.
It causes for adbd not to be started.

This CL manually propagates the value so that adbd is started
as expected.

BUG=b:34334175
TEST=Manually ran on N test device, and adbd is started.

Change-Id: I64d4b5593200b16297222614efb4766d1ae75e90
Reviewed-on: https://chromium-review.googlesource.com/428597
Commit-Ready: Hidehiko Abe <hidehiko@chromium.org>
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Arthur Hsu <arthurhsu@google.com>
diff --git a/contrib/setup_adb b/contrib/setup_adb
index bc5710b..e3f9c0a 100755
--- a/contrib/setup_adb
+++ b/contrib/setup_adb
@@ -72,4 +72,13 @@
 ssh_exec "android-sh -c 'restorecon /data/misc/adb/adb_keys'"
 ssh_exec "android-sh -c 'setprop persist.sys.usb.config mtp,adb'"
 
+SDK_VERSION=`ssh_exec "android-sh -c 'getprop ro.build.version.sdk'"`
+# 25: Android N SDK version.
+if [ "${SDK_VERSION}" -ge 25 ]; then
+  # In N or later, init.usb.rc is updated so that persist.sys.usb.config
+  # is propagated to sys.usb.config only on booting.
+  # So, here manually propagate it so that adbd is triggered to start.
+  ssh_exec "android-sh -c 'setprop sys.usb.config mtp,adb'"
+fi
+
 echo "INFO: ADB set up complete."