Create surfaceflinger_prop and migrate props

This is a subtask of removing exported*_prop.

Bug: 152468529
Test: m && boot crosshatch
Change-Id: I9d6ec7ade96a3a53288f23d155cc829c2107bb6f
diff --git a/private/compat/26.0/26.0.ignore.cil b/private/compat/26.0/26.0.ignore.cil
index 1773687..fde89f7 100644
--- a/private/compat/26.0/26.0.ignore.cil
+++ b/private/compat/26.0/26.0.ignore.cil
@@ -161,6 +161,7 @@
     statscompanion_service
     storaged_data_file
     super_block_device
+    surfaceflinger_prop
     sysfs_fs_ext4_features
     system_boot_reason_prop
     system_bootstrap_lib_file
diff --git a/private/compat/27.0/27.0.ignore.cil b/private/compat/27.0/27.0.ignore.cil
index 14fb491..18564c3 100644
--- a/private/compat/27.0/27.0.ignore.cil
+++ b/private/compat/27.0/27.0.ignore.cil
@@ -147,6 +147,7 @@
     statsdw_socket
     storaged_data_file
     super_block_device
+    surfaceflinger_prop
     staging_data_file
     system_boot_reason_prop
     system_bootstrap_lib_file
diff --git a/private/compat/29.0/29.0.cil b/private/compat/29.0/29.0.cil
index 6bad7fc..6d9a6d9 100644
--- a/private/compat/29.0/29.0.cil
+++ b/private/compat/29.0/29.0.cil
@@ -1209,6 +1209,7 @@
 (typeattributeset exported_dalvik_prop_29_0 (exported_dalvik_prop))
 (typeattributeset exported_default_prop_29_0
   ( exported_default_prop
+    surfaceflinger_prop
     vndk_prop))
 (typeattributeset exported_dumpstate_prop_29_0 (exported_dumpstate_prop))
 (typeattributeset exported_ffs_prop_29_0 (exported_ffs_prop))
diff --git a/private/property_contexts b/private/property_contexts
index cd6a4b0..c488e9f 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -779,39 +779,39 @@
 sys.shutdown.requested u:object_r:exported_system_prop:s0 exact string
 
 # Using Sysprop as API. So the ro.surface_flinger.* are guaranteed to be API-stable
-ro.surface_flinger.default_composition_dataspace          u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.default_composition_pixel_format       u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.force_hwc_copy_for_virtual_displays    u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.has_HDR_display                        u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.has_wide_color_display                 u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.max_frame_buffer_acquired_buffers      u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.max_graphics_height                    u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.max_graphics_width                     u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.max_virtual_display_dimension          u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.primary_display_orientation            u:object_r:exported_default_prop:s0 exact enum ORIENTATION_0 ORIENTATION_180 ORIENTATION_270 ORIENTATION_90
-ro.surface_flinger.present_time_offset_from_vsync_ns      u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.running_without_sync_framework         u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.start_graphics_allocator_service       u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.use_color_management                   u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.use_context_priority                   u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.use_vr_flinger                         u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.vsync_event_phase_offset_ns            u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.vsync_sf_event_phase_offset_ns         u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.wcg_composition_dataspace              u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.wcg_composition_pixel_format           u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.display_primary_red                    u:object_r:exported_default_prop:s0 exact string
-ro.surface_flinger.display_primary_green                  u:object_r:exported_default_prop:s0 exact string
-ro.surface_flinger.display_primary_blue                   u:object_r:exported_default_prop:s0 exact string
-ro.surface_flinger.display_primary_white                  u:object_r:exported_default_prop:s0 exact string
-ro.surface_flinger.protected_contents                     u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.set_idle_timer_ms                      u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.set_touch_timer_ms                     u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.set_display_power_timer_ms             u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.support_kernel_idle_timer              u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.use_smart_90_for_video                 u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.use_content_detection_for_refresh_rate u:object_r:exported_default_prop:s0 exact bool
-ro.surface_flinger.color_space_agnostic_dataspace         u:object_r:exported_default_prop:s0 exact int
-ro.surface_flinger.refresh_rate_switching                 u:object_r:exported_default_prop:s0 exact bool
+ro.surface_flinger.default_composition_dataspace          u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.default_composition_pixel_format       u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.force_hwc_copy_for_virtual_displays    u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.has_HDR_display                        u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.has_wide_color_display                 u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.max_frame_buffer_acquired_buffers      u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.max_graphics_height                    u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.max_graphics_width                     u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.max_virtual_display_dimension          u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.primary_display_orientation            u:object_r:surfaceflinger_prop:s0 exact enum ORIENTATION_0 ORIENTATION_180 ORIENTATION_270 ORIENTATION_90
+ro.surface_flinger.present_time_offset_from_vsync_ns      u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.running_without_sync_framework         u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.start_graphics_allocator_service       u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.use_color_management                   u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.use_context_priority                   u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.use_vr_flinger                         u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.vsync_event_phase_offset_ns            u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.vsync_sf_event_phase_offset_ns         u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.wcg_composition_dataspace              u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.wcg_composition_pixel_format           u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.display_primary_red                    u:object_r:surfaceflinger_prop:s0 exact string
+ro.surface_flinger.display_primary_green                  u:object_r:surfaceflinger_prop:s0 exact string
+ro.surface_flinger.display_primary_blue                   u:object_r:surfaceflinger_prop:s0 exact string
+ro.surface_flinger.display_primary_white                  u:object_r:surfaceflinger_prop:s0 exact string
+ro.surface_flinger.protected_contents                     u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.set_idle_timer_ms                      u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.set_touch_timer_ms                     u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.set_display_power_timer_ms             u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.support_kernel_idle_timer              u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.use_smart_90_for_video                 u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.use_content_detection_for_refresh_rate u:object_r:surfaceflinger_prop:s0 exact bool
+ro.surface_flinger.color_space_agnostic_dataspace         u:object_r:surfaceflinger_prop:s0 exact int
+ro.surface_flinger.refresh_rate_switching                 u:object_r:surfaceflinger_prop:s0 exact bool
 
 # Binder cache properties.  These are world-readable
 cache_key.app_inactive                   u:object_r:binder_cache_system_server_prop:s0
diff --git a/private/surfaceflinger.te b/private/surfaceflinger.te
index 97203ba..7e6eaed 100644
--- a/private/surfaceflinger.te
+++ b/private/surfaceflinger.te
@@ -51,6 +51,10 @@
 # Create and use netlink kobject uevent sockets.
 allow surfaceflinger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
 
+# Get properties.
+get_prop(surfaceflinger, surfaceflinger_prop)
+neverallow { domain -coredomain -vendor_init } surfaceflinger_prop:file no_rw_file_perms;
+
 # Set properties.
 set_prop(surfaceflinger, system_prop)
 set_prop(surfaceflinger, exported_system_prop)
diff --git a/public/property.te b/public/property.te
index 7c6160d..42f3f47 100644
--- a/public/property.te
+++ b/public/property.te
@@ -107,6 +107,7 @@
 system_vendor_config_prop(exported_default_prop)
 system_vendor_config_prop(exported3_default_prop)
 system_vendor_config_prop(media_variant_prop)
+system_vendor_config_prop(surfaceflinger_prop)
 system_vendor_config_prop(systemsound_config_prop)
 system_vendor_config_prop(userspace_reboot_config_prop)
 system_vendor_config_prop(vehicle_hal_prop)