Add no_slot_switch flag to update_device script am: 8212f53f9d am: ce2345dd4a am: 2ef8b5e529 am: d929a1ce59

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1498858

Change-Id: Ia6623d8035f31b56dbebc48d219e1c61125b00a9
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')