def METHOD_NAME():
  """Stop application and cleanup state."""
  package_name = get_package_name()
  if not package_name:
    return
  # Device can get silently restarted in case of OOM. So, we would need to
  # restart our shell as root in order to kill the application.
  adb.run_as_root()
  adb.kill_processes_and_children_matching_name(package_name)
  # Chrome specific cleanup.
  if package_name.endswith('.chrome'):
    cache_dirs_absolute_paths = [
        '/data/data/%s/%s' % (package_name, i) for i in CHROME_CACHE_DIRS
    ]
    save_crash_minidumps(package_name)
    adb.run_shell_command(
        ['rm', '-rf', ' '.join(cache_dirs_absolute_paths)], root=True)