am 8a06c077: Allow system_server to collect app heapdumps (debug builds only)

* commit '8a06c07724ad538d6c2f1d703fec88929c118894':
  Allow system_server to collect app heapdumps (debug builds only)
This commit is contained in:
Nick Kralevich 2015-04-08 00:43:31 +00:00 committed by Android Git Automerger
commit 63b0790965
4 changed files with 15 additions and 0 deletions

8
app.te
View file

@ -90,6 +90,14 @@ allow appdomain dumpstate:fd use;
allow appdomain dumpstate:unix_stream_socket { read write getopt getattr shutdown };
allow appdomain shell_data_file:file { write getattr };
# Send heap dumps to system_server via an already open file descriptor
# % adb shell am set-watch-heap com.android.systemui 1048576
# % adb shell dumpsys procstats --start-testing
# debuggable builds only.
userdebug_or_eng(`
allow appdomain heapdump_data_file:file append;
')
# Write to /proc/net/xt_qtaguid/ctrl file.
allow appdomain qtaguid_proc:file rw_file_perms;
# Everybody can read the xt_qtaguid resource tracking misc dev.

View file

@ -82,6 +82,8 @@ type gps_data_file, file_type, data_file_type;
type property_data_file, file_type, data_file_type;
# /data/bootchart
type bootchart_data_file, file_type, data_file_type;
# /data/system/heapdump
type heapdump_data_file, file_type, data_file_type, mlstrustedobject;
# Mount locations managed by vold
type mnt_media_rw_file, file_type;

View file

@ -243,6 +243,7 @@
/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0
/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0
/data/misc/vold(/.*)? u:object_r:vold_data_file:s0
/data/system/heapdump(/.*)? u:object_r:heapdump_data_file:s0
# Bootchart data
/data/bootchart(/.*)? u:object_r:bootchart_data_file:s0

View file

@ -202,6 +202,10 @@ allow system_server backup_data_file:file create_file_perms;
allow system_server dalvikcache_profiles_data_file:dir rw_dir_perms;
allow system_server dalvikcache_profiles_data_file:file create_file_perms;
# Write to /data/system/heapdump
allow system_server heapdump_data_file:dir rw_dir_perms;
allow system_server heapdump_data_file:file create_file_perms;
# Manage /data/misc/adb.
allow system_server adb_keys_file:dir create_dir_perms;
allow system_server adb_keys_file:file create_file_perms;