16 Commits

Author SHA1 Message Date
Inseob Kim
155ec7653f Move brownout_detection definition to system_ext
Because brownout detection app is installed to system_ext.

Bug: 296512192
Test: build panther and boot
Test: Automatically filed b/300277478
Change-Id: Ia381f01bbfeb8576a4f9b58ca24aeeeb436060b7
2023-09-13 17:34:52 +00:00
Inseob Kim
3a3a2ec43d Start tracking vendor seapp coredomain violations (2)
As part of Treble, enforce that vendor's seapp_contexts can't label apps
using coredomains. Apps installed to system/system_ext/product should be
labeled with platform side sepolicy.

This change marks violating domains that need to be fixed.

Bug: 296512192
Test: build and see build log
Change-Id: Iba8dbfe1260b481b2981e62d740552bf84c8004f
2023-08-21 20:56:03 +09:00
George Lee
868cd2ac91 bm: Check thermal prior to bootreason check
vendor.brownout_reason was set because sys.boot.reason still contains
the reason from prior reboot.  By enforcing thermal check prior to
bootreason check guarantees the sys.boot.reason will have the most
recent boot reason.

Bug: 268344942
Test: Confirm through artificial triggering of brownout
Change-Id: I69cb459f4c51f7db439d5993330691a7ad1f5dbe
Signed-off-by: George Lee <geolee@google.com>
2023-02-09 04:58:27 +00:00
Xiang Wang
d865bd3bf9 Merge "Allow battery_mitigation to use Binder IPC" 2023-02-07 03:00:38 +00:00
Xiang Wang
82860bfe63 Allow battery_mitigation to use Binder IPC
This is to resolve the following local error when testing with Thermal
 AIDL service enabled:
auditd  : type=1400 audit(0.0:4): avc: denied { call } for comm="servicemanager" scontext=u:r:servicemanager:s0 tcontext=u:r:battery_mitigation:s0 tclass=binder permissive=0

Bug: b/264595820
Test: pts-tradefed run pts -m PtsSELinuxTest
Change-Id: I825ed2b644360e695081fe06489fabf3feb913bd
2023-02-07 02:29:01 +00:00
George Lee
930ea07e39 logger: Change access right to lastmeal.txt
Bugreport cannot access lastmeal.txt due to access right.

Bug: 239709385
Test: confirm lastmeal.txt has system:system
Change-Id: Id207bf86096333710f8e55533fb806ae9f3a66c5
Signed-off-by: George Lee <geolee@google.com>
2023-02-01 17:44:01 +00:00
George Lee
63703f8d5e bm: remove sysfs_bcl label from odpm
Bug: 264929465
Test: Confirm label
u: object_r:sysfs_odpm:s0 i2c-0/0-001f/s2mpg14-meter/s2mpg14-odpm/iio:device1/lpf_power
Change-Id: Ia8a34b83cc0c91d8936c60e475ec926e859cc8b1
Signed-off-by: George Lee <geolee@google.com>
2023-01-27 15:33:37 -08:00
George Lee
d97ad6eeec selinux: enable lpf_power for sysfs_bcl
Bug: 264929465
Test: Confirm selinux error no longer
Change-Id: Iff9a81ffe6957c5510109e5698be2ea98d42bfdd
Signed-off-by: George Lee <geolee@google.com>
2023-01-12 21:06:08 -08:00
George Lee
4b3a85cac0 battery_mitigation: fix brownout reporting
Ensure ro.boot.bootreason equals sys.boot.reason before filing bugreport
for Brownout.

Bug: 263274350
Test: Local testing to confirm
Change-Id: I321a7c71bb7ef8c13fa49bb356be34bf789e7bef
Signed-off-by: George Lee <geolee@google.com>
2023-01-04 15:18:14 -08:00
George Lee
fd2395f40f Battery Mitigation: Use Brownout Reason
Brownout Reason replaces startup_bugreport_requested.  Battery
Mitigation needs to be updated.

Bug: 237287659
Test: Ensure lastmeal.txt is properly generated.
Change-Id: I33791886e0ea8fcfb3324c0f64384ffe245808d3
Signed-off-by: George Lee <geolee@google.com>
2022-12-02 01:34:08 +00:00
George Lee
66547716ae gs-common: Add BrownoutDetection app
This app files bugreport for user-debug build with reboot reason = ocp
or uvlo.  Removed the dependency on BetterBug.

Bug: 237287659
Test: Ensure bugreport is generated under user-debug build with reboot
reason = ocp or uvlo.
Change-Id: Ieaa4d02ea10413b3b7c0e314b5deb07d38d98a80
Signed-off-by: George Lee <geolee@google.com>
2022-11-15 02:57:48 +00:00
George Lee
27725bd144 betterbug: Fixed sepolicy related to File
Added File Attachment sepolicy for betterbug

Bug: 237287659
Test: Attach files from local directory and confirm it can be attached.
Change-Id: I2e77894d4b12a302f0498aab3aa59be6fb95b795
Signed-off-by: George Lee <geolee@google.com>
2022-11-07 16:54:45 -08:00
George Lee
6b49a4ea4f betterbug: Fixed sepolicy related to mediaserver
Added mediaserver sepolicy for betterbug

Bug: 237287659
Test: Run same video capture on Betterbug to confirm video can be
captured.
Change-Id: Ifcb2bdba6f8036805f311a9d6b76227bf63e39e3
Signed-off-by: George Lee <geolee@google.com>
2022-11-05 10:39:53 -07:00
George Lee
271a36cdcc betterbug: Update selinux policy for master
Update startup_bugreport_requested property to vendor_public for
betterbug to access.

Bug: 237287659
Test: Load Betterbug for accessing startup bugreport reason property
Change-Id: I7102156fe62d5f03f64c367014c2d1ce9bd679b6
2022-11-01 17:09:23 -07:00
George Lee
a2c73f3a52 bcl: Change bugreport_requested prop to public
This is to resolve a merge conflict due to property configuration.

Bug: 256639156
Test: compile with ag/20329329
Change-Id: I6dacdb5f7342b84f880af84a477532205a7e3b9f
Signed-off-by: George Lee <geolee@google.com>
2022-11-01 12:34:10 -07:00
George Lee
a1bea3e3e3 bcl: Add Mitigation Logger
Mitigation Logger logs battery related information for 1 second when it
is triggered by under voltage or over current interrupts.  Information
collected is to help debug system brownout.

Bug: 228383769
Test: Boot and Test
Signed-off-by: George Lee <geolee@google.com>
Change-Id: I24e5075b12a9bb3f16241de268254bde38c133d0
2022-10-28 05:25:08 +00:00