30 Commits

Author SHA1 Message Date
albert-zl.huang
5d457db70b [ALPS04046220] suspend: add factory access sys_power sepolicy
sys_power access has been forbidden in Android P,
but only init/ueventd/vold damain can access

MTK-Commit-Id: e2be46ce6bae18ef7167bd3c07476e3748c3e483

Change-Id: Ic8dc8b5f9e0a5943a9837edd953b70e0170a0a00
CR-Id: ALPS04046220
Feature: Factory Mode
2020-01-18 10:06:07 +08:00
Luhua Xu
087fdc764c [ALPS04046220] Backlight: add factory access sys_leds sepolicy
sys_leds  access has been forbidden in Android P, but only
init/ueventd/vold damain can access

MTK-Commit-Id: 1fcd7afabaa608f6434144f16837d43a5c218df7

Change-Id: I837708bf32e95a037787ac2f23d7f58b41722735
CR-Id: ALPS04046220
Feature: Factory Mode
2020-01-18 10:06:03 +08:00
Light Hsieh
02046e7138 [ALPS04046768] Factory: add sepolicy for Storage item in factory mode
[Detail]
Add sepolicy for Storage item in factory mode so that factory can
access /sys/class/block/mmcblk0/.

MTK-Commit-Id: b3e289e9ea36a4d2581365a73ecae798c4fc60e0

Change-Id: I14222cef75b5e0516cb7a767cdb3487d38dbd95b
CR-Id: ALPS04046768
Feature: Factory Mode
2020-01-18 10:05:59 +08:00
YC
f621158dc4 [ALPS04017296] USB: revise selinux of OTG
revise selinux policy of OTG test item,
align AOSP method due to the same requirement.
(search/read USB devices)

MTK-Commit-Id: a0aed0eede4032d7ed56b7b94297a36366624d52

Change-Id: Iee584b5421069f4159879d7b5c1f4c6ee18082ae
CR-Id: ALPS04017296
Feature: Factory Mode
(cherry picked from commit ea3f52167e7e983843639b4b63b3f1b08290cbad)
2020-01-18 10:05:02 +08:00
Chunlan Wang
eca198762f [ALPS03997985] Factory Mode: add permission for test report
[Solution]
Factory Mode needs the permission to save test report in
data/vendor, so add it

MTK-Commit-Id: 1daeb3669ade3f8213b893ae903733ca13bb9b93

Change-Id: I8005207d25fdc2bcab06dd193a3d7f7d2b521f23
CR-Id: ALPS03997985
Feature: Factory Mode
(cherry picked from commit 981cd097e413fd52a3cae2d5b8203150e9c1b45f)
(cherry picked from commit d49fb6cec0ea53e47ab72bcd5f2cbfa0dcf4eb34)
2020-01-18 10:04:49 +08:00
Ting-Fang Hou
bbb18bde9b [ALPS03918481] Audio: Add audio factory permission to access accdet
[Detail]
Add audio factory permission to access accdet

MTK-Commit-Id: 8af09875ac4b678ba41b4d33c4fb29e2287f4de6

Change-Id: I7acba6b69d8b23fae8232f770fe477b981bdd175
CR-Id: ALPS03918481
Feature: Factory Mode
2020-01-18 10:04:37 +08:00
Elvin Lin
ddeb3c3e41 Merge "[ALPS03893656] factory: add power_supply and switch permission" into alps-trunk-p0.basic
Change-Id: I45bc05f2a7b30497b8a49e71642ae4492feeae35
MTK-Commit-Id: 59248eee76c2fdd98a725417a881d4af1a27d083
2020-01-18 10:03:00 +08:00
Ivan-YH Chen
1e4d3f3823 [ALPS03893656] factory: add power_supply and switch permission
[Detail]
Add power_supply and switch permission
to get online and otg status.

MTK-Commit-Id: dad1b84ca11f7cb5dfe70f03a05b80d6250bfc7a

Change-Id: I349d8313fbf567a3289a8be54b81487cd13fa36f
CR-Id: ALPS03893656
Feature: Charger
2020-01-18 10:02:55 +08:00
mtk12101
722798a334 [ALPS03982747] Remove unused sepolicy rules
Some rules is no need any more, need to remove it.

MTK-Commit-Id: 49685f1299d990a7195a2d54b955517d8f2cc699

Change-Id: I4a590ad781589cf94989ce72c88751ac10b82eae
CR-Id: ALPS03982747
Feature: [Android Default] SELinux, SEAndroid, and SE-MTK
2020-01-18 10:02:25 +08:00
Black Chen
7748e0c1b1 [ALPS03969178] wlan: factory and meta move to vendor partition
In P version, process needs add net permission to access socket.

MTK-Commit-Id: 4cd65a5adf83ee597402220297cf8d7b727f3da0

Change-Id: I39fbeb59e146fc508cc721ddb299fedc15a70a6b
Signed-off-by: Black Chen <black-ch.chen@mediatek.com>
CR-Id: ALPS03969178
Feature: [Module]Wi-Fi Driver
(cherry picked from commit 1569bcd159fe2472597e2bf2b3c5016f44d7756d)
2020-01-18 10:01:23 +08:00
Dian Wang
1b5890dfe1 Merge "[ALPS03932298] Factory Mode: resolve neverallow error" into alps-trunk-p0.basic
Change-Id: If1c77d4e5b5dfba7aeffea5c6f1566cb19113e39
MTK-Commit-Id: b2e7e8f1f4f0d3a03a85465db2926a01ef2819b1
2020-01-18 10:00:07 +08:00
Chunlan Wang
572aa85017 [ALPS03932298] Factory Mode: resolve neverallow error
[Solution]
New Android not allow system process modify vendor
properties, factory mode move to vendor partition,
so remove the workaround

MTK-Commit-Id: bac8727b1a70a637eb7386213b7bf2bee2096b22

Change-Id: I360a493f770fae96f94199ae436d5e29bf752f70
CR-Id: ALPS03932298
Feature: Factory Mode
2020-01-18 10:00:05 +08:00
Light Hsieh
f798441035 [ALPS03957630] Selinux: rules for meta_clr_emmc and mke2fs
[Detail]
Because Android P impose so many restrictions, it is difficult for
meta mode or factory mode to format partitions. A new design is
adopted as follows:
1. Meta mode or factory mode write all 0 to first 4KB of target
   partition.
2. When entering kernel booting, the partition mount process in the
   original init flow find that XXX partition is wiped and automatically
   format XXX partition.
In step-1 described above, selinux rules shall be added for meta_tst or
  factory.
In step-2 described above, selinux rules shall be added for mke2fs.

MTK-Commit-Id: 7e9bbd418ca6353ba89ecffdc016c78504583bf3

Change-Id: I3dd869c57107b0ebebf3134f69c50744df8f8ff9
CR-Id: ALPS03957630
Feature: SP META Tool
2020-01-18 10:00:04 +08:00
Chang-An Chen
862cd6725f [ALPS03869354] fix tpd auto test fail in factory mode
[Detail]
Fix tpd auto test fail in factory mode due to sysfs nodes
are not allowed to read directly.

[Solution]
update touch setting sysfs policy and add to factory mode

MTK-Commit-Id: d8733ca0938653098f5ec1f5462c1723d8f67894

Change-Id: I3fb6a46cfbf02fe050174501a2606404a53bb2ad
CR-Id: ALPS03869354
Feature: [Android Default] CapTouch
2020-01-18 09:59:45 +08:00
Ting-Fang Hou
9034dfa5e7 [ALPS03918481] Audio: Eable audio factory permission
[Detail]
Eable audio factory permission

MTK-Commit-Id: 208dd7a107b82f0224f663345830ecea98ff90c6

Change-Id: Ife089a2bb7c94e4571fabea0ce2ff4811ced7b34
CR-Id: ALPS03918481
Feature: Factory Mode
2020-01-18 09:59:34 +08:00
Chang-An Chen
8729873c5d [ALPS03869354] start merge_hal_service for light hidl
[Detail]
start merge_hal_service for light hidl for ago projects

MTK-Commit-Id: 1cb1aeb24cf5ac34663fa60d41f6e3bd8738d1ff

Change-Id: Iecfea38a24fa237873859b52a82a7e52086f55d3
CR-Id: ALPS03869354
Feature: [Android Default] Backlight
2020-01-18 09:59:16 +08:00
Chang-An Chen
73f8a63b8b [ALPS03869354] Fix factory mode backlight and vibrator test fail
[Detail]
1. Backlight level test in factory mode fail due to no sepolicy
applied, and sysfs_leds is not allow to add to factory.te.
2. Vibrator test fail due to no corresponding selinux policy.

[Solution]
1. Using hidl for backlight in factory mode.
2. Add vibrator policy.

MTK-Commit-Id: 9470dca00da2fecfb373af94aae3502714d31ea3

Change-Id: I42cd45951054a267449e79f559b3761fce34d497
CR-Id: ALPS03869354
Feature: [Android Default] Backlight
2020-01-18 09:59:00 +08:00
Chunlan Wang
c93290f067 [ALPS03932298] Factory Mode: move to vendor partition
[Solution]
Factory mode should build in vendor partiton, so move
factory from system partition to vendor partition

MTK-Commit-Id: c55354593a97aed3af9d0b2584037d03d3d2669c

Change-Id: I5a607b60f9ac974380c5e440a6fa0c51797d6b1b
CR-Id: ALPS03932298
Feature: Factory Mode
2020-01-18 09:58:07 +08:00
Chunlan Wang
2010ade935 [ALPS03928691] Factory Mode:add the permission to get com type
[Solution]
Factory mode need to get com type is USB or UART, so add the
permission in factory.te

MTK-Commit-Id: aff8a941116fde70abd5c492fa084e74d927629e

Change-Id: I0b9206bda110b9dde77168db73a8378c4a571851
CR-Id: ALPS03928691
Feature: Factory Mode
2020-01-18 09:57:07 +08:00
Lili Lin
05f5d87b88 [ALPS03881723] Workaround to fix build break
[Detail] Googles new commit
neverallow coredomain from writing vendor properties
cause build break

cdb1624c27

[Solution] Declare system_writes_vendor_properties_violators as workaround

MTK-Commit-Id: 2b19515d2d98945b0aadfbc9043352ae927497f3

Change-Id: I7be59b6811f6c75ea47da205be902417311fe1d0
CR-Id: ALPS03881723
Feature: [Android Default] SELinux, SEAndroid, and SE-MTK
2020-01-18 09:56:13 +08:00
Peter Wang
8183941448 [ALPS03901606] eMMC&UFS : Combo feature
[Detail]
1. Change type name from sysfs_boot to sysfs_boot_mode
2. Add type name sysfs_boot_type

MTK-Commit-Id: 54d5bb31fc8ad1d9ac2e931fe5dc01ef4c1083cf

Change-Id: I445ecdf5a5e334a49ccc1d747daa87f6be351d20
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
CR-Id: ALPS03901606
Feature: UFS Booting
2020-01-18 09:52:26 +08:00
SW Integrator
700750af5e [ALPS03800946] Remove data_between_core_and_vendor_violators
[Detail]
data_between_core_and_vendor_violators is used temporarily. We should
follow Android P SELinux rule to write sepolicy.

[Solution]
Remove data_between_core_and_vendor_violators from files which already
fix SELinux build errors

MTK-Commit-Id: 6a75842a96d8997bca10caf6ca4d5b4e7e8f68a4

Change-Id: I5e840fdf6b61d44860429a7e5c7e24c9a48a9c75
CR-Id: ALPS03800946
Feature: Treble
2020-01-18 09:49:26 +08:00
ZH Chen
ce3a0f44e7 [ALPS03614388] Sepolicy: Add ttyS to sepolicy
[Detail]
Add ttyS to sepolicy

MTK-Commit-Id: f51e0700ff76c53befa5c15f1bfa6d1726905fed

Change-Id: I88aaa49b470ff98fcbd0d3720c641b74ca42bdeb
CR-Id: ALPS03614388
Feature: Headset Cable/Button Detection and Reaction
(cherry picked from commit 7e314d2dbea64a05f626115e5beccce53bb2a07f)
2020-01-18 09:46:05 +08:00
Chunlan Wang
8c0ef1d8e5 [ALPS03788916] fix build error
[Solution]
There are some build errors in factory.te, so fix

MTK-Commit-Id: db2e842e2fa353e987baa282d5c2026ae8395a61

Change-Id: I07d3906e8a934ae0e36b7c384208f2cfc8506a23
CR-Id: ALPS03788916
Feature: Factory Mode
2020-01-18 09:44:43 +08:00
Shane Chien
d16a43dba8 [ALPS03870469] Audio: remove useless selinux setting
[Detail]
remove useless selinux setting

MTK-Commit-Id: 2b85d091ab892d172bc812ec0888bc1f389af8c6

Change-Id: I6b7ea973f98b4bd5c4b04379d2eef4ea6cc89aac
CR-Id: ALPS03870469
Feature: Phone Sound
2020-01-18 09:34:22 +08:00
Morven-CF Yeh
a1cfcc550c [ALPS03860276] Rename MTKs system properties
[Detail] modify debug.factory.idle_state to
vendor.debug.factory.idle_state

MTK-Commit-Id: 725183500a96ad7d96bea72edfd5fd42643db833

Change-Id: I323b158642aec36604fe6d1dab2afe217ba09002
Signed-off-by: Morven-CF Yeh <morven-cf.yeh@mediatek.com>
CR-Id: ALPS03860276
Feature: Power Management
2020-01-18 09:31:09 +08:00
Chunlan Wang
06fbbbdb00 [ALPS03861528] modify sepolicy for boot mode
[Solution]
sysfs is neverallow, so use sysfs_boot instead

MTK-Commit-Id: 8a48cfbc0a1df06330b9699da2f87243dd8155fe

Change-Id: I67a2dc04dfa5d863ceb8104695dec5d0dbc62630
CR-Id: ALPS03861528
Feature: Factory Mode
2020-01-18 09:30:46 +08:00
Bo Ye
3ace839be3 [ALPS03825066] Mark file context to fix build fails
Restore the policies accessing files labeled
    as proc_xxx or sysfs_xxx, but there are some
    exceptions for coredomain process, such as
    meta_tst,dump_state,kpoc_charger

MTK-Commit-Id: 7953b5203bb3cac099c3326d330643b4cd73746d

Change-Id: I4b16c09c352891783e837bea370c264966ca6d13
CR-Id: ALPS03825066
Feature: [Android Default] SELinux, SEAndroid, and SE-MTK
2020-01-18 09:29:41 +08:00
Bo Ye
5849c224e3 [ALPS03825066] P migration selinux build failed fix
1. Mark polices which accessing proc/sysfs file system
    2. Add violator attribute to modules violate vendor/system rule.

MTK-Commit-Id: 3954cad7a1428cda694d8428c2235a78aa6e7cc8

Change-Id: I401ae5b87eb9a03f324bef83c6678149606b15a8
CR-Id: ALPS03825066
Feature: [Android Default] SELinux, SEAndroid, and SE-MTK
2020-01-18 09:29:36 +08:00
Chunyan Zhang
37e0caa36e import from mediatek/master to mediatek/alps-mp-o1.mp1
Change-Id: Ic78db8195c5c51f85c9c6fd3ef8333489afd6e79
MTK-Commit-Id: 848bf57127be9d01fd1df4aab95737855456afee
2020-01-18 09:29:32 +08:00