Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)

Bug: 166295507
Merged-In: I3a1e355f510e6328d05e76ba2961562fe711da1b
Change-Id: I51411eabdf7f95382b4049a26f261b6d7af9aa86
This commit is contained in:
Xin Li
2020-08-27 17:12:52 -07:00
62 changed files with 604 additions and 977 deletions

View File

@@ -129,10 +129,14 @@ WIFI_DRIVER_FW_PATH_P2P := "p2p"
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
WIFI_HIDL_FEATURE_AWARE := true
WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true
# CHRE
CHRE_DAEMON_ENABLED := true
CHRE_DAEMON_USE_SDSPRPC := true
# Audio
BOARD_USES_ALSA_AUDIO := true
USE_XML_AUDIO_POLICY_CONF := 1
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
AUDIO_FEATURE_ENABLED_SND_MONITOR := true
AUDIO_FEATURE_ENABLED_USB_TUNNEL := true
@@ -168,9 +172,6 @@ TARGET_USES_MKE2FS := true
BOARD_VNDK_VERSION := current
# Generate an APEX image for experiment b/119800099.
DEXPREOPT_GENERATE_APEX_IMAGE := true
# Board uses A/B OTA.
AB_OTA_UPDATER := true

View File

@@ -87,6 +87,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hard
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vr.high_performance.xml)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vulkan.level.xml)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.hardware.vulkan.version.xml)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/permissions/android.software.vulkan.deqp.level.xml)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/wifi/wpa_supplicant_overlay.conf)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/wifi/p2p_supplicant_overlay.conf)
@@ -205,3 +206,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.po
# Remove obsolete android.hardware.boot@1.0-impl-wrapper.recovery.so
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/recovery/root/system/lib64/hw/android.hardware.boot@1.0-impl-wrapper.recovery.so)
# Vibrator HAL 1.2 renamed from 'wahoo' to 'drv2624'
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.vibrator@1.2-service.wahoo.rc)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.vibrator@1.2-service.wahoo)

20
component-overrides.xml Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<config>
<component-override package="com.android.bluetooth" >
<component class=".sap.SapService" enabled="true" />
</component-override>
</config>

View File

@@ -133,6 +133,7 @@
<permission name="android.permission.RECEIVE_SMS" fixed="false"/>
<permission name="android.permission.RECORD_AUDIO" fixed="false"/>
<permission name="android.permission.SEND_SMS" fixed="false"/>
<permission name="android.permission.READ_CALENDAR" fixed="false"/>
<!-- For Top Gear -->
<permission name="android.permission.PROCESS_OUTGOING_CALLS" fixed="false"/>
<permission name="android.permission.READ_SMS" fixed="false"/>

View File

@@ -35,17 +35,19 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
PRODUCT_SOONG_NAMESPACES += \
device/google/wahoo \
vendor/google/camera \
hardware/google/camera \
hardware/google/pixel \
hardware/qcom/msm8998
PRODUCT_COPY_FILES += \
device/google/wahoo/default-permissions.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default-permissions/default-permissions.xml \
device/google/wahoo/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \
frameworks/native/data/etc/android.software.verified_boot.xml:system/etc/permissions/android.software.verified_boot.xml
# Set the SVN for the targeted MR release
PRODUCT_PROPERTY_OVERRIDES += \
ro.vendor.build.svn=47
ro.vendor.build.svn=50
# Enforce privapp-permissions whitelist
PRODUCT_PROPERTY_OVERRIDES += \
@@ -54,6 +56,10 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PACKAGES += \
messaging
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_PACKAGES += chre_test_client
endif
LOCAL_PATH := device/google/wahoo
SRC_MEDIA_HAL_DIR := hardware/qcom/media/msm8998
@@ -81,7 +87,6 @@ DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
PRODUCT_COPY_FILES += \
$(LOCAL_KERNEL):kernel \
$(LOCAL_PATH)/init.recovery.hardware.rc:recovery/root/init.recovery.$(PRODUCT_HARDWARE).rc \
$(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_HARDWARE).rc \
$(LOCAL_PATH)/init.hardware.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.wahoo.usb.rc \
$(LOCAL_PATH)/ueventd.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/ueventd.rc \
$(LOCAL_PATH)/init.elabel.sh:$(TARGET_COPY_OUT_SYSTEM)/bin/init.elabel.sh \
@@ -96,6 +101,18 @@ PRODUCT_COPY_FILES += \
frameworks/native/services/vr/virtual_touchpad/idc/vr-virtual-touchpad-0.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/vr-virtual-touchpad-0.idc \
frameworks/native/services/vr/virtual_touchpad/idc/vr-virtual-touchpad-1.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/vr-virtual-touchpad-1.idc
ifeq (,$(filter %_xr,$(TARGET_PRODUCT)))
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_HARDWARE).rc
else
# XR variants for Pixel devices (e.g. walleye_xr and taimen_xr). Note that
# this is a nonintrusive way to add XR-specific init.rc entries, as the
# init.hardware.xr.rc file imports the original init.hardware.rc file.
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.hardware.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_HARDWARE).common.rc \
$(LOCAL_PATH)/init.hardware.xr.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_HARDWARE).rc
endif
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.hardware.diag.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(PRODUCT_HARDWARE).diag.rc
@@ -160,6 +177,7 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.hifi_sensors.xml \
frameworks/native/data/etc/android.hardware.context_hub.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.context_hub.xml \
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
@@ -183,12 +201,9 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \
frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
frameworks/native/data/etc/android.software.vulkan.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml \
frameworks/native/data/etc/android.hardware.telephony.carrierlock.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.carrierlock.xml \
# power HAL
PRODUCT_PACKAGES += \
android.hardware.power@1.3-service.pixel-libperfmgr
# power.stats HAL
PRODUCT_PACKAGES += \
android.hardware.power.stats@1.0-service.pixel
@@ -372,8 +387,8 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PACKAGES += \
android.hardware.drm@1.0-impl:32 \
android.hardware.drm@1.0-service \
android.hardware.drm@1.2-service.clearkey \
android.hardware.drm@1.2-service.widevine \
android.hardware.drm@1.3-service.clearkey \
android.hardware.drm@1.3-service.widevine \
move_widevine_data.sh
# NFC packages
@@ -405,12 +420,15 @@ PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-service \
camera.device@3.2-impl \
camera.msm8998 \
libgooglecamerahal \
libgoogle_camera_hal_tests \
libqomx_core \
libmmjpeg_interface \
libmmcamera_interface
# Google Camera HAL test libraries in debug builds
PRODUCT_PACKAGES_DEBUG += \
libgoogle_camera_hal_proprietary_tests \
libgoogle_camera_hal_tests.vendor
PRODUCT_PACKAGES += \
sensors.$(PRODUCT_HARDWARE) \
android.hardware.sensors@1.0-impl:64 \
@@ -438,14 +456,6 @@ PRODUCT_PACKAGES += \
android.hardware.boot@1.0-impl.recovery:64 \
android.hardware.boot@1.0-service \
# Vibrator HAL
PRODUCT_PACKAGES += \
android.hardware.vibrator@1.2-service.wahoo
# Thermal HAL
PRODUCT_PACKAGES += \
android.hardware.thermal@2.0-service.pixel
#GNSS HAL
PRODUCT_PACKAGES += \
gps.conf \
@@ -476,7 +486,8 @@ endif
PRODUCT_PACKAGES += \
android.hardware.wifi@1.0-service \
wificond \
libwpa_client
libwpa_client \
WifiOverlay
LIB_NL := libnl_2
PRODUCT_PACKAGES += $(LIB_NL)
@@ -499,8 +510,8 @@ PRODUCT_PACKAGES += \
audio.bluetooth.default
PRODUCT_PACKAGES += \
android.hardware.audio@5.0-impl:32 \
android.hardware.audio.effect@5.0-impl:32 \
android.hardware.audio@6.0-impl:32 \
android.hardware.audio.effect@6.0-impl:32 \
android.hardware.soundtrigger@2.2-impl:32 \
android.hardware.bluetooth.audio@2.0-impl \
android.hardware.audio@2.0-service
@@ -615,10 +626,14 @@ PRODUCT_COPY_FILES += \
PRODUCT_PACKAGES += \
charger_res_images
# b/36703476
# Set default log size on userdebug/eng build to 1M
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
PRODUCT_PROPERTY_OVERRIDES += ro.logd.size=1M
# b/36703476: Set default log size to 1M
PRODUCT_PROPERTY_OVERRIDES += \
ro.logd.size=1M
# b/114766334: persist all logs by default rotating on 30 files of 1MiB
PRODUCT_PROPERTY_OVERRIDES += \
logd.logpersistd=logcatd \
logd.logpersistd.size=30
endif
# Dumpstate HAL
@@ -653,6 +668,9 @@ PRODUCT_PACKAGES += \
PRODUCT_PROPERTY_OVERRIDES += \
ro.telephony.default_cdma_sub=0
# Set network mode to Global by default and no DSDS/DSDA
PRODUCT_PROPERTY_OVERRIDES += ro.telephony.default_network=10
# Add an extra 10% saturation to display colors
PRODUCT_PROPERTY_OVERRIDES += \
persist.sys.sf.color_saturation=1.1
@@ -696,6 +714,10 @@ ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
persist.vendor.usb.usbradio.config=diag
endif
# Vibrator HAL
PRODUCT_PROPERTY_OVERRIDES += \
ro.vibrator.hal.closeloop.threshold=20
# default atrace HAL
PRODUCT_PACKAGES += \
android.hardware.atrace@1.0-service
@@ -719,3 +741,13 @@ PRODUCT_PRODUCT_PROPERTIES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/fstab.postinstall:$(TARGET_COPY_OUT_PRODUCT)/etc/fstab.postinstall
PRODUCT_PRODUCT_PROPERTIES += \
ro.charger.enable_suspend=true
include hardware/google/pixel/vibrator/drv2624/device.mk
include hardware/google/pixel/mm/device_legacy.mk
include hardware/google/pixel/thermal/device.mk
# power HAL
-include hardware/google/pixel/power-libperfmgr/hidl/device.mk

View File

@@ -30,8 +30,6 @@ LOCAL_SHARED_LIBRARIES := \
libcutils \
libdumpstateutil \
libhidlbase \
libhidltransport \
libhwbinder \
liblog \
libutils

View File

@@ -123,6 +123,7 @@ void DumpstateDevice::dumpModem(int fd, int fdModem)
"/data/vendor/radio/ril_log_old",
"/data/vendor/netmgr/netmgr_log",
"/data/vendor/netmgr/netmgr_log_old",
"/data/vendor/radio/omadm_logs.txt",
"/data/vendor/radio/power_anomaly_data.txt",
"/data/vendor/radio/diag_logs/diag_trace.txt",
"/data/vendor/radio/diag_logs/diag_trace_old.txt",

View File

@@ -40,8 +40,6 @@ cc_binary {
"libbase",
"libcutils",
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.health@2.0",
],

View File

@@ -21,6 +21,7 @@ namespace google {
namespace wahoo {
namespace health {
static constexpr char kChgFullDesignFile[] = "sys/class/power_supply/bms/charge_full_design";
static constexpr char kChgFullFile[] = "sys/class/power_supply/bms/charge_full";
static constexpr char kSysCFPersistFile[] = "/persist/battery/qcom_charge_full";
static constexpr int kBuffSize = 256;
@@ -29,13 +30,15 @@ LearnedCapacityBackupRestore::LearnedCapacityBackupRestore() : sw_cap_(0), hw_ca
void LearnedCapacityBackupRestore::Restore() {
ReadFromStorage();
ReadNominalCapacity();
ReadFromSRAM();
if (sw_cap_ == 0) {
// First backup
sw_cap_ = hw_cap_;
SaveToStorage();
} else {
// Always restore backup value
} else if (hw_cap_ == nom_cap_) {
// Restore backup value when capacity is reset to nominal
hw_cap_ = sw_cap_;
SaveToSRAM();
}
}
@@ -74,11 +77,27 @@ void LearnedCapacityBackupRestore::SaveToStorage() {
LOG(ERROR) << "Write file error: " << strerror(errno);
}
void LearnedCapacityBackupRestore::ReadNominalCapacity() {
std::string buffer;
if (!android::base::ReadFileToString(std::string(kChgFullDesignFile), &buffer)) {
LOG(ERROR) << "Read nominal capacity error: " << strerror(errno);
return;
}
buffer = android::base::Trim(buffer);
if (sscanf(buffer.c_str(), "%d", &nom_cap_) < 1)
LOG(ERROR) << "Failed to parse nominal capacity: " << buffer;
else
LOG(INFO) << "nominal capacity: " << buffer;
}
void LearnedCapacityBackupRestore::ReadFromSRAM() {
std::string buffer;
if (!android::base::ReadFileToString(std::string(kChgFullFile), &buffer)) {
LOG(ERROR) << "Read cycle counter error: " << strerror(errno);
LOG(ERROR) << "Read capacity error: " << strerror(errno);
return;
}

View File

@@ -36,9 +36,11 @@ class LearnedCapacityBackupRestore {
private:
int sw_cap_;
int hw_cap_;
int nom_cap_;
void ReadFromStorage();
void SaveToStorage();
void ReadNominalCapacity();
void ReadFromSRAM();
void SaveToSRAM();
};

View File

@@ -44,6 +44,7 @@ on early-init
# Loading kernel modules in background
start vendor.insmod_sh
write /sys/module/dm_verity/parameters/prefetch_cluster 0
on init
# Disable UFS powersaving
write /sys/devices/soc/${ro.boot.bootdevice}/clkscale_enable 0
@@ -93,59 +94,6 @@ on init
write /dev/stune/top-app/schedtune.boost 10
write /dev/stune/top-app/schedtune.prefer_idle 1
# Setup cpusets used by the VR services.
mkdir /dev/cpuset/kernel 0750 root system
write /dev/cpuset/kernel/cpus 0
write /dev/cpuset/kernel/mems 0
chown system system /dev/cpuset/kernel/tasks
chmod 0660 /dev/cpuset/kernel/tasks
mkdir /dev/cpuset/system 0750 root system
write /dev/cpuset/system/cpus 0
write /dev/cpuset/system/mems 0
chown system system /dev/cpuset/system/tasks
chmod 0660 /dev/cpuset/system/tasks
mkdir /dev/cpuset/system/performance 0750 root system
write /dev/cpuset/system/performance/cpus 0
write /dev/cpuset/system/performance/mems 0
chown system system /dev/cpuset/system/performance/tasks
chmod 0660 /dev/cpuset/system/performance/tasks
mkdir /dev/cpuset/system/background 0750 root system
write /dev/cpuset/system/background/cpus 0
write /dev/cpuset/system/background/mems 0
chown system system /dev/cpuset/system/background/tasks
chmod 0660 /dev/cpuset/system/background/tasks
mkdir /dev/cpuset/application 0750 root system
write /dev/cpuset/application/cpus 0
write /dev/cpuset/application/mems 0
chown system system /dev/cpuset/application/tasks
chmod 0660 /dev/cpuset/application/tasks
mkdir /dev/cpuset/application/performance 0750 root system
write /dev/cpuset/application/performance/cpus 0
write /dev/cpuset/application/performance/mems 0
chown system system /dev/cpuset/application/performance/tasks
chmod 0660 /dev/cpuset/application/performance/tasks
mkdir /dev/cpuset/application/background 0750 root system
write /dev/cpuset/application/background/cpus 0
write /dev/cpuset/application/background/mems 0
chown system system /dev/cpuset/application/background/tasks
chmod 0660 /dev/cpuset/application/background/tasks
# Create UDS structure for base VR services.
mkdir /dev/socket/pdx 0775 system system
mkdir /dev/socket/pdx/system 0775 system system
mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
mkdir /dev/socket/pdx/system/performance 0775 system system
mkdir /dev/socket/pdx/system/vr 0775 system system
mkdir /dev/socket/pdx/system/vr/display 0775 system system
mkdir /dev/socket/pdx/system/vr/pose 0775 system system
mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
# Disable retention
write /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled N
write /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled N
@@ -211,6 +159,7 @@ on late-fs
# Start devices by sysfs trigger
start vendor.devstart_sh
# Start services for bootanim
start vendor.power-hal-1-3
start surfaceflinger
start bootanim
start vendor.hwcomposer-2-1
@@ -288,8 +237,6 @@ on zygote-start
chown radio radio /data/vendor/ipa
# Create the directories used by the Wireless subsystem
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
mkdir /data/vendor/wifi 0771 wifi wifi
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
@@ -408,6 +355,8 @@ on early-boot
chown system system /sys/class/leds/vibrator/device/ol_lra_period
chown system system /sys/class/leds/vibrator/device/autocal
chown system system /sys/class/leds/vibrator/device/lp_trigger_effect
chown system system /sys/class/leds/vibrator/device/lra_wave_shape
chown system system /sys/class/leds/vibrator/device/od_clamp
# Permission for LED driver
chown system system /sys/class/leds/red/on_off_ms
@@ -448,17 +397,6 @@ on boot
write /proc/sys/net/core/rmem_max 8388608
write /proc/sys/net/core/wmem_max 8388608
# Update DVR cpusets to boot-time values.
write /dev/cpuset/kernel/cpus 0-7
write /dev/cpuset/system/cpus 0-7
write /dev/cpuset/system/performance/cpus 0-7
write /dev/cpuset/system/background/cpus 0-7
write /dev/cpuset/system/cpus 0-7
write /dev/cpuset/application/cpus 0-7
write /dev/cpuset/application/performance/cpus 0-7
write /dev/cpuset/application/background/cpus 0-7
write /dev/cpuset/application/cpus 0-7
# Bluetooth
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
@@ -475,9 +413,6 @@ on boot
# Make the ftm4 command node writeable from dumpstate
chown system system /sys/devices/virtual/input/ftm4_touch/cmd
# ftm4 VR mode
chown system system /sys/devices/virtual/input/ftm4_touch/vrmode
# WLAN debug access
chown system system /d/icnss/stats
@@ -573,15 +508,6 @@ on property:sys.boot_completed=1
write /dev/cpuset/system-background/cpus 0-3
write /dev/cpuset/restricted/cpus 0-3
# Update DVR cpusets to runtime values.
write /dev/cpuset/kernel/cpus 2,3
write /dev/cpuset/system/performance/cpus 6-7
write /dev/cpuset/system/background/cpus 0-1
write /dev/cpuset/system/cpus 0-1,6-7
write /dev/cpuset/application/performance/cpus 4-5
write /dev/cpuset/application/background/cpus 0-1
write /dev/cpuset/application/cpus 0-1,4-5
# UFS health
chmod 755 /sys/kernel/debug/ufshcd0
chmod 644 /sys/kernel/debug/ufshcd0/err_state
@@ -676,21 +602,6 @@ service vendor.tftp_server /vendor/bin/tftp_server
user root
group root system
service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
-O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -dd \
-g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
interface android.hardware.wifi.supplicant@1.0::ISupplicant default
interface android.hardware.wifi.supplicant@1.1::ISupplicant default
interface android.hardware.wifi.supplicant@1.2::ISupplicant default
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service vendor.cnss-daemon /vendor/bin/cnss-daemon -n -l
class late_start
user system
@@ -787,20 +698,12 @@ on property:sys.uidcpupower=0
write /proc/uid_cpupower/enable 0
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B -z \
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
service bugreport /system/bin/dumpstate -d -p -z
class main
disabled
oneshot
keycodes 114 115 116
service vendor.chre /vendor/bin/chre
class late_start
user system
group system
socket chre seqpacket 0660 root system
shutdown critical
service vendor.power_sh /vendor/bin/init.power.sh
class main
user root
@@ -836,31 +739,6 @@ on property:sys.retaildemo.enabled=1
setprop persist.vendor.charge.start.level 30
on property:sys.boot_completed=1
# Create pixel-trace.
# At this moment, only mm_event is available. If others want to put more,
# it should get hard review from pixel-perf-team.
mkdir /sys/kernel/debug/tracing/instances/pixel-trace 755 system system
chown system system /sys/kernel/debug/tracing/instances/pixel-trace/trace
chmod 0660 /sys/kernel/debug/tracing/instances/pixel-trace/trace
chown system system /sys/kernel/debug/tracing/instances/pixel-trace/tracing_on
chmod 0660 /sys/kernel/debug/tracing/instances/pixel-trace/tracing_on
write /sys/kernel/debug/tracing/instances/pixel-trace/buffer_size_kb 64
write /sys/kernel/debug/tracing/instances/pixel-trace/events/mm_event/enable 1
# turns off tracing right before bugreporting to keep more traces
on property:init.svc.dumpstatez=running
write /d/tracing/instances/pixel-trace/tracing_on 0
on property:init.svc.dumpstatez=stopped
write /d/tracing/instances/pixel-trace/tracing_on 1
on property:init.svc.bugreport=running
write /d/tracing/instances/pixel-trace/tracing_on 0
on property:init.svc.bugreport=stopped
write /d/tracing/instances/pixel-trace/tracing_on 1
# 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

100
init.hardware.xr.rc Normal file
View File

@@ -0,0 +1,100 @@
#
# Copyright (C) 2019 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# This file inherits from init.${ro.boot.hardware.platform}.rc plus additional
# configs only used by XR targets.
#
import /vendor/etc/init/hw/init.${ro.hardware}.common.rc
on init
# Setup cpusets used by the VR services.
mkdir /dev/cpuset/kernel 0750 root system
write /dev/cpuset/kernel/cpus 0
write /dev/cpuset/kernel/mems 0
chown system system /dev/cpuset/kernel/tasks
chmod 0660 /dev/cpuset/kernel/tasks
mkdir /dev/cpuset/system 0750 root system
write /dev/cpuset/system/cpus 0
write /dev/cpuset/system/mems 0
chown system system /dev/cpuset/system/tasks
chmod 0660 /dev/cpuset/system/tasks
mkdir /dev/cpuset/system/performance 0750 root system
write /dev/cpuset/system/performance/cpus 0
write /dev/cpuset/system/performance/mems 0
chown system system /dev/cpuset/system/performance/tasks
chmod 0660 /dev/cpuset/system/performance/tasks
mkdir /dev/cpuset/system/background 0750 root system
write /dev/cpuset/system/background/cpus 0
write /dev/cpuset/system/background/mems 0
chown system system /dev/cpuset/system/background/tasks
chmod 0660 /dev/cpuset/system/background/tasks
mkdir /dev/cpuset/application 0750 root system
write /dev/cpuset/application/cpus 0
write /dev/cpuset/application/mems 0
chown system system /dev/cpuset/application/tasks
chmod 0660 /dev/cpuset/application/tasks
mkdir /dev/cpuset/application/performance 0750 root system
write /dev/cpuset/application/performance/cpus 0
write /dev/cpuset/application/performance/mems 0
chown system system /dev/cpuset/application/performance/tasks
chmod 0660 /dev/cpuset/application/performance/tasks
mkdir /dev/cpuset/application/background 0750 root system
write /dev/cpuset/application/background/cpus 0
write /dev/cpuset/application/background/mems 0
chown system system /dev/cpuset/application/background/tasks
chmod 0660 /dev/cpuset/application/background/tasks
# Create UDS structure for base VR services.
mkdir /dev/socket/pdx 0775 system system
mkdir /dev/socket/pdx/system 0775 system system
mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
mkdir /dev/socket/pdx/system/performance 0775 system system
mkdir /dev/socket/pdx/system/vr 0775 system system
mkdir /dev/socket/pdx/system/vr/display 0775 system system
mkdir /dev/socket/pdx/system/vr/pose 0775 system system
mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
on boot
# Update DVR cpusets to boot-time values.
write /dev/cpuset/kernel/cpus 0-7
write /dev/cpuset/system/cpus 0-7
write /dev/cpuset/system/performance/cpus 0-7
write /dev/cpuset/system/background/cpus 0-7
write /dev/cpuset/system/cpus 0-7
write /dev/cpuset/application/cpus 0-7
write /dev/cpuset/application/performance/cpus 0-7
write /dev/cpuset/application/background/cpus 0-7
write /dev/cpuset/application/cpus 0-7
# ftm4 VR mode
chown system system /sys/devices/virtual/input/ftm4_touch/vrmode
on property:sys.boot_completed=1
# Update DVR cpusets to runtime values.
write /dev/cpuset/kernel/cpus 2,3
write /dev/cpuset/system/performance/cpus 6-7
write /dev/cpuset/system/background/cpus 0-1
write /dev/cpuset/system/cpus 0-1,6-7
write /dev/cpuset/application/performance/cpus 4-5
write /dev/cpuset/application/background/cpus 0-1
write /dev/cpuset/application/cpus 0-1,4-5

View File

@@ -2,7 +2,7 @@
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
<version>5.0</version>
<version>6.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
@@ -11,7 +11,7 @@
<hal format="hidl">
<name>android.hardware.audio.effect</name>
<transport>hwbinder</transport>
<version>5.0</version>
<version>6.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
@@ -20,7 +20,7 @@
<hal format="hidl">
<name>android.hardware.biometrics.fingerprint</name>
<transport>hwbinder</transport>
<version>2.1</version>
<version>2.2</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
@@ -94,8 +94,6 @@
</interface>
<fqname>@1.2::ICryptoFactory/clearkey</fqname>
<fqname>@1.2::IDrmFactory/clearkey</fqname>
<fqname>@1.2::ICryptoFactory/widevine</fqname>
<fqname>@1.2::IDrmFactory/widevine</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.dumpstate</name>
@@ -294,33 +292,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.usb</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.usb.gadget</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IUsbGadget</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.vibrator</name>
<transport>hwbinder</transport>
<version>1.2</version>
<interface>
<name>IVibrator</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.weaver</name>
<transport>hwbinder</transport>
@@ -330,33 +301,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.wifi</name>
<transport>hwbinder</transport>
<version>1.3</version>
<interface>
<name>IWifi</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.wifi.hostapd</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>IHostapd</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.wifi.supplicant</name>
<transport>hwbinder</transport>
<version>1.2</version>
<interface>
<name>ISupplicant</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>com.qualcomm.qti.ims.radio</name>
<transport>hwbinder</transport>

View File

@@ -45,6 +45,7 @@
</MediaCodec>
<MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
<Limit name="measured-frame-rate-320x240" range="35-36" /> <!-- N=32 v93%=1.0 -->
<Limit name="measured-frame-rate-720x480" range="5-15" /> <!-- N=12 manual -->
</MediaCodec>
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
<Limit name="measured-frame-rate-176x144" range="200-206" /> <!-- N=32 v93%=1.0 -->
@@ -74,6 +75,7 @@
</MediaCodec>
<MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
<Limit name="measured-frame-rate-176x144" range="547-547" /> <!-- N=32 v93%=1.1 -->
<Limit name="measured-frame-rate-352x288" range="442-442" /> <!-- N=40 v95%=1.0 -->
</MediaCodec>
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
<Limit name="measured-frame-rate-320x240" range="249-251" /> <!-- N=32 v93%=1.0 -->

View File

@@ -126,6 +126,13 @@
<item>"softap.*"</item>
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable
Wifi P2P interfaces. If the device doesn't want to support tethering over Wifi P2p this
should be empty. An example would be "p2p-p2p.*" -->
<string-array translatable="false" name="config_tether_wifi_p2p_regexs">
<item>"p2p\\d"</item>
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable
bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
should be empty. -->
@@ -201,22 +208,6 @@
<!-- Mask to use when checking skb mark defined in config_networkWakeupPacketMark above. -->
<integer name="config_networkWakeupPacketMask">0x80000000</integer>
<!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
<bool translatable="false" name="config_wifi_dual_band_support">true</bool>
<!-- Boolean indicating whether 802.11r Fast BSS Transition is enabled on this platform -->
<bool translatable="false" name="config_wifi_fast_bss_transition_enabled">true</bool>
<!-- Boolean indicating whether the wifi chipset has background scan support -->
<bool translatable="false" name="config_wifi_background_scan_support">true</bool>
<!-- Integer thresholds, do not connect to APs with RSSI lower than these values -->
<integer translatable="false" name="config_wifi_framework_wifi_score_entry_rssi_threshold_5GHz">-77</integer>
<integer translatable="false" name="config_wifi_framework_wifi_score_entry_rssi_threshold_24GHz">-80</integer>
<!-- Integer thresholds for low network score, should be somewhat less than the entry threshholds -->
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_5GHz">-80</integer>
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_24GHz">-83</integer>
<!-- Vibrator pattern for feedback about a long screen/key press -->
<integer-array name="config_longPressVibePattern">
<item>8</item>
@@ -230,16 +221,6 @@
<!-- Make things go fast -->
<bool name="config_ui_enableFadingMarquee">false</bool>
<!-- Wifi driver supports batched scan -->
<bool translatable="false" name="config_wifi_batched_scan_supported">true</bool>
<!-- Boolean indicating whether or not to revert to default country code when cellular
radio is unable to find any MCC information to infer wifi country code from -->
<bool translatable="false" name="config_wifi_revert_country_code_on_cellular_loss">false</bool>
<!-- Boolean indicating whether or not wifi should turn off when emergency call is made -->
<bool translatable="false" name="config_wifi_turn_off_during_emergency_call">true</bool>
<!-- Enable doze mode
ComponentName of a dream to show whenever the system would otherwise have gone to sleep. -->
<string translatable="false" name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
@@ -302,13 +283,6 @@
<item>lte:524288,1048576,8388608,262144,524288,4194304</item>
</string-array>
<!-- Configure wifi tcp buffersizes in the form:
rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max -->
<string name="config_wifi_tcp_buffers" translatable="false">524288,2097152,8388608,262144,524288,4194304</string>
<!-- Config SoftAP 2G channel list -->
<string translatable="false" name="config_wifi_framework_sap_2G_channel_list">6</string>
<!-- Config determines whether to update phone object when voice registration
state changes. Voice radio tech change will always trigger an update of
phone object irrespective of this config -->
@@ -324,8 +298,6 @@
<item>"/system/framework/framework.jar"</item>
<item>"/system/framework/oat/arm64/services.odex"</item>
<item>"/system/framework/services.jar"</item>
<item>"/system/framework/arm64/boot.oat"</item>
<item>"/system/framework/arm64/boot-core-libart.oat"</item>
<item>"/apex/com.android.art/javalib/core-oj.jar"</item>
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
<item>"/apex/com.android.media/javalib/updatable-media.jar"</item>
@@ -334,12 +306,10 @@
<!-- Should the pinner service pin the Camera application? -->
<bool name="config_pinnerCameraApp">true</bool>
<!-- List of files pinned by the Pinner Service with the apex boot image b/119800099 -->
<string-array translatable="false" name="config_apexBootImagePinnerServiceFiles">
<!-- List of files pinned by the Pinner Service with the JIT Zygote boot image b/119800099 -->
<string-array translatable="false" name="config_jitzygoteBootImagePinnerServiceFiles">
<item>"/system/framework/framework.jar"</item>
<item>"/system/framework/services.jar"</item>
<item>"/system/framework/arm64/apex.oat"</item>
<item>"/system/framework/arm64/apex-core-libart.oat"</item>
<item>"/apex/com.android.art/javalib/core-oj.jar"</item>
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
<item>"/apex/com.android.media/javalib/updatable-media.jar"</item>
@@ -359,13 +329,4 @@
<!-- Brand value for attestation of misprovisioned device. -->
<string name="config_misprovisionedBrandValue" translatable="false">htc</string>
<!-- True if the firmware supports connected MAC randomization -->
<bool name="config_wifi_connected_mac_randomization_supported">true</bool>
<!-- True if the firmware supports Wi-Fi link probing -->
<bool name="config_wifi_link_probing_supported">true</bool>
<!-- True if the firmware supports p2p MAC randomization -->
<bool name="config_wifi_p2p_mac_randomization_supported">true</bool>
</resources>

View File

@@ -31,6 +31,13 @@
always-on display) -->
<string name="doze_brightness_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
<!-- Override value to use for proximity sensor. -->
<string name="proximity_sensor_type" translatable="false">com.google.sensor.binned_brightness</string>
<!-- If using proximity_sensor_type, specifies a threshold value to distinguish near and
far break points.-->
<item name="proximity_sensor_threshold" translatable="false" format="float" type="dimen">1</item>
<!-- Doze: can we assume the pickup sensor includes a proximity check? -->
<bool name="doze_pickup_performs_proximity_check">true</bool>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2017, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<resources>
<bool name="profile_supported_sap">true</bool>
<bool name="profile_supported_hearing_aid">true</bool>
</resources>

View File

@@ -28,7 +28,6 @@ cc_binary {
"libbase",
"libcutils",
"libhidlbase",
"libhidltransport",
"libfmq",
"liblog",
"libutils",

View File

@@ -75,8 +75,8 @@ bool EaselStateResidencyDataProvider::getResults(
PowerEntityStateResidencyResult result = {
.powerEntityId = mPowerEntityId,
.stateResidencyData = {{.powerEntityStateId = EASEL_SYNTHETIC_SLEEP_ID,
.totalStateEntryCount = mTotalOnSnapshotCount,
.totalTimeInStateMs = mTotalNotOnSnapshotCount,
.totalStateEntryCount = mTotalOnSnapshotCount,
.lastEntryTimestampMs = 0}}
};

View File

@@ -0,0 +1,7 @@
runtime_resource_overlay {
name: "WifiOverlay",
theme: "WifiOverlay",
certificate: "platform",
sdk_version: "current",
product_specific: true
}

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Pixel specific wifi overlays -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.wifi.resources.pixel"
android:versionCode="1"
android:versionName="1.0">
<application android:hasCode="false" />
<overlay
android:targetPackage="com.android.wifi.resources"
android:targetName="WifiCustomization"
android:isStatic="true"
android:priority="0"/>
</manifest>

View File

@@ -0,0 +1,5 @@
# People who can approve changes for submission
etancohen@google.com
kumaranand@google.com
kumachang@google.com
satk@google.com

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<resources>
<!-- Boolean indicating whether the wifi chipset has 5GHz frequency band support -->
<bool translatable="false" name="config_wifi5ghzSupport">true</bool>
<!-- Boolean indicating whether 802.11r Fast BSS Transition is enabled on this platform -->
<bool translatable="false" name="config_wifi_fast_bss_transition_enabled">true</bool>
<!-- Boolean indicating whether the wifi chipset has background scan support -->
<bool translatable="false" name="config_wifi_background_scan_support">true</bool>
<!-- Integer thresholds, do not connect to APs with RSSI lower than these values -->
<integer translatable="false" name="config_wifi_framework_wifi_score_entry_rssi_threshold_5GHz">-77</integer>
<integer translatable="false" name="config_wifi_framework_wifi_score_entry_rssi_threshold_24GHz">-80</integer>
<!-- Integer thresholds for low network score, should be somewhat less than the entry thresholds -->
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_5GHz">-80</integer>
<integer translatable="false" name="config_wifi_framework_wifi_score_bad_rssi_threshold_24GHz">-83</integer>
<!-- Boolean indicating whether or not to revert to default country code when cellular
radio is unable to find any MCC information to infer wifi country code from -->
<bool translatable="false" name="config_wifi_revert_country_code_on_cellular_loss">false</bool>
<!-- Boolean indicating whether or not wifi should turn off when emergency call is made -->
<bool translatable="false" name="config_wifi_turn_off_during_emergency_call">true</bool>
<!-- Configure wifi tcp buffersizes in the form:
rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max -->
<string name="config_wifi_tcp_buffers" translatable="false">524288,2097152,8388608,262144,524288,4194304</string>
<!-- Enable ACS (auto channel selection) for Wifi hotspot (SAP) -->
<bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>
<!-- Enable 802.11ac for Wifi hotspot (SAP) -->
<bool translatable="false" name="config_wifi_softap_ieee80211ac_supported">true</bool>
<!-- True if the firmware supports connected MAC randomization -->
<bool name="config_wifi_connected_mac_randomization_supported">true</bool>
<!-- True if the firmware supports p2p MAC randomization -->
<bool name="config_wifi_p2p_mac_randomization_supported">true</bool>
<!-- True if the firmware supports ap MAC randomization -->
<bool name="config_wifi_ap_mac_randomization_supported">true</bool>
<!-- True if the firmware supports Wi-Fi link probing -->
<bool name="config_wifi_link_probing_supported">true</bool>
<!-- Idle Receive current for wifi radio. 0 by default-->
<integer translatable="false" name="config_wifi_idle_receive_cur_ma">1</integer>
<!-- Rx current for wifi radio. 0 by default-->
<integer translatable="false" name="config_wifi_active_rx_cur_ma">100</integer>
<!-- Tx current for wifi radio. 0 by default-->
<integer translatable="false" name="config_wifi_tx_cur_ma">250</integer>
<!-- Operating volatage for wifi radio. 0 by default-->
<integer translatable="false" name="config_wifi_operating_voltage_mv">3800</integer>
<!-- Indicates that a full bugreport should be triggered when wifi diagnostics detects an error on non-user (i.e debug) builds -->
<bool translatable="false" name="config_wifi_diagnostics_bugreport_enabled">true</bool>
<!-- Default access point SSID used for tethering -->
<string name="wifi_tether_configure_ssid_default" translatable="false">Pixel</string>
<!-- Integer indicating maximum hardware supported client number of soft ap -->
<integer translatable="false" name="config_wifiHardwareSoftapMaxClientCount">32</integer>
<!-- Boolean indicating whether framework needs to set the tx power limit for meeting SAR
requirements -->
<bool translatable="false" name="config_wifi_framework_enable_sar_tx_power_limit">true</bool>
</resources>

View File

@@ -4,3 +4,7 @@ user=system seinfo=platform name=.dataservices domain=dataservice_app type=syste
# Domain for WfcActivation app
user=_app seinfo=wfcactivation name=com.google.android.wfcactivation domain=wfc_activation_app levelFrom=all
# Domain for Sprint Hidden Menu
user=_app isPrivApp=true seinfo=platform name=com.google.android.hiddenmenu domain=sprint_hidden_menu type=app_data_file levelFrom=all

View File

@@ -0,0 +1,9 @@
type sprint_hidden_menu, domain, coredomain;
app_domain(sprint_hidden_menu)
net_domain(sprint_hidden_menu)
# Services
allow sprint_hidden_menu app_api_service:service_manager find;
allow sprint_hidden_menu qchook_service:service_manager find;
allow sprint_hidden_menu radio_service:service_manager find;

View File

@@ -1,2 +1,5 @@
# For the camera app
get_prop(appdomain, camera_prop)
dontaudit appdomain sysfs_msm_subsys:dir search;
dontaudit appdomain sysfs_msm_subsys:file r_file_perms;

View File

@@ -8,3 +8,6 @@ dontaudit bootanim system_data_file:dir read;
# TODO(b/37205419): Remove upon resolution
dontaudit bootanim kernel:system module_request;
dontaudit bootanim sysfs_msm_subsys:dir search;
dontaudit bootanim sysfs_msm_subsys:file r_file_perms;

View File

@@ -8,4 +8,7 @@ allow cameraserver sysfs_camera:dir search;
allow cameraserver system_server:unix_stream_socket { read write };
dontaudit cameraserver sysfs_msm_subsys:dir search;
dontaudit cameraserver sysfs_msm_subsys:file r_file_perms;
binder_call(cameraserver, mediacodec)

View File

@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIF1TCCA72gAwIBAgIVAPZ4KZV2jpxRBCoVAidCu62l3cDqMA0GCSqGSIb3DQEBCwUAMHsxCzAJ
BgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQw
EgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEXMBUGA1UEAwwOY29tX2dvb2ds
ZV9tZHMwHhcNMTkwNDIyMTQ1NzA1WhcNNDkwNDIyMTQ1NzA1WjB7MQswCQYDVQQGEwJVUzETMBEG
A1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xl
IEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxFzAVBgNVBAMMDmNvbV9nb29nbGVfbWRzMIICIjANBgkq
hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqgNC0hhI3NzaPUllJfe01hCTuEpl35D02+DKJ5prPFxv
6KGTk6skjZOwV87Zf2pyj/cbnv28ioDjwvqMBe4ntFdKtH9gl2tTAVl69HMKXF4Iny/wnrt2mxzh
WxFUd5PuW+mWug+UQw/NGUuaf5d/yys/RrchHKM1+zBV6aOzH6BXiwDoOF2i43d5GlNQ/tFuMySW
LJftJN0QULFelxNDFFJZhw2P3c4opxjmF2yCoIiDfBEIhTZFKUbHX6YDLXmtUpXl35q+cxK4TCxP
URyzwdfiyheF3TTxagfzhvXNg/ifrY67S4qCGfzoEMPxrTz02gS0u3D6r/2+hl9vAJChLKDNdIs6
TqIw+YnABrELiZLLFnaABnjQ7xC3xv1s3W6dWxaxnoVMtC1YvdgwhC5gSpJ4A+AGcCLv96hoeB1I
IoGV9Yt0Z97MFpXeHFpAxFZ1F9feBqwOCDbu50dmdKZvqGHZ4Ts3uy7ukDQ08dquHpT+NmqkmmW5
GGhkuyZS3HHpU/QeVsZiyJCJBbDe5lz6NGXK56ruuF9ILeGHtldjQm40oYRc01ESScyVjSU0kpMO
C7hn1B7rKAm8xxG7eH04ieQrNnbbee7atOO4C3157W5CqujfLMeo6OCRVtcYkYIuSi8hIPNySu/q
OaEtEP4owVNZR0H6mCHy5pANsyBofMkCAwEAAaNQME4wDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQU
gk8pmLx8yP3RILwR5am1G10PBEowHwYDVR0jBBgwFoAUgk8pmLx8yP3RILwR5am1G10PBEowDQYJ
KoZIhvcNAQELBQADggIBAC9iQ1huo6CzjcsB1IIw3WYPYVfHtvG7fiB49QO6cjth8fxM36YOxnMz
K9Zh89cnFx7BeXG4MdbR3lAWO+wTbEpM/5azAQfqHB/ZEEAo1THtqS58C1bTwJ5zxkA+wL/x1ucT
EV0QZtPHC1K5nIV5FuICiJjui5FHfj2HYu2A5a5729rdZ7sL8Vgx6TUFKpEPs5iCrlx5X/E+/wJa
DM5iIjVvrGJJq0VWHHeDJEE+Sw1CDxWYRzvu1WvCvhk149hf4LlfrR0A5t8QJRGx0WwF10DLGgJx
7epMBpzhMIXc529FTIx4Rx2PcufjTZC9EN7PkLgVfYahWEkt/YIfV/0F6U6viLxdNC5O0pimSV57
vT6HIthX1OC34eZca0cPqH1kOuhRDKOhbP4yIgdYX6knpvw8aXsYcyTfAmDyrt0EWffeBPedaxMo
xfijdlsBQUymviUQ8qBbfl1Ew9VoC+VEsiobK7Ubog0IK+82LQ7FOLMoNYnhk5wJ63i1kVvBVAgH
64PMME2KG//BwYFfKK6jUXibabyNke72+1Jr0xpw1BHJPxNJ8Q8yCBLF0wmXmFJSM+9lSDd10Bni
FJeMFMQ0T1Sf8GUSIxYYbMK5pDguRs+JOYkUID02ylJ3L6GAnxXCjGWzpdxw29/WWJc+qsYFEIbP
kKzTUNQHaaLHmcLK22Ht
-----END CERTIFICATE-----

View File

@@ -7,7 +7,6 @@ type dsp_device, dev_type;
type easel_device, dev_type;
type hbtp_device, dev_type;
type ipa_dev, dev_type;
type latency_device, dev_type;
type modem_block_device, dev_type;
type persist_block_device, dev_type;
type pn81a_device, dev_type;

View File

@@ -19,6 +19,7 @@ type sysfs_usb_c, sysfs_type, fs_type;
type sysfs_usb_device, sysfs_type, fs_type;
# b/70518189 vDSO experiments
type sysfs_vdso, fs_type, sysfs_type;
type sysfs_wifi_conmode, sysfs_type, fs_type;
type debugfs_clk, debugfs_type, fs_type;
type debugfs_ion, debugfs_type, fs_type;

View File

@@ -9,7 +9,6 @@
/dev/ipa u:object_r:ipa_dev:s0
/dev/wwan_ioctl u:object_r:ipa_dev:s0
/dev/ipaNatTable u:object_r:ipa_dev:s0
/dev/cpu_dma_latency u:object_r:latency_device:s0
/dev/rmnet_ctrl.* u:object_r:rmnet_device:s0
/dev/at_.* u:object_r:at_device:s0
/dev/video([0-9])+ u:object_r:video_device:s0
@@ -167,7 +166,6 @@
/vendor/bin/oemlock_provision u:object_r:hal_bootctl_default_exec:s0
/vendor/bin/oemlock-bridge u:object_r:hal_bootctl_default_exec:s0
/vendor/bin/hw/android\.hardware\.usb@1\.1-service\.wahoo u:object_r:hal_usb_impl_exec:s0
/vendor/bin/hw/android\.hardware\.power@1\.3-service\.pixel-libperfmgr u:object_r:hal_power_default_exec:s0
/vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.pixel u:object_r:hal_power_stats_default_exec:s0
/vendor/bin/chre u:object_r:chre_exec:s0
/vendor/bin/time_daemon u:object_r:time_daemon_exec:s0
@@ -178,22 +176,20 @@
/vendor/etc/init\.insmod\.cfg u:object_r:init-insmod-sh_exec:s0
/vendor/bin/init\.power\.sh u:object_r:init_power_exec:s0
/vendor/bin/init\.radio\.sh u:object_r:init_radio_exec:s0
/vendor/bin/thermal_logd u:object_r:init-thermal-logging-sh_exec:s0
/vendor/bin/ramoops u:object_r:ramoops_exec:s0
/vendor/bin/init\.ramoops\.sh u:object_r:ramoops_exec:s0
/vendor/bin/init\.fingerprint\.sh u:object_r:init-fingerprint_exec:s0
/vendor/bin/wifi_sniffer u:object_r:wifi_sniffer_exec:s0
/vendor/bin/hw/android\.hardware\.bluetooth@1\.0-service-qti u:object_r:hal_bluetooth_default_exec:s0
/vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service\.clearkey u:object_r:hal_drm_clearkey_exec:s0
/vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service-lazy\.clearkey u:object_r:hal_drm_clearkey_exec:s0
/vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service\.widevine u:object_r:hal_drm_widevine_exec:s0
/vendor/bin/hw/android\.hardware\.drm@[0-9]+\.[0-9]+-service-lazy\.widevine u:object_r:hal_drm_widevine_exec:s0
/vendor/bin/hw/android\.hardware\.vibrator@1\.2-service\.wahoo u:object_r:hal_vibrator_default_exec:s0
/vendor/bin/hw/android\.hardware\.health@2\.0-service\.wahoo u:object_r:hal_health_default_exec:s0
/vendor/bin/hw/android\.hardware\.keymaster@3\.0-service-qti u:object_r:hal_keymaster_qti_exec:s0
/vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service-qti u:object_r:hal_gatekeeper_qti_exec:s0
/vendor/bin/hw/android\.hardware\.gnss@1\.0-service-qti u:object_r:hal_gnss_qti_exec:s0
/vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.pixel u:object_r:hal_thermal_default_exec:s0
###############################################
# same-process HAL files and their dependencies
@@ -207,7 +203,7 @@
/vendor/lib(64)?/libadreno_utils\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libgsl\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/hw/vulkan\.msm8998\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/hw/vulkan\.adreno\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/egl/libEGL_adreno\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/egl/libGLESv1_CM_adreno\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/egl/libGLESv2_adreno\.so u:object_r:same_process_hal_file:s0

View File

@@ -46,8 +46,6 @@ genfscon sysfs /devices/soc/soc:qcom,ipa_fws@1e08000 u:object
genfscon sysfs /devices/soc/cce0000.qcom,venus u:object_r:sysfs_msm_subsys:s0
genfscon sysfs /devices/soc/0.qcom,rmtfs_sharedmem u:object_r:sysfs_rmtfs:s0
genfscon sysfs /devices/soc/soc:fp_fpc1020 u:object_r:sysfs_fingerprint:s0
genfscon sysfs /class/thermal u:object_r:sysfs_thermal:s0
genfscon sysfs /devices/virtual/thermal u:object_r:sysfs_thermal:s0
genfscon sysfs /devices/virtual/wahoo_laser u:object_r:sysfs_laser:s0
genfscon sysfs /module/msm_thermal u:object_r:sysfs_thermal:s0
genfscon sysfs /module/printk/parameters/console_suspend u:object_r:sysfs_console_suspend:s0
@@ -64,6 +62,7 @@ genfscon sysfs /devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:
genfscon sysfs /devices/soc/800f000.qcom,spmi/spmi-0/spmi0-02/800f000.qcom,spmi:qcom,pmi8998@2:qcom,qpnp-smb2/power_supply u:object_r:sysfs_batteryinfo:s0
genfscon sysfs /bus/msm_subsys u:object_r:sysfs_msm_subsys:s0
genfscon sysfs /module/subsystem_restart u:object_r:sysfs_msm_subsys_restart:s0
genfscon sysfs /module/wlan/parameters/con_mode u:object_r:sysfs_wifi_conmode:s0
genfscon sysfs /kernel/boot_adsp/boot u:object_r:sysfs_msm_subsys:s0
genfscon sysfs /kernel/boot_slpi/boot u:object_r:sysfs_msm_subsys:s0
genfscon sysfs /kernel/wifi/wlan u:object_r:sysfs_msm_wlan:s0

View File

@@ -1 +1,4 @@
dontaudit hal_graphics_allocator_default kernel:system module_request;
dontaudit hal_graphics_allocator_default sysfs_msm_subsys:dir search;
dontaudit hal_graphics_allocator_default sysfs_msm_subsys:file r_file_perms;

View File

@@ -4,15 +4,10 @@ allow hal_power_default sysfs_graphics:file r_file_perms;
# To do powerhint on nodes defined in powerhint.json
allow hal_power_default sysfs_msm_subsys:dir search;
allow hal_power_default sysfs_msm_subsys:file rw_file_perms;
allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms;
allow hal_power_default latency_device:chr_file rw_file_perms;
allow hal_power_default cgroup:dir search;
allow hal_power_default cgroup:file rw_file_perms;
allow hal_power_default sysfs_touch:file w_file_perms;
allow hal_power_default sysfs_touch:dir search;
# To get/set powerhal state property
set_prop(hal_power_default, power_prop)
# interact with thermal_config
set_prop(hal_power_default, thermal_prop)
set_prop(hal_power_default, vendor_thermal_prop)

View File

@@ -1,7 +0,0 @@
allow hal_thermal_default sysfs_thermal:dir r_dir_perms;
allow hal_thermal_default sysfs_thermal:file r_file_perms;
allow hal_thermal_default sysfs_thermal:lnk_file read;
allow hal_thermal_default proc_stat:file r_file_perms;
# read thermal_config
get_prop(hal_thermal_default, thermal_prop)

View File

@@ -1,10 +0,0 @@
type init-thermal-logging-sh, domain;
type init-thermal-logging-sh_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(init-thermal-logging-sh)
userdebug_or_eng(`
allow init-thermal-logging-sh vendor_toolbox_exec:file rx_file_perms;
allow init-thermal-logging-sh sysfs_thermal:dir r_dir_perms;
allow init-thermal-logging-sh sysfs_thermal:file r_file_perms;
')

View File

@@ -22,3 +22,6 @@ ALL : device/google/wahoo/sepolicy/vendor/certs/arcore_release.x509.pem
ENG : device/google/wahoo/sepolicy/vendor/certs/arcore.x509.pem
USERDEBUG : device/google/wahoo/sepolicy/vendor/certs/arcore.x509.pem
USER : device/google/wahoo/sepolicy/vendor/certs/arcore_userdev.x509.pem
[@MDS]
ALL : device/google/wahoo/sepolicy/vendor/certs/com_google_mds.x509.pem

View File

@@ -42,4 +42,7 @@
<signer signature="@ARCORE_DEV" >
<seinfo value="arcore" />
</signer>
<signer signature="@MDS" >
<seinfo value="mds" />
</signer>
</policy>

10
sepolicy/vendor/omadm.te vendored Normal file
View File

@@ -0,0 +1,10 @@
# OMADM app
type omadm_app, domain;
app_domain(omadm_app)
net_domain(omadm_app)
allow omadm_app app_api_service:service_manager find;
allow omadm_app radio_vendor_data_file:dir rw_dir_perms;
allow omadm_app radio_vendor_data_file:file create_file_perms;
allow omadm_app radio_service:service_manager find;

View File

@@ -11,12 +11,10 @@ type vendor_ssr_prop, property_type;
type cnss_diag_prop, property_type;
type tee_listener_prop, property_type;
type wc_prop, property_type;
type thermal_prop, property_type;
type modem_diag_prop, property_type;
type sys_time_prop, property_type;
type atfwd_start_prop, property_type;
type bluetooth_log_prop, property_type;
type power_prop, property_type;
type vendor_bluetooth_prop, property_type;
type vendor_net_radio_prop, property_type;
type vendor_radio_prop, property_type;
@@ -25,6 +23,7 @@ type vendor_usb_config_prop, property_type;
type vendor_charge_prop, property_type;
type vendor_nfc_prop, property_type;
type vendor_ramoops_prop, property_type;
type vendor_wifi_sniffer_prop, property_type;
# fingerprint
type vendor_fingerprint_prop, property_type;

View File

@@ -17,18 +17,12 @@ vendor.debug.ssrdump u:object_r:vendor_ssr_prop:s0
persist.sys.cnss. u:object_r:cnss_diag_prop:s0
sys.listeners.registered u:object_r:tee_listener_prop:s0
wc_transport. u:object_r:wc_prop:s0
vendor.qcom.thermalcfg u:object_r:thermal_prop:s0
vendor.thermal.config u:object_r:thermal_prop:s0
vendor.qcom.thermalcfg u:object_r:vendor_thermal_prop:s0
persist.sys.modem.diag. u:object_r:modem_diag_prop:s0
sys.modem.diag. u:object_r:modem_diag_prop:s0
sys.time.set u:object_r:sys_time_prop:s0
persist.radio.atfwd.start u:object_r:atfwd_start_prop:s0
sys.logger.bluetooth u:object_r:bluetooth_log_prop:s0
vendor.powerhal.state u:object_r:power_prop:s0
vendor.powerhal.audio u:object_r:power_prop:s0
vendor.powerhal.lpm u:object_r:power_prop:s0
vendor.powerhal.init u:object_r:power_prop:s0
vendor.powerhal.rendering u:object_r:power_prop:s0
vendor.wlan.driver.version u:object_r:vendor_wifi_version:s0
vendor.wlan.firmware.version u:object_r:vendor_wifi_version:s0
persist.vendor.usb.config u:object_r:vendor_usb_config_prop:s0
@@ -173,9 +167,12 @@ ro.radio.log_prefix u:object_r:vendor_default_prop:s0
ro.rfkilldisabled u:object_r:vendor_default_prop:s0
ro.vendor.build.svn u:object_r:vendor_default_prop:s0
ro.vendor.extension_library u:object_r:vendor_default_prop:s0
ro.vibrator.hal.click.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.tick.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.heavyclick.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.closeloop.threshold u:object_r:vendor_default_prop:s0
ro.vibrator.hal.config.dynamic u:object_r:vendor_default_prop:s0
ro.vibrator.hal.click.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.tick.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.heavyclick.duration u:object_r:vendor_default_prop:s0
ro.vibrator.hal.double_click.duration u:object_r:vendor_default_prop:s0
sdm. u:object_r:vendor_default_prop:s0
sys.disable_ext_animation u:object_r:vendor_default_prop:s0
sys.display.low_persistence_mode_brightness u:object_r:vendor_default_prop:s0
@@ -224,3 +221,8 @@ vendor.ramoops. u:object_r:vendor_ramoops_prop:s0
# fingerprint
vendor.fps.init.succeed u:object_r:vendor_fingerprint_prop:s0
vendor.fps.init_retry.count u:object_r:vendor_fingerprint_prop:s0
# wifi_sniffer
persist.vendor.wifi.sniffer.freq u:object_r:vendor_wifi_sniffer_prop:s0
persist.vendor.wifi.sniffer.bandwidth u:object_r:vendor_wifi_sniffer_prop:s0
vendor.wifi.sniffer.start u:object_r:vendor_wifi_sniffer_prop:s0

View File

@@ -1,7 +1,7 @@
user=system seinfo=platform name=com.google.SSRestartDetector domain=ssr_detector_app type=system_app_data_file
user=_app seinfo=platform name=com.android.pixellogger domain=logger_app type=app_data_file levelFrom=all
user=_app seinfo=platform name=com.android.ramdump domain=ramdump_app type=app_data_file levelFrom=all
user=_app seinfo=google name=com.google.mds domain=mds_app type=app_data_file levelFrom=all
user=_app seinfo=mds name=com.google.mds domain=mds_app type=app_data_file levelFrom=all
#TODO Remove user "system" when b/63588267 is resolved
user=system seinfo=platform name=com.qualcomm.telephony domain=qtelephony type=system_app_data_file
@@ -30,3 +30,6 @@ user=_app seinfo=easel name=com.google.android.imaging.easel.service domain=ease
#Domain for connectivity monitor
user=_app isPrivApp=true seinfo=platform name=com.google.android.connectivitymonitor domain=con_monitor_app type=app_data_file levelFrom=all
#Domain for omadm
user=_app isPrivApp=true seinfo=platform name=com.android.omadm.service domain=omadm_app type=app_data_file levelFrom=all

View File

@@ -5,3 +5,6 @@ allow surfaceflinger debugfs_ion:dir search;
typeattribute surfaceflinger system_writes_vendor_properties_violators;
set_prop(surfaceflinger, public_vendor_system_prop)
dontaudit surfaceflinger sysfs_msm_subsys:dir search;
dontaudit surfaceflinger sysfs_msm_subsys:file r_file_perms;

View File

@@ -23,3 +23,6 @@ typeattribute system_server system_writes_vendor_properties_violators;
set_prop(system_server, public_vendor_system_prop)
dontaudit system_server self:capability sys_module;
dontaudit system_server sysfs_msm_subsys:dir search;
dontaudit system_server sysfs_msm_subsys:file r_file_perms;

View File

@@ -22,18 +22,15 @@ userdebug_or_eng(`
set_prop(vendor_init, vendor_bluetooth_prop)
set_prop(vendor_init, camera_prop)
set_prop(vendor_init, modem_diag_prop)
set_prop(vendor_init, power_prop)
set_prop(vendor_init, vendor_power_prop)
set_prop(vendor_init, public_vendor_default_prop)
set_prop(vendor_init, vendor_radio_prop)
set_prop(vendor_init, thermal_prop)
set_prop(vendor_init, vendor_thermal_prop)
set_prop(vendor_init, vendor_charge_prop)
dontaudit vendor_init unlabeled:dir getattr;
dontaudit vendor_init unlabeled:file getattr;
allow vendor_init debugfs_tracing_instances:dir create_dir_perms;
allow vendor_init debugfs_tracing_instances:file w_file_perms;
# Write to touch vrmode node
allow vendor_init sysfs_touch:file w_file_perms;

20
sepolicy/vendor/wifi_sniffer.te vendored Normal file
View File

@@ -0,0 +1,20 @@
type wifi_sniffer, domain;
type wifi_sniffer_exec, exec_type, vendor_file_type, file_type;
userdebug_or_eng(`
# make transition from init to its domain
init_daemon_domain(wifi_sniffer)
net_domain(wifi_sniffer)
# configurate con mode
allow wifi_sniffer self:capability { net_admin net_raw };
allow wifi_sniffer sysfs_wifi_conmode:file rw_file_perms;
# interface up
allowxperm wifi_sniffer self:udp_socket ioctl SIOCSIFFLAGS;
allow wifi_sniffer self:netlink_generic_socket create_socket_perms_no_ioctl;
get_prop(wifi_sniffer, vendor_wifi_sniffer_prop)
dontaudit wifi_sniffer debugfs_wlan:dir search;
')

View File

@@ -10,9 +10,6 @@ persist.rild.nitz_short_ons_2=
persist.rild.nitz_short_ons_3=
DEVICE_PROVISIONED=1
# Set network mode to Global by default and no DSDS/DSDA
ro.telephony.default_network=10
debug.sf.hw=1
debug.gralloc.enable_fb_ubwc=1

View File

@@ -16,17 +16,21 @@ cc_binary {
name: "android.hardware.usb@1.1-service.wahoo",
relative_install_path: "hw",
init_rc: ["android.hardware.usb@1.1-service.wahoo.rc"],
vintf_fragments: [
"android.hardware.usb@1.1-service.wahoo.xml",
"android.hardware.usb.gadget@1.1-service.wahoo.xml",
],
srcs: ["service.cpp", "Usb.cpp", "UsbGadget.cpp"],
shared_libs: [
"libbase",
"libhidlbase",
"libhidltransport",
"liblog",
"libutils",
"libhardware",
"android.hardware.usb@1.0",
"android.hardware.usb@1.1",
"android.hardware.usb.gadget@1.0",
"android.hardware.usb.gadget@1.1",
"libcutils",
],
proprietary: true,

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
#define LOG_TAG "android.hardware.usb.gadget@1.0-service.wahoo"
#define LOG_TAG "android.hardware.usb.gadget@1.1-service.wahoo"
#include "UsbGadget.h"
#include <dirent.h>
@@ -57,7 +57,7 @@ namespace android {
namespace hardware {
namespace usb {
namespace gadget {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
volatile bool gadgetPullup;
@@ -258,6 +258,15 @@ V1_0::Status UsbGadget::tearDownGadget() {
return Status::SUCCESS;
}
Return<Status> UsbGadget::reset() {
if (!WriteStringToFile("none", PULLUP_PATH)) {
ALOGI("Gadget cannot be pulled down");
return Status::ERROR;
}
return Status::SUCCESS;
}
static int linkFunction(const char *function, int index) {
char functionPath[MAX_FILE_PATH_LENGTH];
char link[MAX_FILE_PATH_LENGTH];
@@ -311,18 +320,24 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
if (vendorFunctions == "diag") {
ret = setVidPid("0x05C6", "0x901B");
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee1");
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee1");
}
}
break;
case GadgetFunction::ADB | GadgetFunction::MTP:
if (vendorFunctions == "diag") {
ret = setVidPid("0x05C6", "0x903A");
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee2");
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee2");
}
}
break;
case static_cast<uint64_t>(GadgetFunction::RNDIS):
@@ -331,9 +346,12 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
} else if (vendorFunctions == "serial_cdev,diag") {
ret = setVidPid("0x05C6", "0x90B5");
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee3");
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee3");
}
}
break;
case GadgetFunction::ADB | GadgetFunction::RNDIS:
@@ -342,21 +360,30 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
} else if (vendorFunctions == "serial_cdev,diag") {
ret = setVidPid("0x05C6", "0x90B6");
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee4");
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee4");
}
}
break;
case static_cast<uint64_t>(GadgetFunction::PTP):
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee5");
break;
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee5");
}
break;
case GadgetFunction::ADB | GadgetFunction::PTP:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee6");
break;
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee6");
}
break;
case static_cast<uint64_t>(GadgetFunction::ADB):
if (vendorFunctions == "diag") {
ret = setVidPid("0x05C6", "0x901D");
@@ -365,21 +392,30 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
} else if (vendorFunctions == "diag,serial_cdev") {
ret = setVidPid("0x05C6", "0x901F");
} else {
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee7");
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee7");
}
}
break;
case static_cast<uint64_t>(GadgetFunction::MIDI):
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee8");
break;
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee8");
}
break;
case GadgetFunction::ADB | GadgetFunction::MIDI:
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = setVidPid("0x18d1", "0x4ee9");
break;
if (!(vendorFunctions == "user" || vendorFunctions == "")) {
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
ret = Status::CONFIGURATION_NOT_SUPPORTED;
} else {
ret = setVidPid("0x18d1", "0x4ee9");
}
break;
case static_cast<uint64_t>(GadgetFunction::ACCESSORY):
if (!(vendorFunctions == "user" || vendorFunctions == ""))
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
@@ -502,6 +538,8 @@ V1_0::Status UsbGadget::setupFunctions(
if ((functions & GadgetFunction::ADB) != 0) {
ffsEnabled = true;
ALOGI("setCurrentUsbFunctions Adb");
if (!WriteStringToFile("1", DESC_USE_PATH))
return Status::ERROR;
if (inotify_add_watch(inotifyFd, "/dev/usb-ffs/adb/", IN_ALL_EVENTS) == -1)
return Status::ERROR;
@@ -616,7 +654,7 @@ error:
return Void();
}
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace gadget
} // namespace usb
} // namespace hardware

View File

@@ -14,29 +14,28 @@
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_USB_GADGET_V1_0_USBGADGET_H
#define ANDROID_HARDWARE_USB_GADGET_V1_0_USBGADGET_H
#pragma once
#include <android-base/file.h>
#include <android-base/properties.h>
#include <android-base/unique_fd.h>
#include <android/hardware/usb/gadget/1.0/IUsbGadget.h>
#include <android/hardware/usb/gadget/1.1/IUsbGadget.h>
#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <string>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <thread>
#include <utils/Log.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <string>
#include <thread>
namespace android {
namespace hardware {
namespace usb {
namespace gadget {
namespace V1_0 {
namespace V1_1 {
namespace implementation {
using ::android::sp;
@@ -50,6 +49,9 @@ using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::usb::gadget::V1_0::GadgetFunction;
using ::android::hardware::usb::gadget::V1_0::Status;
using ::android::hardware::usb::gadget::V1_1::IUsbGadget;
using ::std::lock_guard;
using ::std::move;
using ::std::mutex;
@@ -78,24 +80,22 @@ struct UsbGadget : public IUsbGadget {
bool mCurrentUsbFunctionsApplied;
Return<void> setCurrentUsbFunctions(uint64_t functions,
const sp<IUsbGadgetCallback>& callback,
const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout) override;
Return<void> getCurrentUsbFunctions(
const sp<IUsbGadgetCallback>& callback) override;
Return<void> getCurrentUsbFunctions(const sp<V1_0::IUsbGadgetCallback> &callback) override;
private:
Return<Status> reset() override;
private:
Status tearDownGadget();
Status setupFunctions(uint64_t functions,
const sp<IUsbGadgetCallback>& callback,
Status setupFunctions(uint64_t functions, const sp<V1_0::IUsbGadgetCallback> &callback,
uint64_t timeout);
};
} // namespace implementation
} // namespace V1_0
} // namespace V1_1
} // namespace gadget
} // namespace usb
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_USB_V1_2_USBGADGET_H

View File

@@ -0,0 +1,11 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.usb.gadget</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>IUsbGadget</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -0,0 +1,12 @@
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.usb</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -27,10 +27,10 @@ using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
// Generated HIDL files
using android::hardware::usb::gadget::V1_1::IUsbGadget;
using android::hardware::usb::gadget::V1_1::implementation::UsbGadget;
using android::hardware::usb::V1_1::IUsb;
using android::hardware::usb::gadget::V1_0::IUsbGadget;
using android::hardware::usb::V1_1::implementation::Usb;
using android::hardware::usb::gadget::V1_0::implementation::UsbGadget;
using android::OK;
using android::status_t;

View File

@@ -1,37 +0,0 @@
//
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
cc_binary {
name: "android.hardware.vibrator@1.2-service.wahoo",
relative_install_path: "hw",
init_rc: ["android.hardware.vibrator@1.2-service.wahoo.rc"],
srcs: ["service.cpp", "Vibrator.cpp"],
cflags: [
"-Wall",
"-Werror",
],
shared_libs: [
"libhidlbase",
"libcutils",
"libhidltransport",
"liblog",
"libhwbinder",
"libutils",
"libhardware",
"android.hardware.vibrator@1.0",
"android.hardware.vibrator@1.1",
"android.hardware.vibrator@1.2",
],
proprietary: true,
}

View File

@@ -1,2 +0,0 @@
dtwlin@google.com
michaelwr@google.com

View File

@@ -1,242 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "VibratorService"
#include <log/log.h>
#include <hardware/hardware.h>
#include <hardware/vibrator.h>
#include <cutils/properties.h>
#include "Vibrator.h"
#include <cinttypes>
#include <cmath>
#include <iostream>
#include <fstream>
namespace android {
namespace hardware {
namespace vibrator {
namespace V1_2 {
namespace implementation {
static constexpr int8_t MAX_RTP_INPUT = 127;
static constexpr int8_t MIN_RTP_INPUT = 0;
static constexpr char RTP_MODE[] = "rtp";
static constexpr char WAVEFORM_MODE[] = "waveform";
// Use effect #1 in the waveform library for CLICK effect
static constexpr char WAVEFORM_CLICK_EFFECT_SEQ[] = "1 0";
static constexpr int32_t WAVEFORM_CLICK_EFFECT_MS = 6;
// Use effect #2 in the waveform library for TICK effect
static constexpr char WAVEFORM_TICK_EFFECT_SEQ[] = "2 0";
static constexpr int32_t WAVEFORM_TICK_EFFECT_MS = 2;
// Use effect #3 in the waveform library for DOUBLE_CLICK effect
static constexpr char WAVEFORM_DOUBLE_CLICK_EFFECT_SEQ[] = "3 0";
static constexpr uint32_t WAVEFORM_DOUBLE_CLICK_EFFECT_MS = 135;
// Use effect #4 in the waveform library for HEAVY_CLICK effect
static constexpr char WAVEFORM_HEAVY_CLICK_EFFECT_SEQ[] = "4 0";
static constexpr uint32_t WAVEFORM_HEAVY_CLICK_EFFECT_MS = 8;
// Timeout threshold for selecting open or closed loop mode
static constexpr int8_t LOOP_MODE_THRESHOLD_MS = 20;
using Status = ::android::hardware::vibrator::V1_0::Status;
using EffectStrength = ::android::hardware::vibrator::V1_0::EffectStrength;
Vibrator::Vibrator(std::ofstream&& activate, std::ofstream&& duration,
std::ofstream&& state, std::ofstream&& rtpinput,
std::ofstream&& mode, std::ofstream&& sequencer,
std::ofstream&& scale, std::ofstream&& ctrlloop, std::ofstream&& lptrigger) :
mActivate(std::move(activate)),
mDuration(std::move(duration)),
mState(std::move(state)),
mRtpInput(std::move(rtpinput)),
mMode(std::move(mode)),
mSequencer(std::move(sequencer)),
mScale(std::move(scale)),
mCtrlLoop(std::move(ctrlloop)),
mLpTriggerEffect(std::move(lptrigger)) {
mClickDuration = property_get_int32("ro.vibrator.hal.click.duration", WAVEFORM_CLICK_EFFECT_MS);
mTickDuration = property_get_int32("ro.vibrator.hal.tick.duration", WAVEFORM_TICK_EFFECT_MS);
mHeavyClickDuration = property_get_int32(
"ro.vibrator.hal.heavyclick.duration", WAVEFORM_HEAVY_CLICK_EFFECT_MS);
// This enables effect #1 from the waveform library to be triggered by SLPI
// while the AP is in suspend mode
mLpTriggerEffect << 1 << std::endl;
if (!mLpTriggerEffect) {
ALOGW("Failed to set LP trigger mode (%d): %s", errno, strerror(errno));
}
}
Return<Status> Vibrator::on(uint32_t timeoutMs, bool forceOpenLoop, bool isWaveform) {
uint32_t loopMode = 1;
// Open-loop mode is used for short click for over-drive
// Close-loop mode is used for long notification for stability
if (!forceOpenLoop && timeoutMs > LOOP_MODE_THRESHOLD_MS) {
loopMode = 0;
}
mCtrlLoop << loopMode << std::endl;
mDuration << timeoutMs << std::endl;
if (!mDuration) {
ALOGE("Failed to set duration (%d): %s", errno, strerror(errno));
return Status::UNKNOWN_ERROR;
}
if (isWaveform) {
mMode << WAVEFORM_MODE << std::endl;
} else {
mMode << RTP_MODE << std::endl;
}
mActivate << 1 << std::endl;
if (!mActivate) {
ALOGE("Failed to activate (%d): %s", errno, strerror(errno));
return Status::UNKNOWN_ERROR;
}
return Status::OK;
}
// Methods from ::android::hardware::vibrator::V1_2::IVibrator follow.
Return<Status> Vibrator::on(uint32_t timeoutMs) {
return on(timeoutMs, false /* forceOpenLoop */, false /* isWaveform */);
}
Return<Status> Vibrator::off() {
mActivate << 0 << std::endl;
if (!mActivate) {
ALOGE("Failed to turn vibrator off (%d): %s", errno, strerror(errno));
return Status::UNKNOWN_ERROR;
}
return Status::OK;
}
Return<bool> Vibrator::supportsAmplitudeControl() {
return (mRtpInput ? true : false);
}
Return<Status> Vibrator::setAmplitude(uint8_t amplitude) {
if (amplitude == 0) {
return Status::BAD_VALUE;
}
int32_t rtp_input =
std::round((amplitude - 1) / 254.0 * (MAX_RTP_INPUT - MIN_RTP_INPUT) +
MIN_RTP_INPUT);
mRtpInput << rtp_input << std::endl;
if (!mRtpInput) {
ALOGE("Failed to set amplitude (%d): %s", errno, strerror(errno));
return Status::UNKNOWN_ERROR;
}
return Status::OK;
}
static uint8_t convertEffectStrength(EffectStrength strength) {
uint8_t scale;
switch (strength) {
case EffectStrength::LIGHT:
scale = 2; // 50%
break;
case EffectStrength::MEDIUM:
case EffectStrength::STRONG:
scale = 0; // 100%
break;
}
return scale;
}
Return<void> Vibrator::perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
return performWrapper(effect, strength, _hidl_cb);
}
Return<void> Vibrator::perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength,
perform_cb _hidl_cb) {
return performWrapper(effect, strength, _hidl_cb);
}
Return<void> Vibrator::perform_1_2(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
return performWrapper(effect, strength, _hidl_cb);
}
template <typename T>
Return<void> Vibrator::performWrapper(T effect, EffectStrength strength, perform_cb _hidl_cb) {
auto validEffectRange = hidl_enum_range<T>();
if (effect < *validEffectRange.begin() || effect > *std::prev(validEffectRange.end())) {
_hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
return Void();
}
auto validStrengthRange = hidl_enum_range<EffectStrength>();
if (strength < *validStrengthRange.begin() || strength > *std::prev(validStrengthRange.end())) {
_hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
return Void();
}
return performEffect(static_cast<Effect>(effect), strength, _hidl_cb);
}
Return<void> Vibrator::performEffect(Effect effect, EffectStrength strength, perform_cb _hidl_cb) {
Status status = Status::OK;
uint32_t timeMS;
switch (effect) {
case Effect::CLICK:
mSequencer << WAVEFORM_CLICK_EFFECT_SEQ << std::endl;
timeMS = mClickDuration;
break;
case Effect::DOUBLE_CLICK:
mSequencer << WAVEFORM_DOUBLE_CLICK_EFFECT_SEQ << std::endl;
timeMS = WAVEFORM_DOUBLE_CLICK_EFFECT_MS;
break;
case Effect::TICK:
mSequencer << WAVEFORM_TICK_EFFECT_SEQ << std::endl;
timeMS = mTickDuration;
break;
case Effect::HEAVY_CLICK:
mSequencer << WAVEFORM_HEAVY_CLICK_EFFECT_SEQ << std::endl;
timeMS = mHeavyClickDuration;
break;
default:
_hidl_cb(Status::UNSUPPORTED_OPERATION, 0);
return Void();
}
mScale << convertEffectStrength(strength) << std::endl;
on(timeMS, true /* forceOpenLoop */, true /* isWaveform */);
_hidl_cb(status, timeMS);
return Void();
}
} // namespace implementation
} // namespace V1_2
} // namespace vibrator
} // namespace hardware
} // namespace android

View File

@@ -1,75 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_HARDWARE_VIBRATOR_V1_2_VIBRATOR_H
#define ANDROID_HARDWARE_VIBRATOR_V1_2_VIBRATOR_H
#include <android/hardware/vibrator/1.2/IVibrator.h>
#include <hidl/Status.h>
#include <fstream>
namespace android {
namespace hardware {
namespace vibrator {
namespace V1_2 {
namespace implementation {
class Vibrator : public IVibrator {
public:
Vibrator(std::ofstream&& activate, std::ofstream&& duration,
std::ofstream&& state, std::ofstream&& rtpinput,
std::ofstream&& mode, std::ofstream&& sequencer,
std::ofstream&& scale, std::ofstream&& ctrlloop, std::ofstream&& lptrigger);
// Methods from ::android::hardware::vibrator::V1_0::IVibrator follow.
using Status = ::android::hardware::vibrator::V1_0::Status;
Return<Status> on(uint32_t timeoutMs) override;
Return<Status> off() override;
Return<bool> supportsAmplitudeControl() override;
Return<Status> setAmplitude(uint8_t amplitude) override;
using EffectStrength = ::android::hardware::vibrator::V1_0::EffectStrength;
Return<void> perform(V1_0::Effect effect, EffectStrength strength, perform_cb _hidl_cb)
override;
Return<void> perform_1_1(V1_1::Effect_1_1 effect, EffectStrength strength, perform_cb _hidl_cb)
override;
Return<void> perform_1_2(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override;
private:
Return<Status> on(uint32_t timeoutMs, bool forceOpenLoop, bool isWaveform);
template <typename T>
Return<void> performWrapper(T effect, EffectStrength strength, perform_cb _hidl_cb);
Return<void> performEffect(Effect effect, EffectStrength strength, perform_cb _hidl_cb);
std::ofstream mActivate;
std::ofstream mDuration;
std::ofstream mState;
std::ofstream mRtpInput;
std::ofstream mMode;
std::ofstream mSequencer;
std::ofstream mScale;
std::ofstream mCtrlLoop;
std::ofstream mLpTriggerEffect;
int32_t mClickDuration;
int32_t mTickDuration;
int32_t mHeavyClickDuration;
};
} // namespace implementation
} // namespace V1_2
} // namespace vibrator
} // namespace hardware
} // namespace android
#endif // ANDROID_HARDWARE_VIBRATOR_V1_2_VIBRATOR_H

View File

@@ -1,4 +0,0 @@
service vendor.vibrator-1-2 /vendor/bin/hw/android.hardware.vibrator@1.2-service.wahoo
class hal
user system
group system

View File

@@ -1,208 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "android.hardware.vibrator@1.2-service.wahoo"
#include <android/hardware/vibrator/1.2/IVibrator.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
#include <utils/Errors.h>
#include <utils/StrongPointer.h>
#include "Vibrator.h"
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using android::hardware::vibrator::V1_2::IVibrator;
using android::hardware::vibrator::V1_2::implementation::Vibrator;
using namespace android;
// Refer to Documentation/ABI/testing/sysfs-class-led-driver-drv2624
// kernel documentation on the detail usages for ABIs below
static constexpr char ACTIVATE_PATH[] = "/sys/class/leds/vibrator/activate";
static constexpr char DURATION_PATH[] = "/sys/class/leds/vibrator/duration";
static constexpr char STATE_PATH[] = "/sys/class/leds/vibrator/state";
static constexpr char RTP_INPUT_PATH[] = "/sys/class/leds/vibrator/device/rtp_input";
static constexpr char MODE_PATH[] = "/sys/class/leds/vibrator/device/mode";
static constexpr char SEQUENCER_PATH[] = "/sys/class/leds/vibrator/device/set_sequencer";
static constexpr char SCALE_PATH[] = "/sys/class/leds/vibrator/device/scale";
static constexpr char CTRL_LOOP_PATH[] = "/sys/class/leds/vibrator/device/ctrl_loop";
static constexpr char LP_TRIGGER_PATH[] = "/sys/class/leds/vibrator/device/lp_trigger_effect";
// File path to the calibration file
static constexpr char CALIBRATION_FILEPATH[] = "/persist/haptics/drv2624.cal";
// Kernel ABIs for updating the calibration data
static constexpr char AUTOCAL_CONFIG[] = "autocal";
static constexpr char LRA_PERIOD_CONFIG[] = "lra_period";
static constexpr char AUTOCAL_FILEPATH[] = "/sys/class/leds/vibrator/device/autocal";
static constexpr char OL_LRA_PERIOD_FILEPATH[] = "/sys/class/leds/vibrator/device/ol_lra_period";
static std::string trim(const std::string& str,
const std::string& whitespace = " \t") {
const auto str_begin = str.find_first_not_of(whitespace);
if (str_begin == std::string::npos) {
return "";
}
const auto str_end = str.find_last_not_of(whitespace);
const auto str_range = str_end - str_begin + 1;
return str.substr(str_begin, str_range);
}
static bool loadCalibrationData() {
std::map<std::string, std::string> config_data;
std::ofstream autocal{AUTOCAL_FILEPATH};
if (!autocal) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", AUTOCAL_FILEPATH, error,
strerror(error));
return false;
}
std::ofstream ol_lra_period{OL_LRA_PERIOD_FILEPATH};
if (!ol_lra_period) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", OL_LRA_PERIOD_FILEPATH, error,
strerror(error));
return false;
}
std::ifstream cal_data{CALIBRATION_FILEPATH};
if (!cal_data) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", CALIBRATION_FILEPATH, error,
strerror(error));
return false;
}
std::string line;
while (std::getline(cal_data, line)) {
if (line.empty() || line[0] == '#') {
continue;
}
std::istringstream is_line(line);
std::string key;
if (std::getline(is_line, key, ':')) {
std::string value;
if (std::getline(is_line, value)) {
config_data[trim(key)] = trim(value);
}
}
}
if(config_data.find(AUTOCAL_CONFIG) != config_data.end()) {
autocal << config_data[AUTOCAL_CONFIG] << std::endl;
}
if(config_data.find(LRA_PERIOD_CONFIG) != config_data.end()) {
ol_lra_period << config_data[LRA_PERIOD_CONFIG] << std::endl;
}
return true;
}
status_t registerVibratorService() {
// ostreams below are required
std::ofstream activate{ACTIVATE_PATH};
if (!activate) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", ACTIVATE_PATH, error, strerror(error));
return -error;
}
std::ofstream duration{DURATION_PATH};
if (!duration) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", DURATION_PATH, error, strerror(error));
return -error;
}
std::ofstream state{STATE_PATH};
if (!state) {
int error = errno;
ALOGE("Failed to open %s (%d): %s", STATE_PATH, error, strerror(error));
return -error;
}
state << 1 << std::endl;
if (!state) {
int error = errno;
ALOGE("Failed to set state (%d): %s", errno, strerror(errno));
return -error;
}
// ostreams below are optional
std::ofstream rtpinput{RTP_INPUT_PATH};
if (!rtpinput) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", RTP_INPUT_PATH, error, strerror(error));
}
std::ofstream mode{MODE_PATH};
if (!mode) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", MODE_PATH, error, strerror(error));
}
std::ofstream sequencer{SEQUENCER_PATH};
if (!sequencer) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", SEQUENCER_PATH, error, strerror(error));
}
std::ofstream scale{SCALE_PATH};
if (!scale) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", SCALE_PATH, error, strerror(error));
}
std::ofstream ctrlloop{CTRL_LOOP_PATH};
if (!ctrlloop) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", CTRL_LOOP_PATH, error, strerror(error));
}
std::ofstream lptrigger{LP_TRIGGER_PATH};
if (!lptrigger) {
int error = errno;
ALOGW("Failed to open %s (%d): %s", LP_TRIGGER_PATH, error, strerror(error));
}
if (!loadCalibrationData()) {
ALOGW("Failed load calibration data");
}
sp<IVibrator> vibrator = new Vibrator(std::move(activate), std::move(duration),
std::move(state), std::move(rtpinput), std::move(mode),
std::move(sequencer), std::move(scale), std::move(ctrlloop), std::move(lptrigger));
return vibrator->registerAsService();
}
int main() {
configureRpcThreadpool(1, true);
status_t status = registerVibratorService();
if (status != OK) {
return status;
}
joinRpcThreadpool();
}

View File

@@ -6,3 +6,4 @@ interworking=1
hs20=1
auto_interworking=0
bss_no_flush_when_down=1
driver_param=use_p2p_group_interface=1