Commit Graph

712 Commits

Author SHA1 Message Date
Jack Pham
d3edfa00f0 sdm845-common: init.qcom.usb: Fix dac_override SELinux denials in charger mode
The following SELinux denials are seen when booting into charger mode:

type=1400 audit(1746.159:22): avc: denied { dac_read_search } for
 comm="init.qcom.usb.s" capability=2 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.159:23): avc: denied { dac_override } for
 comm="init.qcom.usb.s" capability=1 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.267:24): avc: denied { dac_read_search } for
 comm="init.qcom.usb.s" capability=2 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.267:25): avc: denied { dac_override } for
 comm="init.qcom.usb.s" capability=1 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0

The DAC errors indicate that there is some kind of access, usually
by root, to a file or directory where the ownership is given to another
user/group which is not root. So since root may not have explicit
permission to access it has to override the default access control
which is flagged by SELinux.

In charger mode, like in normal boot, the init.qcom.usb.sh script
executes in the same process as init, so it is executing as root.
The script is trying to read/write to the ConfigFS string entries.
The fix for these denials is to ensure that any files/directories
being accessed by the script give root permission to access the same.
Hence remove the shell/shell ownership change when creating the USB
gadget and config subdirectories in ConfigFS.

While at it also remove mounting of ADB FFS and the ConfigFS function
instance as we are not enabling ADB in charger mode.

Change-Id: I33d6a9ce8e1bb4594a053156d46688ab11c5491d
2021-01-03 15:13:22 +00:00
Jack Pham
a7b0f740fb sdm845-common: init.qcom.usb.rc: Set MaxPower to 900mA
On some targets (such as GKI) the default bMaxPower is not able to be
hard-coded using the kernel config USB_GADGET_VBUS_DRAW. Instead we can
set this value via USB ConfigFS.

Change-Id: I467dab4fa85e7d07837f6afb6d58c73812619022
2021-01-03 15:13:22 +00:00
Jack Pham
3ba489d95a sdm845-common: init.qcom.usb.rc: New compositions for PIDs 9110 and 9111
Add the following compositions:

0x9110 - DIAG + DIAG CNSS + DUN + RMNET + ADPL + QDSS MSM (Trace) + ADB
0x9111 - DIAG + DIAG CNSS + DUN + RMNET + ADPL + QDSS MSM (Trace)

Change-Id: Id67f4bf67a40813d763f9f2a3374816f93b84a15
2021-01-03 15:13:22 +00:00
Mayank Rana
cfad99b599 sdm845-common: init.qcom.usb.rc: Update usage of USB MTP/PTP with USB F_FS driver
This change adds rules to move usage of USB MTP/PTP functionality
with USB F_FS driver instead of F_MTP/F_PTP drivers. It selects
functionfs based MTP/PTP functionality based on vendor.usb.use_ffs_mtp
property value. Set vendor.usb.use_ffs_mtp to true for Lahaina platform.

sys.usb.mtp.device_type is used by MTP server to provide perceived
device type information to host. Use correct sys.usb.mtp.device_type
property and set value 3 ( 2 - media player and 3 - Mobile handset).

Change-Id: I005bfea4babef012e331dcc4999e5e6af6465b6e
2021-01-03 15:13:22 +00:00
Jack Pham
8caa6b6fc2 sdm845-common: init.qcom.usb.rc: Consolidate init.msm.usb.configfs.rc
Remove obsolete android_usb based property triggers now
that configfs is always used. Merge in init.msm.configfs.rc
so we now have just a single .rc init file.

Also remove all other references to /sys/class/android_usb/*.

Change-Id: I06eba8e715ccee5974dc9de8ac19df6c79ae0c45
2021-01-03 15:13:01 +00:00
Jack Pham
6720cf4628 sdm845-common: init.qcom.usb.rc: Directly exec init.qcom.usb.sh helper
Directly execute the init.qcom.usb.sh helper in the 'on boot'
and 'on charger' actions rather than spawning it as a oneshot
service. After that, directly update sys.usb.config with the
from persist.vendor.usb.config. This streamlines and guarantees
it will execute synchronously which can help avoid rare race
conditions with other USB property triggers that could execute
in parallel.

Change-Id: Iaf798b146d071b11857a4cf54fbaf7ae0d5d2431
2021-01-03 15:13:01 +00:00
Jack Pham
0d208d22dd sdm845-common: init.qcom.usb: Add FFS diag instances for mdm, mdm2
Create configFS entries for two additional diag instances
and mount their respective FunctionFS paths. The diag-router
app will read/write to these for MDM and WLAN instances,
respectively.

Change-Id: Icc896f19a76e7d154e5b9b9a2f1bfc422a3e47e3
2021-01-03 15:13:01 +00:00
Jack Pham
3c1e716b6d smd845-common: init.qcom.usb: Update diag dload with PID and serial
With support now for diag-router using USB FFS driver, the kernel
driver is no longer going to automatically update the DLOAD IMEM
with the required PID/Serial information that is used when the device
transitions into crash download mode so that a port re-enumeration
is avoided. In order to pass the same PID/Serial information, the
same kernel driver now exposes configfs attributes that userspace
can write. Hence the serial number can be written once during "on
boot", and likewise the PID can be updated whenever a composition
is selected that contains Diag as the first interface.

Change-Id: I45d52ecd30fcc4978c9bb4fbe9caa75e12c0b860
2021-01-03 15:13:01 +00:00
Jack Pham
19012fb731 sdm845-common: init.qcom.usb.rc: Support Diag over FFS
Support Diag over USB using F_FS driver by instantiating "ffs.diag"
ConfigFS instance and mounting the functionfs path for the same.
Introduce a new property 'vendor.usb.diag.func.name' which is used
to distinguish between FFS and legacy f_diag and update all Diag-
enabled compositions accordingly.

The `vendor.usb.diag.func.name` property can be overridden on
a per-target basis simply by adding the key=value to the
PRODUCT_PROPERTY_OVERRIDES build variable. This gets generated
into the /vendor/build.prop which overrides the default value of
'diag' set in /vendor/default.prop.

Change-Id: I005a441b39697b489bcd8d74b5cb26fb3b47fdf7
2021-01-03 15:12:55 +00:00
Hemant Kumar
93884ea0af sdm845-common: init.msm.usb.configfs.rc: Add USB PID 0x9044 and 0x9045
0x9044 - MSM DIAG + MDM DIAG + ADB + SmartCard CCID
0x9045 - MSM DIAG + MDM DIAG + SmartCard CCID

Change-Id: I2722ae2ea44f5e75d56af7abd64dbb52817eae16
2021-01-03 14:20:35 +00:00
Hemant Kumar
9920f336b9 sdm845-common: init.msm.usb.configfs.rc: Add new USB product ids
0x90F6 - DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL+ RMNET
0x90F7 - DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL + RMNET + ADB
0x90F8 - RNDIS + DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL
0x90F9 - RNDIS + DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL + ADB

Change-Id: I4c5c6d0377194423443b7da240b720f51651472c
2021-01-03 14:20:35 +00:00
Hemant Kumar
c8969c434a sdm845-common: init.msm.usb.configfs: Add USB PID 0x90D9
0x90D9 includes MSM DIAG, MDM DIAG and ADB.

Change-Id: I880e3fa3b27d5c4ef028be41e11cc0fddcc41f20
2021-01-03 14:20:35 +00:00
Sean Tranchetti
9d5735ecbd sdm845-common: init.qcom.rc: remove unused propery
Removes the unused large_tcp_window_size property.

Change-Id: If7dcede6089b71a3fc18572cf7e5f7571448787d
2021-01-03 14:20:35 +00:00
Bruno Martins
2c2678d92e sdm845-common: Deduplicate handheld_core_hardware.xml copy rule
Since Android 10 that this is already done while inheriting from
full_base_telephony.mk.

Change-Id: If533fbf95a9cf9798ddba24955a624d26f550d62
2021-01-03 15:12:48 +01:00
Bruno Martins
f2f7c84956 sdm845-common: fod: Include VINTF fragment
Change-Id: I914d505d50f79143fb97065f147ed8fd246bb1f3
2021-01-02 22:13:15 +01:00
Bruno Martins
6584d7b5b8 sdm845-common: fingerprint: Include VINTF fragment
Change-Id: I48ce57982e818ce06b4c57b5df700d8a4acf4284
2021-01-02 22:13:15 +01:00
Bruno Martins
09ec37c9eb sdm845-common: sepolicy: Add rules for older IMS blobs
Since Android 10 blobs are being used, org.codeaurora.ims still runs
as phone UID as seen by these denials:

  m.android.phone: type=1400 audit(0.0:2914): avc: denied { read } for name="u:object_r:qcom_ims_prop:s0" dev="tmpfs" ino=13660 scontext=u:r:radio:s0 tcontext=u:object_r:qcom_ims_prop:s0 tclass=file permissive=0
  m.android.phone: type=1400 audit(0.0:473): avc: denied { call } for scontext=u:r:radio:s0 tcontext=u:r:hal_imsrtp:s0 tclass=binder permissive=0

Change-Id: Ic8c1b7996b9e0e7b63ba2a153441c9e8467a8a31
2021-01-01 01:48:23 +01:00
Michael Bestas
9ad050b2fe sdm845-common: Switch to standalone extract utils
Align with templates while we are at it

Change-Id: Ife50623a3d1b8733f5cc76995c982d8950d39ad4
2020-12-31 17:32:37 +00:00
Anton Hansson
6bf2c85ef0 sdm845-common: Remove obsolete dex settings
This block is completely redundant because..
- WITH_DEXPREOPT := true is the default
- WITH_DEXPREOPT_PIC is never read
- DEX_PREOPT_DEFAULT := nostripping has no effect when the
  BOARD_USES_SYSTEM_OTHER_ODEX flag is set to true

Test: make
Change-Id: I618a1e395ca1a14555cd50eef1a4f1aa079b553d
2020-12-31 16:46:41 +00:00
Bruno Martins
641ef89689 sdm845-common: Use CodeAurora ImsService implementation for RCS
There is no evidence that Qualcomm devices running a rather recent IMS
stack need to include AOSP RCS packages. RCS already worked before this
change and continues to do so, but the main goal was to get rid of some
of the RCS related log spam, which was accomplished here.

Change-Id: I219546e29d288373877e9bcd194a60ef5e09f224
2020-12-31 10:48:23 +01:00
Chenyang Zhong
3a6e266413 sdm845-common: audio: add missing mixer path
For whatever reason, Xiaomi left an empty path here for the use
case of "deep-buffer-playback bt-sco-wb". This leads to audio
stuttering and error log spam of:

D audio_hw_primary: enable_audio_route: apply mixer and update path: deep-buffer-playback bt-sco-wb
D audio_route: Apply path: deep-buffer-playback bt-sco-wb
D audio_hw_primary: select_devices: done
D audio_hw_primary: start_output_stream: Opening PCM device card_id(0) device_id(0) format(0x4)
E audio_hw_primary: pcm_open_prepare_helper: pcm_prepare returned -1

...under the following use case:

* join a voice call (whatsapp, discord, etc.)
* using BT headset
* then start a video playback with audio

Therefore, add the missing mixer path from CAF's sdm845 mixer config
to link it to "deep-buffer-playback bt-sco", so that the ctl of
"SLIMBUS_7_RX Audio Mixer MultiMedia1" can be used correctly.

"<ctl name="BT SampleRate" value="KHZ_16" />" entry has been omitted
because our mixer path from stock does not have BT SampleRate set
to KHZ_8 by default.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I94e8d7f714b80380f46148a3fdd8d140a99c6bb2
2020-12-30 16:59:47 +01:00
Rohit Bandi
ab3c681f1e sdm845-common: Adding android.hardware.vr.high_performance.xml to sdm845
android.hardware.vr.high_performance.xml contains set of
features required for a VR-compatible device

Change-Id: Id3f8cdafc551077b682cb25a9316f20352aa3cdf
2020-12-30 15:12:28 +01:00
dianlujitao
8df25fa63c sdm845-common: Add vr hal to vintf manifest
Change-Id: I4b46d1d77b4d7d287d40106ffd795cfa11455166
2020-12-30 15:12:17 +01:00
Sam Mortimer
a61b42edf7 sdm845-common: pocketmode: Ensure FP is always left enabled when screen is turned on
*) If you turn the screen on whilst the device is still in a pocket the
   fp sensor stays disabled even when the device is moved out into the open.

*) This commit ensures that the FP sensor is always reenabled when the
   screen is turned on.

Change-Id: If27967a468673f29d9c1a4742cc9dda95adaab59
2020-12-30 15:06:17 +01:00
Bruno Martins
f836f3e62e sdm845-common: lights: Remove LCD backlight handling
Since composer HAL is now able to handle display brightness,
this can be removed from the lights HAL.

Change-Id: Ic10cead638382d448a94205bcec3543177d387f6
2020-12-30 10:47:12 +00:00
Bruno Martins
11360d9805 sdm845-common: Update OMX codecs and VPP blobs
Change-Id: I3a0735190cbf5fc923feb067b78bf9321cb22056
2020-12-30 10:47:12 +00:00
Sebastian Dang
dcde13429b sdm845-common: Move wfdhdcp Crypto & DRM HAL to 1.3
Change-Id: Ic1f18825f61aa1aecbb56941dd9cfe2447659a20
2020-12-30 10:47:12 +00:00
Bruno Martins
c48452042d sdm845-common: Bump WFD stack
Change-Id: I73af0bbd2e2a33e711922c579513606604feba62
2020-12-30 10:46:46 +00:00
Alastair Donaldson
b516006260 sdm845-common: Add android.software.vulkan.deqp.level, version 2020-03-01
This change sets the new Vulkan dEQP level feature flag to the value
corresponding to the Vulkan dEQP tests for Android 11.

Change-Id: I0715787b310f48c27747849ebd0724e0ca6fbbde
2020-12-30 10:38:10 +00:00
Karthi Kandasamy
55a3ad6846 sdm845-common: Update IDisplayConfig to 2.0 version
Change-Id: I8c470a9b2481a0c8b151efab222defe5816bf065
2020-12-30 10:38:10 +00:00
Karthi Kandasamy
79cee72a78 sdm845-common: Remove Qdutils_disp entry from manifest
Remove Qdutils_disp entry from manifest as implementation is removed
and its not used any more.

Change-Id: I77464cd41f795d36a7ceaa0b8264004681511d46
2020-12-30 10:38:10 +00:00
Bruno Martins
3d316ad303 sdm845-common: Move to new display HAL and update graphics blobs
Change-Id: I0ff514eef5d4a8b1287a910ba781ef77e5c584aa
2020-12-30 10:38:10 +00:00
Michael Bestas
f44df59ab2 sdm845-common: Remove libI420colorconvert
* It was only used in the long dead video editor

Change-Id: I5a3605585ede0b8f556f53cec7cf8d55d3ae4132
2020-12-30 10:37:46 +00:00
Bruno Martins
0012ed5e99 sdm845-common: Drop bitness from graphics composer service
Change-Id: I697d27a7d76aa25c979d8566d12a765c39403ae6
2020-12-28 12:11:19 +00:00
Bruno Martins
ad932e4ec4 sdm845-common: Sign Tether RROs with default cert
In analogy to commit 57653ac.

Change-Id: I18f770da2986653a70fdfa92f3be5e1199d06d08
2020-12-27 23:19:57 +01:00
David Su
57653ac069 sdm845-common: Don't sign Wifi RROs with platform cert
Preinstalled overlays needn't be signed with the same cert
as the package it overlays, simply being preinstalled is
enough. Sign with the default cert instead for now, which
provides fewer special privileges.

Bug: 162195999
Test: verify values still overlaid correctly
Change-Id: I017491fd383551c5aadf8648edb900e0c12a27b8
2020-12-27 22:14:56 +00:00
LuK1337
e8e2f684bb sdm845-common: Disable qti-telephony-common injection for time being
TODO: revisit once usable qti-telephony-common jar is available.

Change-Id: I2b80a3beb931d11db4b8367cded738e935797002
2020-12-26 18:29:07 +00:00
Sandeep Gutta
0c7d68c88b sdm845-common: Update hidl-wrapper and telephony-utils jar path
Include system_ext path for both hidl-wrapper and telephony-utils jar's

Change-Id: I7cdd93c71bd4a029971188cab60ed98e401be583
CRs-Fixed: 2637090
2020-12-26 18:29:07 +00:00
Sandeep Gutta
dbd43843c3 sdm845-common: Move qti-telephony-common jar to system_ext partition
Move qti-telephony-common jar to system_ext partition.

Change-Id: Ib4c366b2c3ceeea59734902aa1825126e7fa402c
CRs-Fixed: 2608010
2020-12-26 18:29:07 +00:00
PIPIPIG233666
1306d78ba3 sdm845-common: Split component-overrides to support pure AOSP/QTI BT stack
Change-Id: Ia40a996ba5164ba8a6fc5dde0dfb3ef859af1477
2020-12-26 19:17:58 +01:00
Pig
9eee8ea107 sdm845-common: Drop no longer existing BluetoothQti
Change-Id: I6bf3e1dda6fe5dc66f6fafdb32a1daecb9616c84
2020-12-26 19:17:58 +01:00
Ryan Mitchell
b27ff8e8b6 sdm845-common: Use component-override to configure Bluetooth
Runtime Resource Overlays (RROs) can no longer change the value of
resources in manifest when read during PackagerParser.

This change uses component-override to enable the service by default.

Remove usages of profile_supported_* from overlays as they no
longer configure the enable state of Bluetooth componenets.

Bug: 135048762
Test:
      adb shell pm query-services \
      com.android.bluetooth/.avrcp.AvrcpTargetService
      adb shell pm query-services \
      com.android.bluetooth/.avrcpcontroller.AvrcpControllerService
      adb shell pm query-services \
      com.android.bluetooth/.ba.BATService
      adb shell pm query-services \
      com.android.bluetooth/.hid.HidDeviceService
      adb shell pm query-services \
      com.android.bluetooth/.hid.HidHostService
      adb shell pm query-services \
      com.android.bluetooth/.sap.SapService

Change-Id: I284d254a921b14d1533745611a083f4b5a27d9dc
2020-12-26 19:17:58 +01:00
Aayush Gupta
12af2e97e7 sdm845-common: Address init denials regarding socket_device
[    9.346918] type=1400 audit(71454275.960:7): avc: denied { create } for comm="init" name="dpmwrapper" scontext=u:r:init:s0 tcontext=u:object_r:socket_device:s0 tclass=sock_file permissive=0

Ref:
[0]: https://source.codeaurora.org/quic/la/device/qcom/sepolicy/commit/?h=LA.UM.9.2.1.r1-03800-sdm660.0&id=79488292273efa5ab89bc405a5f6ae4dec5d011d

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Change-Id: I262b06821c0625978b3685d0666bd2cf599fbf98
2020-12-24 13:51:29 +00:00
Chenyang Zhong
a328275c33 sdm845-common: Use the old libsdedrm.so
Xiaomi changed something in V12.0.1.0 that causes invalid secure mode in DRM.

E SDM     : DRMPlaneManager::Perform: Invalid secure mode 15967184 to set on plane 93
E SDM     : DRMPlaneManager::Perform: Invalid plane id 112
E SDM     : DRMAtomicReq::Validate: drmModeAtomicCommit failed with error 2
E SDM     : HWDeviceDRM::Validate: failed with error -2 for Peripheral Display

Change-Id: I2a5aeaea45c0419582d89ccf168ab8a5373c4d0b
Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
2020-12-14 18:25:42 +01:00
Bruno Martins
1e57d9fbac sdm845-common: Update blobs from MIUI 12
Change-Id: I72984743e890c4ac9444f3003d8e9a225da7866c
2020-12-14 18:25:42 +01:00
Dyneteve
cdf5be89a2 sdm845-common: disable HD Logo
* sed -i 's|<boolean name=\"config_update_service_status\" value=\"true\"/>|<boolean name=\"config_update_service_status\" value=\"false\"/>|g' overlay/packages/apps/CarrierConfig/res/xml/vendor.xml

Change-Id: I38015fb6062325d185d67a710308aff56c32c139
2020-12-13 23:08:34 +05:30
Bruno Martins
187851c56c sdm845-common: Migrate to Health 2.1 HAL
Change-Id: Ic6302844ac58c16713b43b6871a705b9b4749a96
2020-12-08 22:26:25 +00:00
Roman Kiryanov
57e03e2cff sdm845-common: Replace audio@2.0-service with audio.service
Legacy service name, use android.hardware.audio.service instead

Bug: 153579444
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Merged-In: I4c05accb86dd0c9cd1b3fef3d84e0d54b2afc6a1
Change-Id: I6b55b4b1db2577f4176c99dca7021cfe78e13307
2020-12-08 22:26:25 +00:00
Steven Moreland
7c1678825d sdm845-common: Only include bitness of hal impls that is used.
Bug: 73829928
Test: boot, check directories, no errors during boot
Change-Id: Ia1272b2bcc5006fa75a50631861fbaccdeed7bee
2020-12-08 22:26:25 +00:00
Nolen Johnson
11ad599480 sdm845-common: bluetooth: Disable clean turn on
* This isn't needed anymore.

Change-Id: Ib77e5212099d82bbc07aea6044eb35109faff5cb
2020-12-02 22:39:33 +00:00