diff --git a/adbd.te b/adbd.te
index de0c981dddd0c186854a8b9eb520fbf959a67096..27ffdd845fac94dacb386adc5c002c6b6c6d6db6 100644
--- a/adbd.te
+++ b/adbd.te
@@ -100,3 +100,7 @@ allow adbd storage_file:dir r_dir_perms;
 allow adbd storage_file:lnk_file r_file_perms;
 allow adbd mnt_user_file:dir r_dir_perms;
 allow adbd mnt_user_file:lnk_file r_file_perms;
+
+# Access to /data/media.
+allow adbd media_rw_data_file:dir create_dir_perms;
+allow adbd media_rw_data_file:file create_file_perms;
diff --git a/shell.te b/shell.te
index d1c385b9462fba9e8ad97a900062a287c61e0b02..fc5c2768b2529c3a6597dbf0f00cef45dbee1352 100644
--- a/shell.te
+++ b/shell.te
@@ -122,6 +122,10 @@ allow shell sysfs:dir r_dir_perms;
 # Allow access to ion memory allocation device.
 allow shell ion_device:chr_file rw_file_perms;
 
+# Access to /data/media.
+allow shell media_rw_data_file:dir create_dir_perms;
+allow shell media_rw_data_file:file create_file_perms;
+
 ###
 ### Neverallow rules
 ###