From 89a73294a0dfedad5b5cabbe28652653de455898 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Sat, 17 Feb 2024 12:33:09 +0800 Subject: [PATCH 1/2] gps: maintain one solution Bug: 315915958 Test: build pass and GPS function works Change-Id: I15572cbfc9bc4aa5ca966a7905c6aac63bc972d5 Merged-In: I15572cbfc9bc4aa5ca966a7905c6aac63bc972d5 --- legacy/zuma/vendor/system_server.te | 2 -- radio/device.te | 1 - radio/file.te | 1 - radio/genfs_contexts | 3 --- radio/gpsd.te | 7 ------- radio/property.te | 1 - radio/property_contexts | 4 ---- radio/rild.te | 1 - 8 files changed, 20 deletions(-) delete mode 100644 radio/gpsd.te diff --git a/legacy/zuma/vendor/system_server.te b/legacy/zuma/vendor/system_server.te index 853e3cf..ba41aa7 100644 --- a/legacy/zuma/vendor/system_server.te +++ b/legacy/zuma/vendor/system_server.te @@ -1,5 +1,3 @@ -# Allow system server to send sensor data callbacks to GPS -binder_call(system_server, gpsd); binder_call(system_server, hal_camera_default); allow system_server arm_mali_platform_service:service_manager find; diff --git a/radio/device.te b/radio/device.te index f3df48a..2f1aff7 100644 --- a/radio/device.te +++ b/radio/device.te @@ -1,4 +1,3 @@ type modem_block_device, dev_type; -type vendor_gnss_device, dev_type; type modem_userdata_block_device, dev_type; type efs_block_device, dev_type; diff --git a/radio/file.te b/radio/file.te index 798af08..aea790e 100644 --- a/radio/file.te +++ b/radio/file.te @@ -6,7 +6,6 @@ type vendor_log_file, file_type, data_file_type; type vendor_rfsd_log_file, file_type, data_file_type; type vendor_slog_file, file_type, data_file_type; userdebug_or_eng(` - typeattribute vendor_gps_file mlstrustedobject; typeattribute vendor_slog_file mlstrustedobject; ') diff --git a/radio/genfs_contexts b/radio/genfs_contexts index d166b2a..d45d42f 100644 --- a/radio/genfs_contexts +++ b/radio/genfs_contexts @@ -4,9 +4,6 @@ genfscon sysfs /devices/platform/sjtag_gsa/interface u:obje genfscon sysfs /firmware/devicetree/base/chosen u:object_r:sysfs_chosen:s0 -# GPS -genfscon sysfs /devices/platform/111e0000.spi/spi_master/spi21/spi21.0/nstandby u:object_r:sysfs_gps:s0 - # Modem genfscon sysfs /devices/platform/cp-tm1/cp_temp u:object_r:sysfs_modem:s0 genfscon sysfs /devices/platform/cpif/dynamic_pcie_spd/tp_threshold u:object_r:sysfs_modem:s0 diff --git a/radio/gpsd.te b/radio/gpsd.te deleted file mode 100644 index 79bf4ca..0000000 --- a/radio/gpsd.te +++ /dev/null @@ -1,7 +0,0 @@ -type gpsd, domain; -type gpsd_exec, vendor_file_type, exec_type, file_type; -# Allow gpsd access PixelLogger unix socket in debug build only -userdebug_or_eng(` - typeattribute gpsd mlstrustedsubject; - allow gpsd logger_app:unix_stream_socket connectto; -') diff --git a/radio/property.te b/radio/property.te index 4a2cc46..f54ff9b 100644 --- a/radio/property.te +++ b/radio/property.te @@ -10,7 +10,6 @@ vendor_internal_prop(vendor_gril_prop) vendor_internal_prop(vendor_ssrdump_prop) vendor_internal_prop(vendor_wifi_version) vendor_internal_prop(vendor_imssvc_prop) -vendor_internal_prop(vendor_gps_prop) vendor_internal_prop(vendor_tcpdump_log_prop) # Telephony debug app diff --git a/radio/property_contexts b/radio/property_contexts index 3f2c917..031cd07 100644 --- a/radio/property_contexts +++ b/radio/property_contexts @@ -52,10 +52,6 @@ vendor.wlan.firmware.version u:object_r:vendor_wifi_version:s0 # for vendor telephony debug app vendor.config.debug. u:object_r:vendor_telephony_app_prop:s0 -# for gps -vendor.gps. u:object_r:vendor_gps_prop:s0 -persist.vendor.gps. u:object_r:vendor_gps_prop:s0 - # Tcpdump_logger persist.vendor.tcpdump.log.alwayson u:object_r:vendor_tcpdump_log_prop:s0 vendor.tcpdump. u:object_r:vendor_tcpdump_log_prop:s0 diff --git a/radio/rild.te b/radio/rild.te index d2c526d..535a6b4 100644 --- a/radio/rild.te +++ b/radio/rild.te @@ -21,7 +21,6 @@ allow rild mnt_vendor_file:dir r_dir_perms; r_dir_file(rild, modem_img_file) binder_call(rild, bipchmgr) -binder_call(rild, gpsd) binder_call(rild, hal_audio_default) binder_call(rild, modem_svc_sit) binder_call(rild, vendor_ims_app) From 070be283a741f99a341f1125718951226b51a91c Mon Sep 17 00:00:00 2001 From: Kiwon Park Date: Wed, 5 Jun 2024 14:40:00 -0700 Subject: [PATCH 2/2] Add setupwizard_feature_prop as one of properties allowed to be read 06-05 20:45:54.890420 root 351 351 W libc : Unable to set property "setupwizard.feature.provisioning_profile_mode" to "true": error code: 0x18 06-05 20:45:54.894967 root 350 350 E init : Unable to set property 'setupwizard.feature.provisioning_profile_mode' from uid:0 gid:0 pid:351: SELinux permission check failed Test: manual Bug: 336903409 Change-Id: I7282cfdbd621dd0e77f08c8ff7287f9693fa060a Merged-In: I7282cfdbd621dd0e77f08c8ff7287f9693fa060a --- system_ext/private/gmscore_app.te | 2 ++ system_ext/private/priv_app.te | 2 ++ system_ext/private/property_contexts | 3 +++ system_ext/public/property.te | 3 +++ vendor/vendor_init.te | 3 +++ 5 files changed, 13 insertions(+) create mode 100644 system_ext/private/gmscore_app.te create mode 100644 system_ext/private/priv_app.te diff --git a/system_ext/private/gmscore_app.te b/system_ext/private/gmscore_app.te new file mode 100644 index 0000000..4dc1639 --- /dev/null +++ b/system_ext/private/gmscore_app.te @@ -0,0 +1,2 @@ +# Allow to read setupwizard_feature_prop +get_prop(gmscore_app, setupwizard_feature_prop) diff --git a/system_ext/private/priv_app.te b/system_ext/private/priv_app.te new file mode 100644 index 0000000..90bc371 --- /dev/null +++ b/system_ext/private/priv_app.te @@ -0,0 +1,2 @@ +# Allow to read setupwizard_feature_prop +get_prop(priv_app, setupwizard_feature_prop) diff --git a/system_ext/private/property_contexts b/system_ext/private/property_contexts index 56360e3..93a16ad 100644 --- a/system_ext/private/property_contexts +++ b/system_ext/private/property_contexts @@ -3,3 +3,6 @@ telephony.TnNtn.image_switch u:object_r:telephony_modem_prop:s0 exact enum nt telephony.ril.modem_bin_status u:object_r:telephony_modemtype_prop:s0 exact uint telephony.ril.silent_reset u:object_r:telephony_ril_prop:s0 exact bool telephony.ril.ntn_demo_mode u:object_r:telephony_ntn_demo_mode_prop:s0 exact bool + +# setupwizard +setupwizard.feature.provisioning_profile_mode u:object_r:setupwizard_feature_prop:s0 diff --git a/system_ext/public/property.te b/system_ext/public/property.te index e492369..f1b73f0 100644 --- a/system_ext/public/property.te +++ b/system_ext/public/property.te @@ -7,3 +7,6 @@ system_restricted_prop(telephony_ntn_demo_mode_prop) userdebug_or_eng(` set_prop(shell, telephony_ril_prop) ') + +# setupwizard +system_public_prop(setupwizard_feature_prop) diff --git a/vendor/vendor_init.te b/vendor/vendor_init.te index 4dcc237..b1c1536 100644 --- a/vendor/vendor_init.te +++ b/vendor/vendor_init.te @@ -6,3 +6,6 @@ allow vendor_init tee_data_file:lnk_file read; # MM allow vendor_init proc_compaction_proactiveness:file w_file_perms; allow vendor_init proc_percpu_pagelist_high_fraction:file w_file_perms; + +# setupwizard +set_prop(vendor_init, setupwizard_feature_prop)