Commit Graph

295 Commits

Author SHA1 Message Date
Jiwen 'Steve' Cai
33c5f8698e Pixel 2017: Move XR-related init.rc entries to a dedicated file
Origin CLs that introduced these init.rc entries:

ag/2066998: wahoo: Create PDX socket dirs and cpusets for VR services
ag/2485419: Fix DVR cpusets for wahoo
ag/2645621: wahoo: toggle special touch mode when VR mode is active

Bug: 129787612
Test: Build walleye, taimen, walleye_xr, taimen_xr
Change-Id: I358689e73d2a214a9f3e90e106739dfe0fc2b6b6
2019-04-15 17:58:09 -07:00
Wei Wang
4dd9895619 Move PowerHAL into Pixel common
Bug: 129495482
Test: Build
Change-Id: I5eb2e75092cba8a3dd6e108e26bb3baae0a907d3
2019-04-04 01:31:02 +08:00
Hai Shalom
14ff0657ca wahoo: Add supplicant 1.2 to init.hardware.rc
Add missing supplicant 1.2 to init.hardware.rc to wahoo project.

Bug: 129693419
Test: lshal
Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalWifiSupplicantV1_2Host
Change-Id: I34577cac4892563774f035d3a68ed17cc1edeeb9
2019-04-01 11:30:41 -07:00
Minchan Kim
ec4027d72b change pixel-trace directory permission
Recently, I saw some of bugreports doesn't include mm_event dump.
dumpstate_board.txt says just permission error instead of dumping trace.
I could reproduce it with android restarting( shell$ stop; start).

The permission in pixel-trace directory is changed from

        drwxr-xr-x 5 root root 0 2019-02-15 21:21 pixel-trace

to

        drw------- 5 root root 0 2019-02-15 21:21 pixel-trace

Originally, 600 permission is buggy from the beginning because directory
needs execution permission bit to allow access the file. However, question
is why the permission is not set when the directory is created but does
android is restarted.
The tracefs in kernel seems to not support permission when the directory
is created. It just use 755 hardcoding if I parse it rightly.

https://elixir.bootlin.com/linux/v5.0-rc6/source/fs/tracefs/inode.c#L430

I also read mkdir script implementation(i.e., do_mkdir). It does fchmod
if it founds the file is already existing. That's why the restart changes
the permission to the one I wrote in the script.

Let fix it to set the permission to 755 for directory and 660 files
from the beginning so that it should work even though android restart
accidentally.

Test: confirmed it works device $ stop; start; host$ adb bugreport
Change-Id: I36305283c327b44e476c6eb39ec028ef271c304f
Signed-off-by: Minchan Kim <minchan@google.com>
2019-02-20 09:16:47 +09:00
Roger Wang
131b5d4bb6 walleye: keep /data/vendor/tombstones as root:root
/data/vendor/tombstones should be root which be define
in system/core/rootdir/init.rc.
Previous change (ag/4706914) lead wifi_hal cannot write files to
/data/vendor/tombstones/wifi.

Bug: 121294677
Test: device can boot up
Test: wifi_hal can dump data to /data/vendor/tombstones/wifi.
Change-Id: Id62ec21bc9a71018b03deba17c9befcd8d7b1c31
Signed-off-by: Roger Wang <wangroger@google.com>
2018-12-20 06:23:37 +00:00
Vincent Palomares
9548490218 Upgrading Walleye and Taimen's thermal HAL version to 2.0.
Bug: 118689758
Test: adb shell dumpsys hardware_properties
      adb shell su 0 lshal debug android.hardware.thermal@2.0::IThermal/default
      pts -m PtsThermalHalTestCases
      vts -m VtsHalThermalV1_0Target
      vts -m VtsHalThermalV2_0Target
Change-Id: I089c54c722089f12affae488c81c039405839b5e
Signed-off-by: Vincent Palomares <paillon@google.com>
2018-12-10 16:18:27 -08:00
Siarhei Vishniakou
c03bc0b914 Allow folio_daemon to write to /dev/uinput
Commit aosp/836840 changes permissions for accessing /dev/uinput. That
broke the folio_daemon.

This daemon is responsible for supportic magnetic folio cases on Pixel
2. We need to continue to support this operation.

Allow the folio daemon to access /dev/uinput by enrolling it into the
uhid group.

Note: this is not an sepolicy issue, but a permission issue.

Bug: 120306105
Test: adb logcat | grep uinput
Before the change, see a bunch of permission denials from folio_daemon.
After the change, not seeing anything in the logcat.

Change-Id: Idb33c8427d55b165f5aca2a68c09fa7e749fef57
2018-11-30 19:31:59 -08:00
Wei Wang
fdbe989808 Merge VrHAL logic into PowerHAL
Bug: 110166984
Test: Use daydream and camera
Change-Id: I8bfbe7b5f899d78b781b91834ca361b3ccb120b6
2018-11-20 12:33:03 -08:00
emilchung
a560dd9ade wahoo: Stop retry fingerprint init proecess after limited times
Add new mechanism for stopping FP HIDL after several times init fail.
This prevents the case of FP HIDL keeping trying to do init process and
raising CPU usage when sensor totally dead.
After limited times init retry fail (default 10 times), FP HIDL will
be stopped.

init-fingerprint-sh is for stopping fps_hal after init retry fail
serval times.
It keeps running until max init retry or fps_hal running successfully.
vendor.fps_hal restarts until max init retry times fail.

Test: build pass and FP functionaily are good.
Test: init process will be stopped after limited times retry fail
Bug: 111710758
Change-Id: I8a19bdd351e5d712f8e23c6a0849acb1771e61e5
Signed-off-by: emilchung <emilchung@google.com>
2018-11-05 12:06:22 +08:00
Minchan Kim
e11ea911bc dump mm_event trace into bugreport
This patch creates a pixel owned tracing instance apart from
main tracer(i.e., /d/tracing/instances/pixel-trace) so that
we will keep a certain mount of data without interference from
others(e.g., traceur, atrace and so on). It's important to not
lose the information to investigate problems at bugreport.

This CL also adds dumpstatez and bugreport property hooks to
stop/restart the trace during bugreport to keep more old trace.

Allow dumpstate read mm_event trace from /d/tracing/instances/
pixel-trace/trace. With that, it could dump the trace into
bugreport file.

Bug: 116825025
Test: confirm with adb bugreport/bugreport via power menu shortcut/
volume up/down/power key combination. They includes traces in
dumpstate_board.txt with kernel turns on CONFIG_MM_EVENT_STAT.
Signed-off-by: Minchan Kim <minchan@google.com>

Change-Id: I699f362089b61247b2937accbd331327563b1e0c
2018-10-31 04:53:59 +00:00
Tom Cherry
dd7fd6d35a Merge "Remove starting servicemanagers" am: 7aa2e5a0d8 am: 6947850eaf
am: ad6c54bc83

Change-Id: I6859f09c8666c9b0cbd45b43e17ea406f8cb350c
2018-10-25 22:16:03 -07:00
Tom Cherry
ad6c54bc83 Merge "Remove starting servicemanagers" am: 7aa2e5a0d8
am: 6947850eaf

Change-Id: I2b1235d171053e0bbcf54885984a3691f5e6a477
2018-10-25 14:30:19 -07:00
SalmaxChang
cacb48a23c walleye: Create rfs folder in /data/vendor/tombstones for tftp_server
Bug: 65834073

Test: boot and not find tftp_server permission denials on tombstones
files

tftp_server accesss links with /data/vendor/tombstones/rfs/xxxx.
The links are created by system with makefile as below:
$(shell ln -s /data/vendor/tombstones/rfs/xxx $(TARGET_OUT_VENDOR)/rfs/msm/adsp/ramdumps)
Create /data/vendor/tombstones/rfs for system to link.

tftp_server: pid=787 tid=7771 tftp-server : ERR :[tftp_server_folders_la.c, 155] Failed to auto_dir for(/data/vendor/tombstones/rfs/modem/) errno = -13 (Permission denied)
tftp_server: pid=787 tid=7771 tftp-server : ERR :[tftp_server_folders_la.c, 155] Failed to auto_dir for(/data/vendor/tombstones/rfs/lpass/) errno = -13 (Permission denied)
tftp_server: pid=787 tid=7771 tftp-server : ERR :[tftp_server_folders_la.c, 155] Failed to auto_dir for(/data/vendor/tombstones/rfs/tn/) errno = -13 (Permission denied)
tftp_server: pid=787 tid=7771 tftp-server : ERR :[tftp_server_folders_la.c, 155] Failed to auto_dir for(/data/vendor/tombstones/rfs/slpi/) errno = -13 (Permission denied)

Change-Id: I8fa39fb7f9d45396851e539bae3baab180d3d808
Signed-off-by: SalmaxChang <salmaxchang@google.com>
2018-10-25 08:32:52 +00:00
Tom Cherry
31d06b3b05 Remove starting servicemanagers
All servicemanagers are started in rootdir/init.rc's `on init`
trigger, so there's no need to start them manually in device specific
rc files.

Test: boot
Change-Id: Ibdea8d5289322aae49af50e325beb793936ea525
2018-10-23 19:55:13 -07:00
Minchan Kim
26f37008f6 Change zram swap size and swappiness
This CL increase zram swap size from 512M to 1024M of p17.
It also increase swappiness from 60 to 100.
It has more benefit for overall system performance.
Detail is in the bug.

Bug: 117522738
Test: confirmed zram size and swappiness change manually
Change-Id: If75e47962915f6d4957e5fa9337e40dd6878fa65
Signed-off-by: Minchan Kim <minchan@google.com>
2018-10-21 09:12:36 +09:00
Joel Galenson
6b5547a743 Remove rules for binary that is not on the device. am: 82455337ea am: fc4c9a412b
am: 40d02b062d

Change-Id: I23ad5c4844873bcf95cb40f68c8577134a3381b3
2018-10-09 08:38:41 -07:00
Joel Galenson
40d02b062d Remove rules for binary that is not on the device. am: 82455337ea
am: fc4c9a412b

Change-Id: I00ba0474d9ecd0fb2109b3d4f796208785797f30
2018-10-09 08:34:37 -07:00
Joel Galenson
82455337ea Remove rules for binary that is not on the device.
This was removed from the device in
I6fe5148d6b50b7c5706c09662a1ed0e7da4cb987.

Bug: 79551588
Test: Booted device and observed no relevant errors.
Change-Id: I35a114c10e8e116879ef2fd90487503805610c98
2018-10-09 08:13:12 -07:00
Joel Galenson
50304990e3 Remove rules for binary that is not on the device. am: b67dd879d4 am: 9ae8321d00
am: 0c8ad1498e

Change-Id: If75dd9ca9481476ed9db4242b5de94148abe41ef
2018-10-08 18:06:47 -07:00
Joel Galenson
0c8ad1498e Remove rules for binary that is not on the device. am: b67dd879d4
am: 9ae8321d00

Change-Id: I717e3c7877f446b38b3451df28bbf881e20f8cb0
2018-10-08 18:02:42 -07:00
Joel Galenson
b67dd879d4 Remove rules for binary that is not on the device.
Bug: 117419784
Test: Booted device and observed no relevant errors.
Change-Id: Ic44deb8eb825e8aa2130d889bece52a0b6a71a0a
2018-10-08 12:49:17 -07:00
Chungjui Fan
bc5afc85cb Change the file path of ramoops shell script and remove ramoops runcom
Put the inir.ramoops.sh to /vendor/bin/
The ramoops run commands are recorded in init.ramoops.rc individually

Bug: 113147446
Test: Build pass and test on walleye and taimen
can generate ramoops successfully.
Change-Id: I370cdfc36d7031a7f695abc2045ff756066d1902
Signed-off-by: Chungjui Fan <chungjuifan@google.com>
2018-09-07 17:55:11 +08:00
Thierry Strudel
0ace6317a7 Merge "Do not set charge levels unless retaildemo mode is enabled" into pi-dev am: eb8465d7d3
am: 5222c9b77f

Change-Id: I81b1a67ea83f1267a95fee7c930a2bba27c4c6fc
2018-08-20 15:15:27 -07:00
Thierry Strudel
5222c9b77f Merge "Do not set charge levels unless retaildemo mode is enabled" into pi-dev
am: eb8465d7d3

Change-Id: Ie321e294359818e8f2e494f00be5be961858ede3
2018-08-20 15:07:21 -07:00
Maggie White
aa30298a1c Do not set charge levels unless retaildemo mode is enabled
Test labs use start and stop charge levels to control the battery levels
of DUTs. This is not currently possible since retaildemo mode is set to
0 on every boot. After this behavior is removed, it will still be
possible to reset the charging behavior via a factory reset.

Bug: 112763954
Change-Id: I73992bb44d32357f0ed41b55fc551db79c486338
Signed-off-by: Maggie White <maggiewhite@google.com>
2018-08-17 11:20:01 -07:00
Vagdevi Kondeti
928a430a88 Merge "Wahoo - Make changes for ConnMon to be privapp" 2018-08-14 20:50:44 +00:00
vagdevi
7e18924863 Wahoo - Make changes for ConnMon to be privapp
Define ConnectivityMonitor as _app & isPrivApp.

Give write permission in radio for
PowerAnomaly usecase.

Bug: 112197190
Test: manual - flashed build with changes in "connmon-privapp" topic,
ConnectivityMonitor works as intended
Change-Id: Iaf2ce49af29ed912024b30a07f80df4fe6220328
2018-08-06 21:40:23 +00:00
SalmaxChang
82dd66ca66 wahoo: init: Remove possible unlabeled persist_rfs_file to WA denials
Bug: 78019660

- There are some wahoo devices occur unlabeled denials on persist_rfs_file
  (/persist/rfs/msm/mpss/server_check.txt) with doing restorecon /persist.
- server_check.txt will be checked and re-generated whenever tftp_server is up.
  Remove it and let tftp_server to re-generate it to workaround the denials on
  these devices

avc: denied { getattr } for comm="tftp_server" path="/persist/rfs/msm/mpss/server_check.txt" dev="sdd3" ino=74 scontext=u:r:rfs_access:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0

avc: denied { read } for comm="tftp_server" name="server_check.txt" dev="sdd3" ino=66 scontext=u:r:rfs_access:s0 tcontext=u:object_r:unlabeled:s0 tclass=file permissive=0

Change-Id: I105485111a2ca6072d596160fa7390e43e483b01
Signed-off-by: SalmaxChang <salmaxchang@google.com>
2018-08-01 20:25:34 +00:00
Ahmed ElArabawy
7865e1e1f8 WiFi: chown /d/icnss/stats to system
In current implementation, the icnss stats is not presented in
dumpstate_board.txt file because the file owner/group is set to
root/root.

This commit changes the owner of the file to system/system to enable
the bugreport to dump the info in dumpstate_board.txt. This setting is
consistent with other devices.

Bug: 111845187
Test: adb bugreport and check icnss stats in dumpstate_board.txt
Change-Id: Ieff0841b1aafc7428a9f88ffb7fb2c0ac9075f24
2018-07-30 14:06:50 -07:00
Tom Cherry
ceb0f1e8f1 Remove qmuxd from init scripts and sepolicy
This daemon doesn't exist on the device and causes init errors during
boot.

init: /vendor/etc/init/hw/init.walleye.rc: 745: Unable to decode GID
for 'qcom_diag': getpwnam failed: No such file or directory

init: Could not start service 'vendor.qmuxd' as part of class 'main':
Cannot find '/vendor/bin/qmuxd': No such file or directory

Test: tree-hugger passes
Merged-In: Ib2bc1739cac088af3e9ef2e0482f2536dad8fb8c
Change-Id: Ib2bc1739cac088af3e9ef2e0482f2536dad8fb8c
2018-06-19 00:13:13 +00:00
Tom Cherry
6e734ccc64 Remove qmuxd from init scripts and sepolicy
am: e4199f9ff6

Change-Id: I8f38251268cbeb037ec764ebed8e997cb19bc245
2018-06-18 11:06:30 -07:00
Tom Cherry
e4199f9ff6 Remove qmuxd from init scripts and sepolicy
This daemon doesn't exist on the device and causes init errors during
boot.

init: /vendor/etc/init/hw/init.walleye.rc: 745: Unable to decode GID
for 'qcom_diag': getpwnam failed: No such file or directory

init: Could not start service 'vendor.qmuxd' as part of class 'main':
Cannot find '/vendor/bin/qmuxd': No such file or directory

Test: tree-hugger passes
Change-Id: Ib2bc1739cac088af3e9ef2e0482f2536dad8fb8c
2018-06-15 15:15:15 -07:00
Wei Wang
badc9900ad Power: make powerhal starts handling powerhint after boot_complete
some sysfs node may not be ready before boot_complete:
e.g. we are delaying bw_hwmon in favor of boot time

Bug: 80321544
Test: Boot and check powerhint handling
Change-Id: I8d2cfa332d9cf9fbafdfa3f48ffff4105c6bcaae
2018-05-29 22:24:27 +00:00
Hung-ying Tyan
d804dac184 configstore: uprev configstore (1.0 -> 1.1)
Bug: 69691076
Test: Built and tested on walleye
Change-Id: I16f06827ef83711c9e29698540ffcec658081fda
2018-05-23 10:45:38 -07:00
Wei Wang
8e5694d2c0 Remove perfd
We have moved to new PowerHAL implementation.

Test: build and boot
Bug: 62041945
Change-Id: If8deaf131ccc829653932c8d3310b4c2ecd4a7ac
2018-05-14 15:13:39 -07:00
Jack Wu
2fa48ee4fe battery learned capacity: backup/restore to/from persist data
Test:
    - delete file /persist/battery/qcom_charge_full
    - adb logcat to check code flow related health@2.0
    - adb bugreport
    - no "avc: denied" on health vendor service
    - check learned capacity in both
      /sys/class/power_supply/bms/charge_full
      /persist/battery/qcom_charge_full
      -- decrease /sys/class/power_supply/bms/charge_full
         to check backup to /persist/battery/qcom_charge_full
      -- increase /sys/class/power_supply/bms/charge_full
         to check restore from /persist/battery/qcom_charge_full
         (simluate the reset condition)

Bug: 78883741
Change-Id: Ib17bc0938d3a4b78376140a8a1008b4fc82220af
Signed-off-by: Jack Wu <wjack@google.com>
2018-05-10 09:13:50 -07:00
Joel Galenson
e3c5c6ef31 Try to fix thermal-engine dac_override denial.
We saw a similar denial on Marlin where thermal_engine was trying to
access /dev/diag.  This ports that fix to Wahoo to try to fix its
denial.

Bug: 78019417
Test: Build policy.
Change-Id: I3702e705ea4f99a58f4b96008d236d33ecd8045c
(cherry picked from commit 200ded4ed8)
2018-05-02 10:26:03 -07:00
Tim Murray
bd8b3857d0 wahoo: add restricted cpuset
bug 78197570
Test: CTS

Change-Id: I29b20c99500c009049a7d229a3325b299738385c
2018-04-17 18:02:21 -07:00
Wei Wang
f6acbc6276 Wait for hwservicemanager ready before running fsck
As property service is part of init, and if init is busy with built-in
command e.g. fsck, the propety_set() won't go through until the built-in
command is finished.
Move the start of hwservicemanager earlier and wait for its done after
launches bootanim and its dependencies (there is not wait time during
boot but the command is as a safeguard).

Bug: 74437368
Test: boot with simulated long fsck and bootanim shown early
Test: boot see 'start_waiting_for_property("hwservicemanager.ready", "true"): already set'
Change-Id: Iab4b857a51e0e6b8b059d063c1f0d65a0e987622
2018-04-05 17:24:42 +00:00
Thierry Strudel
fa1279bd6b battery cycle counts: backup/restore + update dumpstate
Tests:
  - pts-tradefed run pts -a arm64-v8a -m PtsHardwareInfoHostTestCases
  - adb bugreport
  - no "avc: denied" on health vendor service
  - cycle count stored in /persist/battery/qcom_cycle_counts_bins

Bug: 72776338
Bug: 77498107
Change-Id: Ia1a58441fff511c60278b5d97806655c34aec610
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2018-04-04 09:23:39 -07:00
Thierry Strudel
fe3e7a0a2e init.hardware.rc: map sys.retaildemo to persist.vendor.charge.*.level
Bug: 75293289
Bug: 75301885
Change-Id: If1d12aff9807c4f32982ad3b2ad4eb0d78213d78
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2018-04-03 16:18:01 -07:00
Ecco Park
296546cdc7 wifi: create the sys property for wlan driver/firmware
Bug: 76220544
Test:
No denial error found for selinux
Signed-off-by: Ecco Park <eccopark@google.com>

Change-Id: If379812a7c8df7fd84beec6734313459938d540e
2018-03-26 15:01:24 -07:00
Thierry Strudel
ab8d91f947 dumpstate: dump SRAM & power supply properties
Bug: 74954924
Change-Id: I4e2ba0efaf453d0f713d8859945e61e5f5d9ed8d
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2018-03-21 10:05:14 -07:00
Andrew Lehmer
5d2db97dd9 folio_daemon: start and stop with other services
If sensorservice goes down while folio_daemon is running, folio_daemon
will gracefully exit and restart. If sensorservice remains down while
folio_daemon is starting, it will eventually crash due to the way the
ASensorManager_getInstanceForPackage() API behaves (i.e., it will exit
with a SIGABRT after five minutes of waiting). We can reduce the
chance of this happening by ensuring folio_daemon is only started when
its dependent services are explicitly started as well.

Note that this cannot guarantee that folio_daemon will *never* crash due
to SIGABRT, since there is no variant of
ASensorManager_getInstanceForPackage() that allows for graceful handling
of the service timeout. Events that negatively affect the availability
of sensors are outside the control of folio_daemon.

Bug: 73555660
Test: loaded on walleye and tested with `stop` and `start` commands
Change-Id: I65e1b72745719f2540bff7cab8e556725486bcad
(cherry picked from commit 9ebb33ed13)
2018-03-19 20:43:54 +00:00
Jaegeuk Kim
d494591123 Remove hibern8 tweak
We disabled auto_hibern8 in kernel, so there's no sysfs entry for that.

Bug: 75004568
Bug: 66697973
Bug: 65535484
Change-Id: Iaa95c60435b74ffb97c103701515e9aa55946a91
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-03-17 18:07:19 +00:00
Marissa Wall
0db89e36a7 sepolicy: rename proc.uidcpupower to sys.uidcpupower am: 3f61aa4387 am: a85ffd0f36
am: f4cfd23dba

Change-Id: I1ce106bdb710822059c8029909994d774582e5d7
2018-02-22 23:13:59 +00:00
Marissa Wall
3f61aa4387 sepolicy: rename proc.uidcpupower to sys.uidcpupower
Rename proc.uidcpupower to sys.uidcpupower so system server can
read and set the property

Test: adb shell settings put global sys_uidcpupower 1
      verify via getprop sys.uidcpupower

Change-Id: I6b78e755a444f6dce048f06f053d3002aa060b64
2018-02-20 15:04:42 -08:00
Roshan Pius
c127f046f8 wpa_supplicant(hidl): Add support for starting HAL lazily
Bug: 72394251
Test: Able to start supplicant from framework using
ISupplicant.getService()
Change-Id: I19b8434e7241b9028e7dc86316ec9d5512affcca
2018-02-07 09:52:09 -08:00
Ecco Park
29ee545bed Adding the execute permission for /data/vendor/wifi
ag/3332074 broke the Pixel Logger funtionality for wifi.

The Logger needs the write permission for /data/vendor/wifi/cnss_diag.
so, parent directory needs to set the execute permission for other group.

Test: manual test with Pixel Logger
Bug: 70228425
Change-Id: I75819f0b0bf4ed376d5d87f33af2e1693c864db8
Signed-off-by: Ecco Park <eccopark@google.com>
2018-01-31 23:04:26 +00:00
Marissa Wall
2cdbc03bf1 STOPSHIP: proc.uidcpupower reflector for experiments am: 1437d38b52 am: 33c59636f6
am: 456690f063

Change-Id: I5fab6ed361c6e7bf3a7674565b3eb4d7adb83021
2018-01-25 03:37:23 +00:00