code: def handle_reboot(self):
          
          self.services.stop_all()
          try:
              yield
          finally:
              self.wait_for_boot_completion()
              if self.is_rootable:
                  self.root_adb()
          self.services.start_all()
docs: Properly manage the service life cycle when the device needs to
          temporarily disconnect.
  
          The device can temporarily lose adb connection due to user-triggered
          reboot. Use this function to make sure the services
          started by Mobly are properly stopped and restored afterwards.
  
          For sample usage, see self.reboot().