            managed_processes[p].stop()
  
      return wrap
    return wrapper
  
  
  def with_apks():
    def wrapper(func):
      @wraps(func)
      def wrap():
        update_apks()
        pm_apply_packages('enable')
        start_offroad()
  
        func()
  
        try:
          for package in android_packages:
            apk_is_running = (subprocess.call(["pidof", package]) == 0)
            assert apk_is_running, package
        finally:
          pm_apply_packages('disable')
          for package in android_packages:
            apk_is_not_running = (subprocess.call(["pidof", package]) == 1)
            assert apk_is_not_running, package
      return wrap
    return wrapper
 
</s> remove   if EON:
    pm_apply_packages('disable')

 </s> add  </s> remove 
 </s> add   set_params_enabled() </s> remove   AudibleAlert.chimeEngage: 85,
  AudibleAlert.chimeDisengage: 85,
  AudibleAlert.chimeError: 85,
  AudibleAlert.chimePrompt: 85,
  AudibleAlert.chimeWarning1: 80,
  AudibleAlert.chimeWarning2: 107,
  AudibleAlert.chimeWarning2Repeat: 177,
  AudibleAlert.chimeWarningRepeat: 240,
 </s> add   AudibleAlert.chimeEngage: 173,
  AudibleAlert.chimeDisengage: 173,
  AudibleAlert.chimeError: 173,
  AudibleAlert.chimePrompt: 173,
  AudibleAlert.chimeWarning1: 163,
  AudibleAlert.chimeWarning2: 216,
  AudibleAlert.chimeWarning2Repeat: 346,
  AudibleAlert.chimeWarningRepeat: 468, </s> remove if arch == 'aarch64' and "QT" not in os.environ:
  libs += ['EGL', 'GLESv3', 'gnustl_shared', 'hardware', 'OpenSLES', 'cutils', 'uuid']
  linkflags = ['-Wl,-rpath=/system/lib64,-rpath=/system/comma/usr/lib']

  src += ["android/ui.cc", "android/sl_sound.cc"]
  env.Program('_ui', src,
    LINKFLAGS=linkflags,
    LIBS=libs)
else:
  qt_base_libs = qt_env["LIBS"] + libs + ["pthread"]
  if arch == "Darwin":
    del qt_base_libs[qt_base_libs.index('OpenCL')]
    qt_env['FRAMEWORKS'] += ['OpenCL']

  widgets_src = ["qt/widgets/input.cc", "qt/widgets/drive_stats.cc",
                 "qt/widgets/ssh_keys.cc", "qt/widgets/toggle.cc", "qt/widgets/controls.cc", "qt/qt_sound.cc",
                 "qt/widgets/offroad_alerts.cc", "qt/widgets/setup.cc", "qt/widgets/keyboard.cc",
                 "#phonelibs/qrcode/QrCode.cc"]

  if arch != 'aarch64':
    widgets_src += ["qt/offroad/networking.cc", "qt/offroad/wifiManager.cc"]

  widgets = qt_env.Library("qt_widgets", widgets_src, LIBS=qt_base_libs)
  qt_libs = qt_base_libs + [widgets]

  qt_src = ["qt/ui.cc", "qt/window.cc", "qt/home.cc", "qt/api.cc", "qt/offroad/settings.cc",
            "qt/offroad/onboarding.cc"] + src
  qt_env.Program("_ui", qt_src, LIBS=qt_libs)

  # spinner and text window
  qt_env.Program("qt/text", ["qt/text.cc"], LIBS=qt_base_libs)
  qt_env.Program("qt/spinner", ["qt/spinner.cc"], LIBS=qt_base_libs)

  # build setup, factory resetter, and installer
  if "BUILD_SETUP" in os.environ:
    qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs)
    qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc"], LIBS=qt_libs + ['curl', 'common', 'json11'])
    qt_env.Program("qt/setup/wifi", ["qt/setup/wifi.cc"], LIBS=qt_libs + ['common', 'json11'])

    installers = [
      ("openpilot", "master"),
      #("openpilot_test", "release3-staging"),
      #("openpilot_internal", "master"),
      #("dashcam", "dashcam3-staging"),
      #("dashcam_test", "dashcam3-staging"),
    ]
    for name, branch in installers:
      d = {'BRANCH': f"'\"{branch}\"'"}
      if "internal" in name:
        d['INTERNAL'] = "1"

        import requests
        r = requests.get("https://github.com/commaci2.keys")
        r.raise_for_status()
        d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"'
      qt_env.Program(f"qt/setup/installer_{name}", ["qt/setup/installer.cc"], LIBS=qt_libs, CPPDEFINES=d)
 </s> add qt_base_libs = qt_env["LIBS"] + libs + ["pthread"]
if arch == "Darwin":
  del qt_base_libs[qt_base_libs.index('OpenCL')]
  qt_env['FRAMEWORKS'] += ['OpenCL']

widgets_src = ["qt/widgets/input.cc", "qt/widgets/drive_stats.cc",
               "qt/widgets/ssh_keys.cc", "qt/widgets/toggle.cc", "qt/widgets/controls.cc", "qt/qt_sound.cc",
               "qt/widgets/offroad_alerts.cc", "qt/widgets/setup.cc", "qt/widgets/keyboard.cc",
               "#phonelibs/qrcode/QrCode.cc"]
if arch != 'aarch64':
  widgets_src += ["qt/offroad/networking.cc", "qt/offroad/wifiManager.cc"]

widgets = qt_env.Library("qt_widgets", widgets_src, LIBS=qt_base_libs)
qt_libs = qt_base_libs + [widgets]

# spinner and text window
qt_env.Program("qt/text", ["qt/text.cc"], LIBS=qt_base_libs)
qt_env.Program("qt/spinner", ["qt/spinner.cc"], LIBS=qt_base_libs)

# build main UI
qt_src = ["qt/ui.cc", "qt/window.cc", "qt/home.cc", "qt/api.cc", "qt/offroad/settings.cc",
          "qt/offroad/onboarding.cc"] + src
qt_env.Program("_ui", qt_src, LIBS=qt_libs)

# setup, factory resetter, and installer
if arch != 'aarch64' and "BUILD_SETUP" in os.environ:
  qt_env.Program("qt/setup/reset", ["qt/setup/reset.cc"], LIBS=qt_libs)
  qt_env.Program("qt/setup/setup", ["qt/setup/setup.cc"], LIBS=qt_libs + ['curl', 'common', 'json11'])
  qt_env.Program("qt/setup/wifi", ["qt/setup/wifi.cc"], LIBS=qt_libs + ['common', 'json11'])

  installers = [
    ("openpilot", "master"),
    #("openpilot_test", "release3-staging"),
    #("openpilot_internal", "master"),
    #("dashcam", "dashcam3-staging"),
    #("dashcam_test", "dashcam3-staging"),
  ]
  for name, branch in installers:
    d = {'BRANCH': f"'\"{branch}\"'"}
    if "internal" in name:
      d['INTERNAL'] = "1"

      import requests
      r = requests.get("https://github.com/commaci2.keys")
      r.raise_for_status()
      d['SSH_KEYS'] = f'\\"{r.text.strip()}\\"'
    qt_env.Program(f"qt/setup/installer_{name}", ["qt/setup/installer.cc"], LIBS=qt_libs, CPPDEFINES=d)
            managed_processes[p].stop()
  
      return wrap
    return wrapper























keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 APK purge (#20446)

* purge begins

* release files

* remove those

* no more android

* only qt

* text and spinner

* neos update script

* update sounds

* update cpu usage

* all done

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/test/helpers.py