# SEpolicy for com.android.ramdump
type ramdump_app, domain;

userdebug_or_eng(`
  app_domain(ramdump_app)

  # For using Firebase Cloud Firestore
  net_domain(ramdump_app)

  allow ramdump_app app_api_service:service_manager find;

  # For Firebase Analytics
  allow ramdump_app privapp_data_file:file x_file_perms;
  allow ramdump_app privapp_data_file:lnk_file r_file_perms;

  allow ramdump_app ramdump_vendor_data_file:file create_file_perms;
  allow ramdump_app ramdump_vendor_data_file:dir create_dir_perms;

  set_prop(ramdump_app, vendor_ramdump_prop)
  get_prop(ramdump_app, system_boot_reason_prop)

  # To access ramdumpfs.
  allow ramdump_app mnt_vendor_file:dir search;
  allow ramdump_app ramdump_vendor_mnt_file:dir create_dir_perms;
  allow ramdump_app ramdump_vendor_mnt_file:file create_file_perms;

  # To access subsystem ramdump files and dirs.
  allow ramdump_app sscoredump_vendor_data_crashinfo_file:dir r_dir_perms;
  allow ramdump_app sscoredump_vendor_data_crashinfo_file:file r_file_perms;
  allow ramdump_app sscoredump_vendor_data_coredump_file:dir r_dir_perms;
  allow ramdump_app sscoredump_vendor_data_coredump_file:file r_file_perms;
  allow ramdump_app sscoredump_vendor_data_logcat_file:dir r_dir_perms;
  allow ramdump_app sscoredump_vendor_data_logcat_file:file r_file_perms;
')
