[ATFT] Add option to skip rebooting after fusing vboot key.

For some SoC 'oem fuse at-bootloader-vbootkey' would trigger a
reboot, in this case, another reboot is not necessary after this
command. In order to save overal time in the flow, we now add option
to skip rebooting after fusing vboot key. To configure this, set
'SKIP_REBOOT' to True in the configuration file.

Tests: Manual test on test target device that would reboot after
fusing command.
Bug: 122065121
diff --git a/at-factory-tool/atft.py b/at-factory-tool/atft.py
index bd541ff..e0fc098 100644
--- a/at-factory-tool/atft.py
+++ b/at-factory-tool/atft.py
@@ -1866,6 +1866,14 @@
       if 'KEY_DIR' in configs:
         self.key_dir = configs['KEY_DIR']
 
+      # For some SoC, a reboot is not required after locking down bootloader
+      # since it will reboot itself. 'SKIP_REBOOT' should be configured to True
+      # for this case.
+      if 'SKIP_REBOOT' in configs:
+        self.skip_reboot = configs['SKIP_REBOOT']
+      else:
+        self.skip_reboot = False
+
       device_usb_locations_initialized = False
       for i in range(TARGET_DEV_SIZE):
         if self.device_usb_locations[i]:
@@ -4118,7 +4126,7 @@
         self.listing_device_lock.acquire()
         self.atft_manager.Reboot(
             target, self.reboot_timeout, LambdaSuccessCallback,
-            LambdaTimeoutCallback)
+            LambdaTimeoutCallback, self.skip_reboot)
       finally:
         self.listing_device_lock.release()
     except ProductNotSpecifiedException as e:
diff --git a/at-factory-tool/atftman.py b/at-factory-tool/atftman.py
index be78f8c..d2d526f 100644
--- a/at-factory-tool/atftman.py
+++ b/at-factory-tool/atftman.py
@@ -1010,7 +1010,8 @@
       target.provision_status = ProvisionStatus.UNLOCKAVB_FAILED
       raise e
 
-  def Reboot(self, target, timeout, success_callback, timeout_callback):
+  def Reboot(self, target, timeout, success_callback, timeout_callback,
+             skip_reboot=False):
     """Reboot the target device.
 
     Args:
@@ -1020,6 +1021,9 @@
         successfully.
       timeout_callback: The callback function called when the device reboots
         timeout.
+      skip_reboot: Whether to skip reboot and only register the device as a
+        rebooting device. This is applicable if the device is already rebooting
+        and we want to register the callbacks.
     Raises:
       FastbootFailure: When fastboot command fails.
 
@@ -1028,7 +1032,8 @@
     otherwise call the timeout_callback.
     """
     try:
-      target.Reboot()
+      if not skip_reboot:
+        target.Reboot()
       serial = target.serial_number
       location = target.location
       # We assume after the reboot the device would disappear