Add no_slot_switch flag to update_device script

Test: treehugger
Change-Id: I996e8ece01d5a68e9093460f24c84031f8419c53
diff --git a/scripts/update_device.py b/scripts/update_device.py
index 756d443..757c147 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -403,6 +403,8 @@
                       help='Extra headers to pass to the device.')
   parser.add_argument('--secondary', action='store_true',
                       help='Update with the secondary payload in the package.')
+  parser.add_argument('--no-slot-switch', action='store_true',
+                      help='Do not perform slot switch after the update.')
   args = parser.parse_args()
   logging.basicConfig(
       level=logging.WARNING if args.no_verbose else logging.INFO)
@@ -420,6 +422,9 @@
   help_cmd = ['shell', 'su', '0', 'update_engine_client', '--help']
   use_omaha = 'omaha' in dut.adb_output(help_cmd)
 
+  if args.no_slot_switch:
+    args.extra_headers += "\nSWITCH_SLOT_ON_REBOOT=0"
+
   if args.file:
     # Update via pushing a file to /data.
     device_ota_file = os.path.join(OTA_PACKAGE_PATH, 'debug.zip')