├── Android.bp ├── Android.mk ├── AndroidProducts.mk ├── BoardConfig.mk ├── README.md ├── audio ├── aov_ec_mixer_paths.xml ├── audio_effects.xml ├── audio_ext_spkr.conf ├── audio_platform_info.xml ├── audio_policy_configuration.xml └── mixer_paths.xml ├── bluetooth └── bdroid_buildcfg.h ├── compatibility_matrix.xml ├── config.fs ├── configs ├── camera │ ├── com.motorola.camera │ │ └── always_aware_ocr.json │ ├── mot_imx362_chromatix.xml │ ├── mot_ov5695_chromatix.xml │ ├── msm8953_mot_camera.xml │ ├── ov16860_chromatix.xml │ └── ov5693_chromatix.xml ├── component-overrides.xml ├── media_codecs │ ├── media_codecs.xml │ ├── media_codecs_performance.xml │ └── media_profiles_V1_0.xml ├── nfc │ ├── libnfc-nci.conf │ ├── libnfc-nxp.conf │ └── libnfc-nxp_retcn.conf ├── powerhint.xml ├── public.libraries.txt ├── qti_whitelist.xml ├── sec_config ├── sensors │ ├── hals.conf │ └── sensor_def_qcomdev.conf ├── telephony_product_privapp-permissions-qti.xml ├── thermal-engine-addison.conf └── whitelist_modservice.xml ├── device.mk ├── extract-files.sh ├── extract-files_addison.sh ├── framework_manifest.xml ├── full_addison.mk ├── gps ├── Android.mk ├── android │ ├── 1.0 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@1.0-service-qti.rc │ │ ├── android.hardware.gnss@1.0-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── 1.1 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@1.1-service-qti.rc │ │ ├── android.hardware.gnss@1.1-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── 2.0 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@2.0-service-qti.rc │ │ ├── android.hardware.gnss@2.0-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── Android.mk │ ├── measurement_corrections │ │ └── 1.0 │ │ │ ├── MeasurementCorrections.cpp │ │ │ └── MeasurementCorrections.h │ ├── utils │ │ ├── Android.mk │ │ ├── battery_listener.cpp │ │ └── battery_listener.h │ └── visibility_control │ │ └── 1.0 │ │ ├── GnssVisibilityControl.cpp │ │ └── GnssVisibilityControl.h ├── batching │ ├── Android.mk │ ├── BatchingAdapter.cpp │ ├── BatchingAdapter.h │ ├── location-batching.pc.in │ └── location_batching.cpp ├── build │ └── target_specific_features.mk ├── core │ ├── Android.mk │ ├── ContextBase.cpp │ ├── ContextBase.h │ ├── EngineHubProxyBase.h │ ├── LBSProxyBase.h │ ├── LocAdapterBase.cpp │ ├── LocAdapterBase.h │ ├── LocAdapterProxyBase.h │ ├── LocApiBase.cpp │ ├── LocApiBase.h │ ├── LocContext.cpp │ ├── LocContext.h │ ├── SystemStatus.cpp │ ├── SystemStatus.h │ ├── SystemStatusOsObserver.cpp │ ├── SystemStatusOsObserver.h │ ├── data-items │ │ ├── DataItemConcreteTypesBase.h │ │ ├── DataItemId.h │ │ ├── DataItemsFactoryProxy.cpp │ │ ├── DataItemsFactoryProxy.h │ │ └── IDataItemCore.h │ ├── loc_core_log.cpp │ ├── loc_core_log.h │ └── observer │ │ ├── IDataItemObserver.h │ │ ├── IDataItemSubscription.h │ │ ├── IFrameworkActionReq.h │ │ └── IOsObserver.h ├── etc │ ├── apdr.conf │ ├── flp.conf │ ├── gps.conf │ ├── izat.conf │ ├── lowi.conf │ ├── sap.conf │ └── xtwifi.conf ├── geofence │ ├── Android.mk │ ├── GeofenceAdapter.cpp │ ├── GeofenceAdapter.h │ ├── location-geofence.pc.in │ └── location_geofence.cpp ├── gnss │ ├── Agps.cpp │ ├── Agps.h │ ├── Android.mk │ ├── GnssAdapter.cpp │ ├── GnssAdapter.h │ ├── XtraSystemStatusObserver.cpp │ ├── XtraSystemStatusObserver.h │ └── location_gnss.cpp ├── gnsspps │ ├── Android.mk │ ├── configure.ac │ ├── gnsspps.c │ ├── gnsspps.h │ ├── gnsspps.pc.in │ └── timepps.h ├── loc_sll_if │ ├── Android.mk │ └── if │ │ ├── Android.mk │ │ └── loc_sll_interface.h ├── location │ ├── Android.mk │ ├── ILocationAPI.h │ ├── LocationAPI.cpp │ ├── LocationAPI.h │ ├── LocationAPIClientBase.cpp │ ├── LocationAPIClientBase.h │ ├── LocationDataTypes.h │ ├── location-api.pc.in │ └── location_interface.h ├── pla │ ├── Android.mk │ ├── android │ │ └── loc_pla.h │ └── oe │ │ └── loc_pla.h ├── synergy_loc_api │ ├── Android.mk │ ├── SynergyLocApi.cpp │ ├── SynergyLocApi.h │ └── synergy_loc_util_log.h └── utils │ ├── Android.mk │ ├── LocHeap.cpp │ ├── LocHeap.h │ ├── LocIpc.cpp │ ├── LocIpc.h │ ├── LocSharedLock.h │ ├── LocThread.cpp │ ├── LocThread.h │ ├── LocTimer.cpp │ ├── LocTimer.h │ ├── LocUnorderedSetMap.h │ ├── MsgTask.cpp │ ├── MsgTask.h │ ├── gps_extended.h │ ├── gps_extended_c.h │ ├── linked_list.c │ ├── linked_list.h │ ├── loc_cfg.cpp │ ├── loc_cfg.h │ ├── loc_gps.h │ ├── loc_log.cpp │ ├── loc_log.h │ ├── loc_misc_utils.cpp │ ├── loc_misc_utils.h │ ├── loc_nmea.cpp │ ├── loc_nmea.h │ ├── loc_target.cpp │ ├── loc_target.h │ ├── loc_timer.h │ ├── log_util.h │ ├── msg_q.c │ └── msg_q.h ├── hardware-moto-sensors ├── .gitignore ├── Android.mk ├── BaseHal.h ├── InputEventReader.cpp ├── InputEventReader.h ├── NOTICE ├── SensorsLog.h ├── ak09912_akmd_6D_32b │ ├── AKCommon.h │ ├── AKCompass.h │ ├── AKMD_Driver.c │ ├── AKMD_Driver.h │ ├── AKMLog.h │ ├── Acc_aot.c │ ├── Acc_aot.h │ ├── CustomerSpec.h │ ├── DispMessage.c │ ├── DispMessage.h │ ├── FST.h │ ├── FST_AK09912.c │ ├── FileIO.c │ ├── FileIO.h │ ├── Measure.c │ ├── Measure.h │ ├── libSmartCompass │ │ ├── AKCertification.h │ │ ├── AKConfigure.h │ │ ├── AKDecomp.h │ │ ├── AKDirection6D.h │ │ ├── AKHDOE.h │ │ ├── AKHFlucCheck.h │ │ ├── AKMDevice.h │ │ ├── AKManualCal.h │ │ ├── AKVersion.h │ │ ├── arm │ │ │ └── libAK09912.a │ │ └── arm64 │ │ │ └── libAK09912.a │ ├── main.c │ ├── misc.c │ └── misc.h ├── capsensor │ ├── Android.mk │ └── capsense.cpp ├── doxygen │ ├── Doxyfile │ ├── DynamicSensorTests.md │ ├── GreyBus.md │ ├── HAL.md │ ├── IIO.md │ ├── README.md │ └── header.tex ├── iio_hal │ ├── Android.mk │ ├── DynamicMetaSensor.cpp │ ├── DynamicMetaSensor.h │ ├── Hal.cpp │ ├── IioHal.cpp │ ├── IioHal.h │ ├── IioSensor.cpp │ ├── IioSensor.h │ ├── UeventListener.cpp │ └── UeventListener.h ├── iio_utils │ ├── Android.mk │ ├── NOTICE │ ├── README │ ├── generic_buffer.c │ ├── iio_event_monitor.c │ ├── iio_utils.h │ └── lsiio.c ├── libiio │ ├── Android.bp │ ├── include │ │ └── iio.h │ └── src ├── libsensorhub │ ├── Android.mk │ ├── Endian.cpp │ ├── Endian.hpp │ ├── SensorHub.cpp │ └── SensorHub.hpp ├── motosh_bin │ ├── CRC32.c │ ├── CRC32.h │ ├── motosh.cpp │ └── sensorhub-blacklist.txt ├── motosh_hal │ ├── Android.mk │ ├── HubSensors.cpp │ ├── HubSensors.h │ ├── RearProxSensor.cpp │ ├── RearProxSensor.h │ ├── SensorBase.cpp │ ├── SensorBase.h │ ├── SensorHal.cpp │ ├── SensorList.cpp │ ├── Sensors.h │ ├── SensorsPollContext.cpp │ ├── SensorsPollContext.h │ └── sensorhub.c ├── rearProx │ ├── Android.mk │ ├── CapSensor.cpp │ ├── CapSensor.h │ ├── InputEventReader.cpp │ ├── InputEventReader.h │ ├── NativeSensorManager.cpp │ ├── NativeSensorManager.h │ ├── ProximitySensor.cpp │ ├── ProximitySensor.h │ ├── SensorBase.cpp │ ├── SensorBase.h │ ├── sensors.cpp │ ├── sensors.h │ └── sensors_extension.h ├── stml0xx_hal │ ├── CapSense.cpp │ ├── CapSense.h │ ├── FusionSensorBase.cpp │ ├── FusionSensorBase.h │ ├── GameRotationVector.cpp │ ├── GameRotationVector.h │ ├── GeoMagRotationVector.cpp │ ├── GeoMagRotationVector.h │ ├── GyroIntegration.cpp │ ├── GyroIntegration.h │ ├── HubSensors.cpp │ ├── HubSensors.h │ ├── LinearAccelGravity.cpp │ ├── LinearAccelGravity.h │ ├── Quaternion.cpp │ ├── Quaternion.h │ ├── RearProxSensor.cpp │ ├── RearProxSensor.h │ ├── RotationVector.cpp │ ├── RotationVector.h │ ├── SensorBase.cpp │ ├── SensorBase.h │ ├── SensorHal.cpp │ ├── SensorList.cpp │ ├── SensorList.h │ ├── Sensors.h │ ├── SensorsPollContext.cpp │ ├── SensorsPollContext.h │ └── sensorhub.c ├── tof_hal │ ├── Android.mk │ ├── RearProxSensor.cpp │ ├── RearProxSensor.h │ ├── SensorsPollContext.cpp │ ├── SensorsPollContext.h │ └── TofModule.cpp ├── utils │ ├── sensor_time.cpp │ └── sensor_time.h └── vl53l0_hal │ ├── Android.mk │ ├── RearProxSensor.cpp │ ├── RearProxSensor.h │ ├── SensorBase.cpp │ ├── SensorBase.h │ ├── SensorsPollContext.cpp │ ├── SensorsPollContext.h │ └── TofModule.cpp ├── idc └── fpc1020.idc ├── include └── hardware │ └── mot_sensorhub_motosh.h ├── init ├── Android.bp └── init_msm8953.cpp ├── keylayout └── fpc1020.kl ├── libhidl └── Android.mk ├── libshims ├── Android.bp ├── Android.mk ├── android_memset.S ├── jstring.h ├── justshoot_shim.cpp ├── libqsap_shim.c ├── memset32.S └── strdup16to8.cpp ├── light ├── Android.bp ├── Light.cpp ├── Light.h ├── android.hardware.light@2.0-service.addison.rc ├── android.hardware.light@2.0-service.addison.xml └── service.cpp ├── lineage.dependencies ├── lineage_addison.mk ├── manifest.xml ├── mot_aids.fs ├── overlay ├── frameworks │ └── base │ │ ├── core │ │ └── res │ │ │ └── res │ │ │ ├── values-mcc204-mnc04 │ │ │ └── config.xml │ │ │ ├── values-mcc310-mnc004 │ │ │ └── config.xml │ │ │ ├── values-mcc311-mnc480 │ │ │ └── config.xml │ │ │ ├── values │ │ │ ├── config.xml │ │ │ └── strings.xml │ │ │ └── xml │ │ │ └── power_profile.xml │ │ └── packages │ │ └── SettingsProvider │ │ └── res │ │ └── values │ │ └── defaults.xml ├── lineage-sdk │ └── lineage │ │ └── res │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ ├── apps │ ├── Bluetooth │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ ├── CarrierConfig │ │ └── res │ │ │ └── xml │ │ │ └── vendor.xml │ ├── Settings │ │ └── res │ │ │ └── values │ │ │ ├── arrays.xml │ │ │ ├── config.xml │ │ │ └── dimens.xml │ └── Snap │ │ └── res │ │ └── values │ │ └── config.xml │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── pocketmode ├── Android.mk ├── AndroidManifest.xml ├── pocketmode_whitelist.xml ├── proguard.flags └── src │ └── org │ └── lineageos │ └── pocketmode │ ├── BootCompletedReceiver.java │ ├── PocketModeService.java │ └── ProximitySensor.java ├── power ├── Android.mk └── power-8953.c ├── proprietary-files.txt ├── proprietary-files_addison.txt ├── rootdir ├── Android.mk ├── bin │ ├── init.gbmods.sh │ ├── init.qcom.early_boot.sh │ ├── init.qcom.post_boot.sh │ ├── init.qcom.sensors.sh │ ├── init.qcom.sh │ └── wlan_carrier_bin.sh ├── etc │ ├── init.addison.rc │ ├── init.mmi.rc │ ├── init.mmi.usb.rc │ ├── init.qcom.rc │ ├── init.recovery.qcom.rc │ └── ueventd.qcom.rc └── root │ ├── fstab.qcom │ └── fstab.recovery ├── rro_overlays ├── TetheringOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── WifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── seccomp_policy ├── mediacodec.policy └── mediaextractor.policy ├── sepolicy-mods ├── private │ ├── mods_app.te │ ├── seapp_contexts │ └── service_contexts ├── public │ ├── mods_app.te │ └── service.te └── vendor │ ├── cameraserver.te │ ├── device.te │ ├── file.te │ ├── file_contexts │ ├── genfs_contexts │ ├── hal_audio_default.te │ ├── hal_camera_default.te │ ├── hal_graphics_composer_default.te │ ├── hal_health_default.te │ ├── healthd.te │ ├── hwservice.te │ ├── hwservice_contexts │ ├── init_mods.te │ ├── mods_app.te │ ├── mods_camd.te │ ├── platform_app.te │ ├── system_app.te │ └── system_server.te ├── sepolicy └── vendor │ ├── akmd.te │ ├── app.te │ ├── atfwd.te │ ├── audioserver.te │ ├── bootanim.te │ ├── cameraserver.te │ ├── capsense_reset.te │ ├── charge_only.te │ ├── cnd.te │ ├── device.te │ ├── energyawareness.te │ ├── file.te │ ├── file_contexts │ ├── firmware_file.te │ ├── fsck.te │ ├── genfs_contexts │ ├── hal_audio_default.te │ ├── hal_camera_default.te │ ├── hal_cas_default.te │ ├── hal_fingerprint_default.te │ ├── hal_gnss_qti.te │ ├── hal_graphics_composer_default.te │ ├── hal_health_default.te │ ├── hal_light_default.te │ ├── hal_lineage_touch.te │ ├── hal_lineage_touch_default.te │ ├── hal_nfc_default.te │ ├── hal_perf_default.te │ ├── hal_power_default.te │ ├── hal_power_stats_default.te │ ├── hal_sensors_default.te │ ├── hal_wifi_default.te │ ├── hwservice.te │ ├── hwservice_contexts │ ├── hwservicemanager.te │ ├── ims.te │ ├── init.te │ ├── init_wifi.te │ ├── installd.te │ ├── isdbt_app.te │ ├── kernel.te │ ├── location.te │ ├── mediacodec.te │ ├── mediadrmserver.te │ ├── mediaextractor.te │ ├── mm-qcamerad.te │ ├── msm_irqbalanced.te │ ├── netd.te │ ├── netmgrd.te │ ├── netutils_wrapper.te │ ├── nfc.te │ ├── per_mgr.te │ ├── perfd.te │ ├── persist_file.te │ ├── platform_app.te │ ├── pocketmode_app.te │ ├── priv_app.te │ ├── property.te │ ├── property_contexts │ ├── qseeproxy.te │ ├── qti.te │ ├── qti_init_shell.te │ ├── radio.te │ ├── rfs_access.te │ ├── rfs_file.te │ ├── rild.te │ ├── rmt_storage.te │ ├── seapp_contexts │ ├── sensor_hub.te │ ├── service.te │ ├── service_contexts │ ├── servicemanager.te │ ├── surfaceflinger.te │ ├── system_app.te │ ├── system_server.te │ ├── tee.te │ ├── thermal-engine.te │ ├── time_daemon.te │ ├── toolbox.te │ ├── ueventd.te │ ├── untrusted_app.te │ ├── vendor_init.te │ ├── vendor_qti_init_shell.te │ ├── vendor_ssr_setup.te │ ├── vold.te │ ├── wcnss_service.te │ ├── webview_zygote.te │ └── zygote.te ├── setup-makefiles.sh ├── vendor_prop.mk ├── vibrator ├── Android.bp ├── Vibrator.cpp ├── Vibrator.h ├── android.hardware.vibrator@1.0-service.addison.rc ├── android.hardware.vibrator@1.0-service.addison.xml └── service.cpp └── wifi ├── WCNSS_cfg.dat ├── WCNSS_qcom_cfg.ini ├── hostapd_default.conf ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018-2022 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | PRODUCT_MAKEFILES := \ 17 | $(LOCAL_DIR)/lineage_addison.mk 18 | 19 | COMMON_LUNCH_CHOICES := \ 20 | lineage_addison-user \ 21 | lineage_addison-userdebug \ 22 | lineage_addison-eng 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Device Tree for Moto Z Play (addison) 2 | =========================================== 3 | 4 | The Motorola Moto Z Play (codenamed _"addison"_) is a mid-range smartphone from Motorola mobility. 5 | It was announced on August 2016. 6 | 7 | Basic | Spec Sheet 8 | -------:|:------------------------- 9 | CPU | Octa-core 2 GHz Cortex-A53 10 | Chipset | Qualcomm MSM8953 Snapdragon 625 11 | GPU | Adreno 506 12 | Memory | 3 GB RAM 13 | Shipped Android Version | 6.0.1 14 | Storage | 32 GB 15 | MicroSD | Up to 256 GB 16 | Battery | Li-Ion 3510mAh battery 17 | Display | 1080 x 1920 pixels, 5.5 inches (~403 ppi pixel density) 18 | Camera | 16 MP, 2150 x 1440 pixels, laser focus, dual flash LED 19 | 20 | Copyright 2016 - The LineageOS Project. 21 | 22 | ![Moto Z Play](https://fdn2.gsmarena.com/vv/pics/motorola/motorola-moto-z-play-2.jpg "Moto Z Play") 23 | -------------------------------------------------------------------------------- /audio/aov_ec_mixer_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /audio/audio_ext_spkr.conf: -------------------------------------------------------------------------------- 1 | global_config { 2 | name Addison 3 | sonification_pad 15 4 | sonification_prox_timeout_sec 5 5 | } 6 | 7 | ring { 8 | #dB to attenuate playback to meet safety level at each volume step 9 | #16 steps total, 15...0. In case of truncated list, last attenuation 10 | #given will be applied to all lower volume steps 11 | attenuation 38,38,35,35,32,32,29,29,26,26,24,24,22,22,20,20 12 | knee_step 16 13 | } 14 | 15 | voice { 16 | #dB to attenuate playback to meet safety level at each volume step 17 | #16 steps total, 15...0. In case of truncated list, last attenuation 18 | #given will be applied to all lower volume steps 19 | attenuation 35,35,32,32,29,29,26,26,23,23,20,20,17,17,14,14 20 | knee_step 16 21 | } 22 | 23 | media { 24 | #dB to attenuate playback to meet safety level at each volume step 25 | #16 steps total, 15...0. In case of truncated list, last attenuation 26 | #given will be applied to all lower volume steps 27 | attenuation 38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8 28 | knee_step 16 29 | } 30 | -------------------------------------------------------------------------------- /bluetooth/bdroid_buildcfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The CyanogenMod Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _BDROID_BUILDCFG_H 18 | #define _BDROID_BUILDCFG_H 19 | 20 | //#include 21 | #include 22 | 23 | #define BTM_DEF_LOCAL_NAME "Moto Z Play" 24 | #define BLUETOOTH_QTI_SW TRUE 25 | #define MAX_ACL_CONNECTIONS 16 26 | #define MAX_L2CAP_CHANNELS 16 27 | #define BLE_VND_INCLUDED TRUE 28 | #define BTM_WBS_INCLUDED TRUE 29 | #define BTIF_HF_WBS_PREFERRED TRUE 30 | #define BTM_SCO_ENHANCED_SYNC_ENABLED FALSE 31 | #endif 32 | -------------------------------------------------------------------------------- /configs/camera/com.motorola.camera/always_aware_ocr.json: -------------------------------------------------------------------------------- 1 | { 2 | "alwaysAware": { 3 | "supportedDetectors": [ 4 | { 5 | "detector": "businessCard", 6 | "vendor": "abbyy" 7 | } 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /configs/component-overrides.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libadsprpc.so 2 | libOpenCL.so 3 | libqti-perfd-client.so 4 | libprotobuf-cpp-full.so 5 | libprotobuf-cpp-lite.so -------------------------------------------------------------------------------- /configs/sensors/hals.conf: -------------------------------------------------------------------------------- 1 | sensors.msm8953.so 2 | sensors.iio.so 3 | -------------------------------------------------------------------------------- /configs/telephony_product_privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /configs/whitelist_modservice.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | vendor.qti.hardware.radio.atcmdfwd 32 | hwbinder 33 | 1.0 34 | 35 | IAtCmdFwd 36 | AtCmdFwdService 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /full_addison.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2015 The CyanogenMod Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # # Inherit from device product 18 | $(call inherit-product, device/motorola/addison/device.mk) 19 | 20 | # Inherit from those products - Most specific first 21 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 22 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 23 | 24 | # Device identifier - This must come after all inclusions 25 | PRODUCT_DEVICE := addison 26 | PRODUCT_NAME := full_addison 27 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2019 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | include $(call first-makefiles-under,$(call my-dir)) 18 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti 2 | interface android.hardware.gnss@1.0::IGnss default 3 | class hal 4 | user gps 5 | group system gps radio vendor_qti_diag 6 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.0::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_1 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_1 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti 2 | interface android.hardware.gnss@1.0::IGnss default 3 | interface android.hardware.gnss@1.1::IGnss default 4 | class hal 5 | user gps 6 | group system gps radio vendor_qti_diag 7 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_0 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti 2 | interface android.hardware.gnss@1.0::IGnss default 3 | interface android.hardware.gnss@1.1::IGnss default 4 | interface android.hardware.gnss@2.0::IGnss default 5 | class hal 6 | user gps 7 | group system gps radio vendor_qti_diag 8 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.0::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gps/android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | DIR_LIST := $(LOCAL_PATH) 4 | include $(DIR_LIST)/utils/Android.mk 5 | include $(DIR_LIST)/2.0/Android.mk 6 | -------------------------------------------------------------------------------- /gps/android/utils/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE := liblocbatterylistener 5 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 6 | # activate the following line for debug purposes only, comment out for production 7 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 8 | LOCAL_VENDOR_MODULE := true 9 | 10 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 11 | 12 | LOCAL_C_INCLUDES += \ 13 | $(LOCAL_PATH) \ 14 | 15 | LOCAL_SRC_FILES:= \ 16 | battery_listener.cpp 17 | LOCAL_SHARED_LIBRARIES := \ 18 | liblog \ 19 | libhidlbase \ 20 | libcutils \ 21 | libutils \ 22 | android.hardware.health@1.0 \ 23 | android.hardware.health@2.0 \ 24 | android.hardware.power@1.2 \ 25 | libbase 26 | 27 | LOCAL_STATIC_LIBRARIES := libhealthhalutils 28 | LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED 29 | 30 | include $(BUILD_STATIC_LIBRARY) 31 | 32 | include $(CLEAR_VARS) 33 | LOCAL_MODULE := liblocbatterylistener_headers 34 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 35 | 36 | include $(BUILD_HEADER_LIBRARY) 37 | 38 | 39 | -------------------------------------------------------------------------------- /gps/android/utils/battery_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | typedef void (* battery_status_change_fn_t)(bool); 30 | void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); 31 | void loc_extn_battery_properties_listener_deinit(); 32 | bool loc_extn_battery_properties_is_charging(); 33 | -------------------------------------------------------------------------------- /gps/batching/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libbatching 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | liblog \ 16 | libloc_core \ 17 | libgps.utils \ 18 | libdl 19 | 20 | LOCAL_SRC_FILES += \ 21 | location_batching.cpp \ 22 | BatchingAdapter.cpp 23 | 24 | LOCAL_HEADER_LIBRARIES := \ 25 | libgps.utils_headers \ 26 | libloc_core_headers \ 27 | libloc_pla_headers \ 28 | liblocation_api_headers 29 | 30 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 31 | include $(BUILD_SHARED_LIBRARY) 32 | -------------------------------------------------------------------------------- /gps/batching/location-batching.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-batching 7 | Description: QTI GPS Batching 8 | Version: @VERSION 9 | Libs: -L${libdir} -lbatching 10 | Cflags: -I${includedir}/location-batching 11 | -------------------------------------------------------------------------------- /gps/build/target_specific_features.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=macro-redefined \ 5 | -Wno-error=reorder \ 6 | -Wno-error=missing-braces \ 7 | -Wno-error=self-assign \ 8 | -Wno-error=enum-conversion \ 9 | -Wno-error=logical-op-parentheses \ 10 | -Wno-error=null-arithmetic \ 11 | -Wno-error=null-conversion \ 12 | -Wno-error=parentheses-equality \ 13 | -Wno-error=undefined-bool-conversion \ 14 | -Wno-error=tautological-compare \ 15 | -Wno-error=switch \ 16 | -Wno-error=date-time 17 | -------------------------------------------------------------------------------- /gps/core/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libloc_core 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | liblog \ 14 | libutils \ 15 | libcutils \ 16 | libgps.utils \ 17 | libdl \ 18 | liblog 19 | 20 | LOCAL_SRC_FILES += \ 21 | LocApiBase.cpp \ 22 | LocAdapterBase.cpp \ 23 | ContextBase.cpp \ 24 | LocContext.cpp \ 25 | loc_core_log.cpp \ 26 | data-items/DataItemsFactoryProxy.cpp \ 27 | SystemStatusOsObserver.cpp \ 28 | SystemStatus.cpp 29 | 30 | LOCAL_CFLAGS += \ 31 | -fno-short-enums \ 32 | -D_ANDROID_ 33 | 34 | LOCAL_C_INCLUDES:= \ 35 | $(LOCAL_PATH)/data-items \ 36 | $(LOCAL_PATH)/data-items/common \ 37 | $(LOCAL_PATH)/observer \ 38 | 39 | LOCAL_HEADER_LIBRARIES := \ 40 | libutils_headers \ 41 | libgps.utils_headers \ 42 | libloc_pla_headers \ 43 | liblocation_api_headers 44 | 45 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 46 | 47 | include $(BUILD_SHARED_LIBRARY) 48 | 49 | include $(CLEAR_VARS) 50 | LOCAL_MODULE := libloc_core_headers 51 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ 52 | $(LOCAL_PATH) \ 53 | $(LOCAL_PATH)/data-items \ 54 | $(LOCAL_PATH)/data-items/common \ 55 | $(LOCAL_PATH)/observer 56 | include $(BUILD_HEADER_LIBRARY) 57 | -------------------------------------------------------------------------------- /gps/etc/apdr.conf: -------------------------------------------------------------------------------- 1 | # AP DR SENSOR Configuration file 2 | # 3 | # SENSOR_SERVICE options are one of below 4 | # accel,gyro,vehicle_accel,vehicle_gyro,pedometer,vehicle_odometry,accel_temp, 5 | # gyro_temp,baro,mag_calib,mag_uncalib,amd,rmd. 6 | # 7 | # SENSOR_PROVIDER options is one of -- default,native,ssc,samlite. 8 | # 9 | # SENSOR_RATE = 1~100 (Hz) 10 | # 11 | # SENSOR_SAMPLES = 1~N 12 | # 13 | # SENSOR_STATISTIC_ENABLED 14 | # bit 0: Diag Print Enabled 15 | # bit 1: Adb Print Enabled 16 | # SENSOR_STATISTIC_PRINT_COUNT 17 | # Skip Number of Print 18 | # 19 | 20 | SENSOR_SERVICE = accel 21 | SENSOR_PROVIDER = native 22 | SENSOR_RATE = 100 23 | SENSOR_SAMPLES = 1 24 | SENSOR_STATISTIC_ENABLED = 3 25 | SENSOR_STATISTIC_PRINT_COUNT = 50 26 | 27 | SENSOR_SERVICE = vehicle_accel 28 | SENSOR_PROVIDER = native 29 | SENSOR_RATE = 10 30 | SENSOR_SAMPLES = 1 31 | SENSOR_STATISTIC_ENABLED = 3 32 | SENSOR_STATISTIC_PRINT_COUNT = 50 33 | 34 | SENSOR_SERVICE = gyro 35 | SENSOR_PROVIDER = native 36 | SENSOR_RATE = 100 37 | SENSOR_SAMPLES = 1 38 | SENSOR_STATISTIC_ENABLED = 3 39 | SENSOR_STATISTIC_PRINT_COUNT = 50 40 | 41 | GNSS_POS_STATISTIC_ENABLED = 3 42 | GNSS_POS_STATISTIC_PRNTCNT = 10 43 | GNSS_MSR_STATISTIC_ENABLED = 3 44 | GNSS_MSR_STATISTIC_PRNTCNT = 10 45 | 46 | -------------------------------------------------------------------------------- /gps/etc/gps.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_motorola_addison/daf1d8d27e577517e4dd52560180746f88212165/gps/etc/gps.conf -------------------------------------------------------------------------------- /gps/etc/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file 4 | # 5 | # GENERAL DESCRIPTION 6 | # This file contains the config params for LOWI 7 | # 8 | # Copyright (c) 2012-2013 Qualcomm Atheros, Inc. 9 | # All Rights Reserved. 10 | # Qualcomm Atheros Confidential and Proprietary. 11 | # 12 | # Export of this technology or software is regulated by the U.S. Government. 13 | # Diversion contrary to U.S. law prohibited. 14 | #=============================================================================*/ 15 | 16 | # X86 ONLY - UBUNTU: 17 | # Copy this file in the same directory where the executable is 18 | 19 | # The RSSI threshold used in the RTT outlier detection in half decibels. Default value recommended by the 20 | # system team currently is -140 (corresponding to -70 dB). 21 | LOWI_RSSI_THRESHOLD_FOR_RTT = -140 22 | 23 | # Number of measurment per AP for RTS/CTS 24 | LOWI_RTS_CTS_NUM_MEAS = 5 25 | 26 | # Maximum Number of Outstanding Requests supported 27 | LOWI_MAX_OUTSTANDING_REQUEST = 255 28 | 29 | # Maximum number of records in Cache 30 | LOWI_MAX_NUM_CACHE_RECORDS = 200 31 | 32 | # Default threshold before issuing another fresh scan (ms) 33 | LOWI_FRESH_SCAN_THRESHOLD = 500 34 | 35 | # Timeout in case no result is reported by the driver (seconds) 36 | LOWI_NO_RESULT_WAIT_TOLERANCE = 10 37 | 38 | # Use Fake Wifi driver. Only valid for engineering builds 39 | LOWI_USE_FAKE_WIFI_DRIVER = 0 40 | 41 | # Use ROME Wifi driver. Only valid for engineering builds 42 | # Will be removed later only for development support 43 | LOWI_USE_ROME_WIFI_DRIVER = 0 44 | 45 | # Use LOWI LP. 46 | # When enabled the Discovery Request will be routed to LOWI-LP 47 | LOWI_USE_LOWI_LP = 1 48 | 49 | # Log level 50 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 51 | LOWI_LOG_LEVEL = 2 52 | 53 | -------------------------------------------------------------------------------- /gps/geofence/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libgeofencing 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SRC_FILES:= \ 13 | GeofenceAdapter.cpp \ 14 | location_geofence.cpp 15 | 16 | LOCAL_SHARED_LIBRARIES := \ 17 | libutils \ 18 | libcutils \ 19 | libgps.utils \ 20 | liblog \ 21 | libloc_core 22 | 23 | LOCAL_HEADER_LIBRARIES := \ 24 | libgps.utils_headers \ 25 | libloc_core_headers \ 26 | libloc_pla_headers \ 27 | liblocation_api_headers 28 | 29 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 30 | include $(BUILD_SHARED_LIBRARY) 31 | -------------------------------------------------------------------------------- /gps/geofence/location-geofence.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-geofence 7 | Description: QTI GPS Geofence 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgeofencing 10 | Cflags: -I${includedir}/location-geofence 11 | -------------------------------------------------------------------------------- /gps/gnss/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libgnss 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libdl \ 16 | liblog \ 17 | libloc_core \ 18 | libgps.utils 19 | 20 | LOCAL_SRC_FILES += \ 21 | location_gnss.cpp \ 22 | GnssAdapter.cpp \ 23 | Agps.cpp \ 24 | XtraSystemStatusObserver.cpp 25 | 26 | LOCAL_CFLAGS += \ 27 | -fno-short-enums \ 28 | 29 | ifeq ($(TARGET_BUILD_VARIANT),user) 30 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 31 | endif 32 | 33 | LOCAL_HEADER_LIBRARIES := \ 34 | libgps.utils_headers \ 35 | libloc_core_headers \ 36 | libloc_pla_headers \ 37 | liblocation_api_headers 38 | 39 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 40 | 41 | include $(BUILD_SHARED_LIBRARY) 42 | -------------------------------------------------------------------------------- /gps/gnsspps/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libgnsspps 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib 10 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 11 | LOCAL_MODULE_TAGS := optional 12 | 13 | LOCAL_SHARED_LIBRARIES := \ 14 | libutils \ 15 | libcutils \ 16 | libgps.utils \ 17 | liblog 18 | 19 | LOCAL_SRC_FILES += \ 20 | gnsspps.c 21 | 22 | LOCAL_CFLAGS += \ 23 | -fno-short-enums \ 24 | -D_ANDROID_ 25 | 26 | ## Includes 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_pla_headers 30 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 31 | include $(BUILD_SHARED_LIBRARY) 32 | 33 | include $(CLEAR_VARS) 34 | LOCAL_MODULE := libgnsspps_headers 35 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 36 | include $(BUILD_HEADER_LIBRARY) 37 | -------------------------------------------------------------------------------- /gps/gnsspps/gnsspps.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundatoin, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef _GNSSPPS_H 29 | #define _GNSSPPS_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* opens the device and fetches from PPS source */ 36 | int initPPS(char *devname); 37 | /* updates the fine time stamp */ 38 | int getPPS(struct timespec *current_ts, struct timespec *current_boottime, struct timespec *last_boottime); 39 | /* stops fetching and closes the device */ 40 | void deInitPPS(); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /gps/gnsspps/gnsspps.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gnsspps 7 | Description: QTI GPS gnsspps 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnsspps 10 | Cflags: -I${includedir}/gnsspps 11 | -------------------------------------------------------------------------------- /gps/loc_sll_if/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(call all-makefiles-under,$(LOCAL_PATH)) 4 | -------------------------------------------------------------------------------- /gps/loc_sll_if/if/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE_OWNER:=qti 6 | LOCAL_MODULE:= loc_sll_if_headers 7 | LOCAL_VENDOR_MODULE := true 8 | 9 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 10 | include $(BUILD_HEADER_LIBRARY) 11 | -------------------------------------------------------------------------------- /gps/location/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := liblocation_api 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libgps.utils \ 16 | libdl \ 17 | liblog 18 | 19 | LOCAL_SRC_FILES += \ 20 | LocationAPI.cpp \ 21 | LocationAPIClientBase.cpp 22 | 23 | LOCAL_CFLAGS += \ 24 | -fno-short-enums 25 | 26 | LOCAL_HEADER_LIBRARIES := \ 27 | libloc_pla_headers \ 28 | libgps.utils_headers 29 | 30 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 31 | include $(BUILD_SHARED_LIBRARY) 32 | 33 | include $(CLEAR_VARS) 34 | LOCAL_MODULE := liblocation_api_headers 35 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 36 | include $(BUILD_HEADER_LIBRARY) 37 | -------------------------------------------------------------------------------- /gps/location/location-api.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-api 7 | Description: Location API 8 | Version: @VERSION 9 | Libs: -L${libdir} -llocation_api 10 | Cflags: -I${includedir}/location-api 11 | -------------------------------------------------------------------------------- /gps/pla/Android.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=macro-redefined \ 5 | -Wno-error=reorder \ 6 | -Wno-error=missing-braces \ 7 | -Wno-error=self-assign \ 8 | -Wno-error=enum-conversion \ 9 | -Wno-error=logical-op-parentheses \ 10 | -Wno-error=null-arithmetic \ 11 | -Wno-error=null-conversion \ 12 | -Wno-error=parentheses-equality \ 13 | -Wno-error=undefined-bool-conversion \ 14 | -Wno-error=tautological-compare \ 15 | -Wno-error=switch \ 16 | -Wno-error=date-time 17 | 18 | LOCAL_PATH := $(call my-dir) 19 | 20 | include $(CLEAR_VARS) 21 | LOCAL_MODULE := libloc_pla_headers 22 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android 23 | include $(BUILD_HEADER_LIBRARY) 24 | -------------------------------------------------------------------------------- /gps/synergy_loc_api/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libsynergy_loc_api 6 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 7 | # activate the following line for debug purposes only, comment out for production 8 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 9 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib 10 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 11 | LOCAL_MODULE_TAGS := optional 12 | LOCAL_VENDOR_MODULE := true 13 | 14 | ifeq ($(TARGET_DEVICE),apq8026_lw) 15 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 16 | else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) 17 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 18 | endif 19 | 20 | LOCAL_SHARED_LIBRARIES := \ 21 | libutils \ 22 | libcutils \ 23 | libloc_core \ 24 | libgps.utils \ 25 | libdl \ 26 | liblog 27 | 28 | LOCAL_SRC_FILES = \ 29 | SynergyLocApi.cpp 30 | 31 | LOCAL_CFLAGS += \ 32 | -fno-short-enums \ 33 | -D_ANDROID_ 34 | 35 | ## Includes 36 | LOCAL_HEADER_LIBRARIES := \ 37 | libloc_core_headers \ 38 | libgps.utils_headers \ 39 | libloc_pla_headers \ 40 | loc_sll_if_headers \ 41 | liblocation_api_headers 42 | 43 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 44 | include $(BUILD_SHARED_LIBRARY) 45 | 46 | include $(CLEAR_VARS) 47 | LOCAL_MODULE := libsynergyloc_api_headers 48 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 49 | include $(BUILD_HEADER_LIBRARY) 50 | -------------------------------------------------------------------------------- /gps/utils/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | 6 | ## Libs 7 | LOCAL_SHARED_LIBRARIES := \ 8 | libdl \ 9 | libutils \ 10 | libcutils \ 11 | liblog \ 12 | libprocessgroup 13 | 14 | LOCAL_SRC_FILES += \ 15 | loc_log.cpp \ 16 | loc_cfg.cpp \ 17 | msg_q.c \ 18 | linked_list.c \ 19 | loc_target.cpp \ 20 | LocHeap.cpp \ 21 | LocTimer.cpp \ 22 | LocThread.cpp \ 23 | MsgTask.cpp \ 24 | loc_misc_utils.cpp \ 25 | loc_nmea.cpp \ 26 | LocIpc.cpp 27 | 28 | # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true 29 | LOCAL_CFLAGS += \ 30 | -fno-short-enums \ 31 | -D_ANDROID_ 32 | 33 | ifeq ($(TARGET_BUILD_VARIANT),user) 34 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 35 | endif 36 | 37 | LOCAL_LDFLAGS += -Wl,--export-dynamic 38 | 39 | ## Includes 40 | LOCAL_HEADER_LIBRARIES := \ 41 | libutils_headers \ 42 | libloc_pla_headers \ 43 | liblocation_api_headers 44 | 45 | LOCAL_MODULE := libgps.utils 46 | LOCAL_SANITIZE += $(GNSS_SANITIZE) 47 | # activate the following line for debug purposes only, comment out for production 48 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 49 | LOCAL_VENDOR_MODULE := true 50 | LOCAL_MODULE_TAGS := optional 51 | 52 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 53 | 54 | include $(BUILD_SHARED_LIBRARY) 55 | 56 | include $(CLEAR_VARS) 57 | LOCAL_MODULE := libgps.utils_headers 58 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 59 | include $(BUILD_HEADER_LIBRARY) 60 | -------------------------------------------------------------------------------- /hardware-moto-sensors/.gitignore: -------------------------------------------------------------------------------- 1 | doxygen/out 2 | -------------------------------------------------------------------------------- /hardware-moto-sensors/InputEventReader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_INPUT_EVENT_READER_H 18 | #define ANDROID_INPUT_EVENT_READER_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | /*****************************************************************************/ 26 | 27 | struct input_event; 28 | 29 | class InputEventCircularReader 30 | { 31 | struct input_event* const mBuffer; 32 | struct input_event* const mBufferEnd; 33 | struct input_event* mHead; 34 | struct input_event* mCurr; 35 | ssize_t mFreeSpace; 36 | 37 | public: 38 | InputEventCircularReader(size_t numEvents); 39 | ~InputEventCircularReader(); 40 | ssize_t fill(int fd); 41 | ssize_t readEvent(input_event const** events); 42 | void next(); 43 | }; 44 | 45 | /*****************************************************************************/ 46 | 47 | #endif // ANDROID_INPUT_EVENT_READER_H 48 | -------------------------------------------------------------------------------- /hardware-moto-sensors/SensorsLog.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Sensor log macros that include the function name and line number 4 | #define S_LOGE(format, x...) ALOGE("%s:%d " format, __func__, __LINE__, ##x) 5 | #define S_LOGW(format, x...) ALOGW("%s:%d " format, __func__, __LINE__, ##x) 6 | #define S_LOGI(format, x...) ALOGI("%s:%d " format, __func__, __LINE__, ##x) 7 | #define S_LOGD(format, x...) ALOGD("%s:%d " format, __func__, __LINE__, ##x) 8 | #define S_LOGV(format, x...) ALOGV("%s:%d " format, __func__, __LINE__, ##x) 9 | 10 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/AKCommon.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: AKCommon.h 983 2013-02-08 04:43:03Z miyazaki.hr $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKMD_INC_AKCOMMON_H 25 | #define AKMD_INC_AKCOMMON_H 26 | 27 | #include //errno 28 | #include //va_list 29 | #include //frpintf 30 | #include //atoi 31 | #include //memset 32 | #include 33 | 34 | #include "AKMLog.h" 35 | 36 | /*** Constant definition ******************************************************/ 37 | 38 | /* Definition for operation mode */ 39 | #define OPMODE_CONSOLE (0x01) 40 | 41 | /*** Type declaration *********************************************************/ 42 | 43 | /*** Global variables *********************************************************/ 44 | extern int g_stopRequest; /*!< 0:Not stop, 1:Stop */ 45 | extern int g_opmode; /*!< 0:Daemon mode, 1:Console mode. */ 46 | extern int g_dbgzone; /*!< Debug zone. */ 47 | 48 | /*** Prototype of function ****************************************************/ 49 | 50 | #endif //AKMD_INC_AKCOMMON_H 51 | 52 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/Acc_aot.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: Acc_aot.h 983 2013-02-08 04:43:03Z miyazaki.hr $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKMD_INC_ACCAOT_H 25 | #define AKMD_INC_ACCAOT_H 26 | 27 | #include "AKMD_Driver.h" 28 | 29 | /*** Constant definition ******************************************************/ 30 | 31 | /*** Type declaration *********************************************************/ 32 | 33 | /*** Global variables *********************************************************/ 34 | 35 | /*** Prototype of function ****************************************************/ 36 | int16_t AOT_InitDevice(void); 37 | void AOT_DeinitDevice(void); 38 | int16_t AOT_SetEnable(const int8_t enabled); 39 | int16_t AOT_SetDelay(const int64_t ns); 40 | int16_t AOT_GetAccData(int16_t data[3]); 41 | int16_t AOT_GetAccOffset(int16_t offset[3]); 42 | void AOT_GetAccVector(const int16_t data[3], const int16_t offset[3], int16_t vec[3]); 43 | 44 | #endif //AKMD_INC_ACCAOT_H 45 | 46 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/FST.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: FST.h 983 2013-02-08 04:43:03Z miyazaki.hr $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKMD_INC_FST_H 25 | #define AKMD_INC_FST_H 26 | 27 | #include "AKCommon.h" 28 | #include "AKCompass.h" 29 | 30 | int16 FST_Body(void); 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/AKCertification.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: AKCertification.h 255 2014-06-12 06:04:43Z yamada.rj $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKSC_INC_AKCERTIFICATION_H 25 | #define AKSC_INC_AKCERTIFICATION_H 26 | 27 | //========================= Type declaration ===========================// 28 | #define AKSC_CI_MAX_CHARSIZE 16 29 | #define AKSC_CI_MAX_KEYSIZE 16 30 | #define AKSC_CERTIFICATION_CERTIFICATED ((int16)0x0001) 31 | #define AKSC_CERTIFICATION_DENIED ((int16)0x8000) 32 | 33 | //========================= Constant definition =========================// 34 | 35 | //========================= Prototype of Function =======================// 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/AKManualCal.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: AKManualCal.h 255 2014-06-12 06:04:43Z yamada.rj $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKSC_INC_AKMANUALCAL_H 25 | #define AKSC_INC_AKMANUALCAL_H 26 | 27 | #include "AKMDevice.h" 28 | 29 | //========================= Type declaration ===========================// 30 | 31 | //========================= Constant definition =========================// 32 | 33 | //========================= Prototype of Function =======================// 34 | AKLIB_C_API_START 35 | int16 AKSC_HOffsetCal( //(o) : Calibration success(1), failure(0) 36 | const int16vec hdata[], //(i) : Geomagnetic vectors(the size must be 3) 37 | int16vec *ho //(o) : Offset(5Q11) 38 | ); 39 | 40 | AKLIB_C_API_END 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/AKVersion.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * $Id: AKVersion.h 176 2013-06-27 08:36:56Z yamada.rj $ 4 | * 5 | * -- Copyright Notice -- 6 | * 7 | * Copyright (c) 2004 Asahi Kasei Microdevices Corporation, Japan 8 | * All Rights Reserved. 9 | * 10 | * This software program is the proprietary program of Asahi Kasei Microdevices 11 | * Corporation("AKM") licensed to authorized Licensee under the respective 12 | * agreement between the Licensee and AKM only for use with AKM's electronic 13 | * compass IC. 14 | * 15 | * THIS SOFTWARE IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABLITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT OF 18 | * THIRD PARTY RIGHTS, AND WE SHALL NOT BE LIABLE FOR ANY LOSSES AND DAMAGES 19 | * WHICH MAY OCCUR THROUGH USE OF THIS SOFTWARE. 20 | * 21 | * -- End Asahi Kasei Microdevices Copyright Notice -- 22 | * 23 | ******************************************************************************/ 24 | #ifndef AKSC_INC_AKVERSION_H 25 | #define AKSC_INC_AKVERSION_H 26 | 27 | #include "AKMDevice.h" 28 | 29 | //========================= Type declaration ===========================// 30 | 31 | //========================= Constant definition =========================// 32 | 33 | //========================= Prototype of Function =======================// 34 | AKLIB_C_API_START 35 | int16 AKSC_GetVersion_Major(void); 36 | int16 AKSC_GetVersion_Minor(void); 37 | int16 AKSC_GetVersion_Revision(void); 38 | int16 AKSC_GetVersion_DateCode(void); 39 | int16 AKSC_GetVersion_Variation(void); 40 | int16 AKSC_GetVersion_Device(void); 41 | AKLIB_C_API_END 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/arm/libAK09912.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_motorola_addison/daf1d8d27e577517e4dd52560180746f88212165/hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/arm/libAK09912.a -------------------------------------------------------------------------------- /hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/arm64/libAK09912.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_motorola_addison/daf1d8d27e577517e4dd52560180746f88212165/hardware-moto-sensors/ak09912_akmd_6D_32b/libSmartCompass/arm64/libAK09912.a -------------------------------------------------------------------------------- /hardware-moto-sensors/capsensor/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2015 Motorola Mobility, Inc. 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ifeq ($(BOARD_USES_CAP_SENSOR_SX9310), true) 17 | LOCAL_PATH := $(call my-dir) 18 | 19 | include $(CLEAR_VARS) 20 | LOCAL_MODULE := capsense_reset 21 | LOCAL_SRC_FILES := capsense.cpp 22 | LOCAL_SHARED_LIBRARIES := libc liblog libcutils libhardware_legacy 23 | LOCAL_MODULE_TAGS := optional 24 | LOCAL_VENDOR_MODULE := true 25 | LOCAL_MODULE_OWNER := moto 26 | include $(BUILD_EXECUTABLE) 27 | endif 28 | -------------------------------------------------------------------------------- /hardware-moto-sensors/capsensor/capsense.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include // for PAGE_SIZE 9 | #include 10 | #include 11 | 12 | #define LOG_TAG "hsj-listen" 13 | #define CAPRESET "/sys/class/capsense/reset" 14 | #define HSJ_EV "change@/devices/virtual/switch/h2w" 15 | 16 | void uevent_handler(void *data, const char *msg, int msg_len); 17 | 18 | int main(void) 19 | { 20 | static char uevent_data[PAGE_SIZE]; 21 | int len; 22 | 23 | uevent_data[PAGE_SIZE-1] = '\0'; 24 | 25 | uevent_init(); 26 | 27 | // never returns 28 | while (1) { 29 | len = uevent_next_event(uevent_data, (int)(sizeof(uevent_data)) - 1); 30 | if(!strncmp(uevent_data, HSJ_EV, len)) { 31 | int fd = open(CAPRESET, O_WRONLY); 32 | if (fd < 0) { 33 | KLOG_ERROR(LOG_TAG, "Can't open capreset, %s\n", strerror(errno)); 34 | continue; 35 | } 36 | len = TEMP_FAILURE_RETRY(write(fd, "1", 1)); 37 | if (len < 1) { 38 | KLOG_ERROR(LOG_TAG, "Can't write capreset, %s\n", strerror(errno)); 39 | } 40 | close(fd); 41 | } 42 | } 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /hardware-moto-sensors/doxygen/README.md: -------------------------------------------------------------------------------- 1 | Sensors HAL 2 | =========== 3 | 4 | Dynamic Sensors Overview 5 | ======================== 6 | 7 | There are 3 main components to the dynamic sensors: 8 | 9 | 1. The [GreyBus interface](@ref doxygen/GreyBus.md) between the phone's 10 | kernel GreyBus module and the MOD 11 | 2. The [IIO interface](@ref doxygen/IIO.md) between the kernel GreyBus 12 | module and user-space 13 | 3. The [IIO HAL](@ref doxygen/HAL.md) (or sub-HAL) interface between the 14 | kernel `sysfs` and the Android framework. 15 | 16 | Each one will be discussed and documented in a separate chapter. 17 | -------------------------------------------------------------------------------- /hardware-moto-sensors/iio_hal/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2015 Motorola Mobility, Inc. 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_MODULE := sensors.iio 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MULTILIB := both 23 | 24 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 25 | LOCAL_CFLAGS += -DDEBUG 26 | endif 27 | 28 | LOCAL_CFLAGS += -DLOG_TAG=\"IioSensors\" 29 | 30 | LOCAL_SRC_FILES := \ 31 | Hal.cpp \ 32 | IioHal.cpp \ 33 | DynamicMetaSensor.cpp \ 34 | IioSensor.cpp \ 35 | UeventListener.cpp \ 36 | ../motosh_hal/SensorBase.cpp 37 | 38 | LOCAL_C_INCLUDES += \ 39 | $(LOCAL_PATH)/.. \ 40 | $(LOCAL_PATH)/../motosh_hal \ 41 | system/core/base/include \ 42 | external/libselinux/include \ 43 | 44 | 45 | LOCAL_SHARED_LIBRARIES += libiio.vendor libcrypto 46 | LOCAL_HEADER_LIBRARIES := libutils_headers libhardware_headers libiio.vendor_headers 47 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 48 | LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libc libbase libselinux 49 | LOCAL_CFLAGS += -Wall -Wextra 50 | LOCAL_CXXFLAGS += -Weffc++ -std=c++14 51 | 52 | #LOCAL_PRELINK_MODULE := false 53 | 54 | LOCAL_VENDOR_MODULE := true 55 | 56 | include $(BUILD_SHARED_LIBRARY) 57 | 58 | -------------------------------------------------------------------------------- /hardware-moto-sensors/iio_hal/Hal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Motorola Mobility 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "IioHal.h" 18 | 19 | /** This is it. The entry point to this HAL. Every hardware module must have a 20 | * data structure named HAL_MODULE_INFO_SYM. IioHal provides the specialization 21 | * necessary to make this a Dynamic IIO Sensors HAL. */ 22 | SensorsModuleT< IioHal > HAL_MODULE_INFO_SYM("Dynamic IIO Sensors Module"); 23 | 24 | -------------------------------------------------------------------------------- /hardware-moto-sensors/iio_utils/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ifeq ($(MOT_SENSOR_HUB_HW_TYPE_L4), true) 4 | 5 | ################################################################################ 6 | ## lsiio ####################################################################### 7 | include $(CLEAR_VARS) 8 | LOCAL_MODULE_TAGS := optional 9 | LOCAL_MODULE := lsiio 10 | LOCAL_CFLAGS += -Wall -Wextra 11 | 12 | LOCAL_SRC_FILES := lsiio.c 13 | 14 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 15 | 16 | include $(BUILD_EXECUTABLE) 17 | 18 | ################################################################################ 19 | ## IIO Event Monitor ########################################################### 20 | include $(CLEAR_VARS) 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE := iio_event_monitor 23 | LOCAL_CFLAGS += -Wall -Wextra 24 | 25 | LOCAL_SRC_FILES := iio_event_monitor.c 26 | 27 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 28 | 29 | include $(BUILD_EXECUTABLE) 30 | 31 | ################################################################################ 32 | ## Generic Buffer ############################################################## 33 | include $(CLEAR_VARS) 34 | LOCAL_MODULE_TAGS := optional 35 | LOCAL_MODULE := generic_buffer 36 | LOCAL_CFLAGS += -Wall -Wextra 37 | 38 | LOCAL_SRC_FILES := generic_buffer.c 39 | 40 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 41 | 42 | include $(BUILD_EXECUTABLE) 43 | 44 | endif # MOT_SENSOR_HUB_HW_TYPE_L4 45 | -------------------------------------------------------------------------------- /hardware-moto-sensors/iio_utils/NOTICE: -------------------------------------------------------------------------------- 1 | Industrialio event test code. 2 | 3 | Copyright (c) 2011-2012 Lars-Peter Clausen 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU General Public License version 2 as published by 7 | the Free Software Foundation. 8 | 9 | This program is primarily intended as an example application. 10 | Reads the current buffer setup from sysfs and starts a short capture 11 | from the specified device, pretty printing the result after appropriate 12 | conversion. 13 | -------------------------------------------------------------------------------- /hardware-moto-sensors/iio_utils/README: -------------------------------------------------------------------------------- 1 | This directory contains some IIO utilities from the Linux Kernel's 2 | drivers/staging/iio/Documentation directory. 3 | -------------------------------------------------------------------------------- /hardware-moto-sensors/libiio/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Android Open Source Project 2 | 3 | cc_library_headers { 4 | name: "libiio.vendor_headers", 5 | export_include_dirs: ["include"], 6 | } 7 | 8 | cc_library_shared { 9 | name: "libiio.vendor", 10 | vendor_available: true, 11 | srcs: [ 12 | "src/backend.c", 13 | "src/buffer.c", 14 | "src/channel.c", 15 | "src/context.c", 16 | "src/device.c", 17 | "src/local.c", 18 | "src/scan.c", 19 | "src/sort.c", 20 | "src/utilities.c", 21 | ], 22 | 23 | cflags: [ 24 | "-Wall", 25 | "-Werror", 26 | "-Wno-sign-compare", 27 | "-Wno-unused-parameter", 28 | ], 29 | } 30 | -------------------------------------------------------------------------------- /hardware-moto-sensors/libiio/src: -------------------------------------------------------------------------------- 1 | ../../../../../external/libiio/src/ -------------------------------------------------------------------------------- /hardware-moto-sensors/libsensorhub/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2015 Motorola Mobility, Inc. 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_MODULE := libsensorhub 21 | LOCAL_MODULE_TAGS := optional 22 | 23 | ifeq ($(MOT_SENSOR_HUB_HW_TYPE_L4), true) 24 | LOCAL_CFLAGS += -DMOTOSH 25 | else ifeq ($(MOT_SENSOR_HUB_HW_TYPE_L0), true) 26 | LOCAL_CFLAGS += -DSTML0XX 27 | endif 28 | 29 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 30 | LOCAL_CFLAGS += -DDEBUG 31 | endif 32 | 33 | LOCAL_SRC_FILES := \ 34 | SensorHub.cpp Endian.cpp 35 | 36 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 37 | 38 | LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libc 39 | LOCAL_CFLAGS += -Wall -Wextra 40 | LOCAL_CXXFLAGS += -Weffc++ -std=c++14 41 | 42 | LOCAL_VENDOR_MODULE := true 43 | 44 | include $(BUILD_SHARED_LIBRARY) 45 | 46 | -------------------------------------------------------------------------------- /hardware-moto-sensors/libsensorhub/Endian.cpp: -------------------------------------------------------------------------------- 1 | #include "Endian.hpp" 2 | 3 | const Endian::TestUnion Endian::test = { 0x01020408 }; 4 | const bool Endian::bigEndian = Endian::test.v[0] == 1; 5 | 6 | -------------------------------------------------------------------------------- /hardware-moto-sensors/motosh_bin/CRC32.h: -------------------------------------------------------------------------------- 1 | #ifndef CRC_32_H 2 | #define CRC_32_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | uint32_t calculateCrc32(uint8_t *data, size_t dataLen); 12 | int calculateFileCrc32(char *filePath, size_t dataLen, uint8_t fill, uint32_t *outCrc); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /hardware-moto-sensors/motosh_bin/sensorhub-blacklist.txt: -------------------------------------------------------------------------------- 1 | # Lines with a '#' in the first column are ignored. 2 | # Empty lines will also be ignored. 3 | # 4 | # This file should contain the CRC32 (as computed by motosh) of all firmware 5 | # versions released through the PlayStore. The assumption is that any features 6 | # or fixes present in these firmware versions have already been incorporated 7 | # into the build containing this blacklist, and therefore should be deleted 8 | # by motosh if encountered. 9 | # 10 | # The format is 8 ASCII-HEX characters, with no leading "0x", one per line. 11 | # For example: abcdef57 12 | # 13 | # For easier tracking, please include a comment above each entry containing 14 | # the version string of the firmware. 15 | 16 | 17 | -------------------------------------------------------------------------------- /hardware-moto-sensors/motosh_hal/Android.mk: -------------------------------------------------------------------------------- 1 | 2 | LOCAL_PATH := $(call my-dir) 3 | 4 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 5 | -------------------------------------------------------------------------------- /hardware-moto-sensors/motosh_hal/SensorHal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 Motorola Mobility 3 | * 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "SensorsPollContext.h" 20 | 21 | /** This is the HAL entry point. The main() equivalent. Every hardware module 22 | * must have a data structure named HAL_MODULE_INFO_SYM. */ 23 | SensorsModuleT< SensorsPollContext > HAL_MODULE_INFO_SYM("Motorola Sensors Module"); 24 | 25 | -------------------------------------------------------------------------------- /hardware-moto-sensors/motosh_hal/SensorsPollContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 Motorola Mobility 3 | * 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef SENSORS_POLL_CONTEXT_H 20 | #define SENSORS_POLL_CONTEXT_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #include 40 | 41 | #include 42 | 43 | #include "Sensors.h" 44 | #include "HubSensors.h" 45 | #include "BaseHal.h" 46 | 47 | /** 48 | * This is a HAL primarily dedicated to handling SensorHub sensors. The bulk of 49 | * the work is done by the HubSensors driver. 50 | */ 51 | class SensorsPollContext : public BaseHal { 52 | public: 53 | SensorsPollContext(); 54 | virtual ~SensorsPollContext() = default; 55 | 56 | virtual int poll(sensors_event_t* data, int count) override; 57 | 58 | virtual int getSensorsList(struct sensor_t const** list) override; 59 | 60 | private: 61 | DISALLOW_COPY_AND_ASSIGN(SensorsPollContext); 62 | 63 | std::vector pollFds; 64 | 65 | /// Used to map file descriptors to corresponding drivers 66 | std::map> fd2driver; 67 | }; 68 | 69 | #endif /* SENSORS_POLL_CONTEXT_H */ 70 | -------------------------------------------------------------------------------- /hardware-moto-sensors/rearProx/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ifeq ($(filter true, $(BOARD_USES_REAR_PROX) $(BOARD_USES_NATIVE_SENSOR)), true) 16 | 17 | LOCAL_PATH := $(call my-dir) 18 | 19 | # HAL module implemenation, not prelinked, and stored in 20 | # hw/..so 21 | include $(CLEAR_VARS) 22 | 23 | LOCAL_MODULE := sensors.rp 24 | 25 | 26 | 27 | LOCAL_MODULE_TAGS := optional 28 | 29 | LOCAL_VENDOR_MODULE := true 30 | LOCAL_HEADER_LIBRARIES := libhardware_headers 31 | LOCAL_CLANG := true 32 | 33 | LOCAL_SRC_FILES := \ 34 | sensors.cpp \ 35 | SensorBase.cpp \ 36 | ProximitySensor.cpp \ 37 | CapSensor.cpp \ 38 | InputEventReader.cpp \ 39 | NativeSensorManager.cpp 40 | 41 | LOCAL_SHARED_LIBRARIES += \ 42 | libc \ 43 | libutils \ 44 | libcutils \ 45 | liblog \ 46 | libdl 47 | 48 | 49 | include $(BUILD_SHARED_LIBRARY) 50 | 51 | endif 52 | -------------------------------------------------------------------------------- /hardware-moto-sensors/rearProx/CapSensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CAPSENSOR_SENSOR_H 18 | #define ANDROID_CAPSENSOR_SENSOR_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "SensorBase.h" 26 | #include "InputEventReader.h" 27 | #include "NativeSensorManager.h" 28 | 29 | /*****************************************************************************/ 30 | 31 | struct input_event; 32 | 33 | class CapSensor : public SensorBase { 34 | InputEventCircularReader mInputReader; 35 | sensors_event_t mPendingEvent; 36 | bool mHasPendingEvent; 37 | 38 | int setInitialState(); 39 | float indexToValue(size_t index) const; 40 | 41 | public: 42 | CapSensor(struct SensorContext *context); 43 | virtual ~CapSensor(); 44 | virtual int readEvents(sensors_event_t* data, int count); 45 | virtual bool hasPendingEvents() const; 46 | virtual int enable(int32_t handle, int enabled); 47 | virtual int setDelay(int32_t handle, int64_t ns); 48 | }; 49 | 50 | /*****************************************************************************/ 51 | 52 | #endif // ANDROID_CAPSENSOR_SENSOR_H 53 | 54 | -------------------------------------------------------------------------------- /hardware-moto-sensors/rearProx/InputEventReader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_INPUT_EVENT_READER_H 18 | #define ANDROID_INPUT_EVENT_READER_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | /*****************************************************************************/ 26 | 27 | struct input_event; 28 | 29 | class InputEventCircularReader 30 | { 31 | struct input_event* const mBuffer; 32 | struct input_event* const mBufferEnd; 33 | struct input_event* mHead; 34 | struct input_event* mCurr; 35 | ssize_t mFreeSpace; 36 | 37 | public: 38 | InputEventCircularReader(size_t numEvents); 39 | ~InputEventCircularReader(); 40 | ssize_t fill(int fd); 41 | ssize_t readEvent(input_event const** events); 42 | void next(); 43 | }; 44 | 45 | /*****************************************************************************/ 46 | 47 | #endif // ANDROID_INPUT_EVENT_READER_H 48 | -------------------------------------------------------------------------------- /hardware-moto-sensors/rearProx/ProximitySensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_PROXIMITY_SENSOR_H 18 | #define ANDROID_PROXIMITY_SENSOR_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "SensorBase.h" 26 | #include "InputEventReader.h" 27 | #include "NativeSensorManager.h" 28 | 29 | /*****************************************************************************/ 30 | 31 | struct input_event; 32 | 33 | class ProximitySensor : public SensorBase { 34 | InputEventCircularReader mInputReader; 35 | sensors_event_t mPendingEvent; 36 | bool mHasPendingEvent; 37 | int sensor_index; 38 | 39 | int setInitialState(); 40 | float indexToValue(size_t index) const; 41 | 42 | public: 43 | ProximitySensor(struct SensorContext *context); 44 | virtual ~ProximitySensor(); 45 | virtual int readEvents(sensors_event_t* data, int count); 46 | virtual bool hasPendingEvents() const; 47 | virtual int enable(int32_t handle, int enabled); 48 | virtual int setDelay(int32_t handle, int64_t ns); 49 | }; 50 | 51 | /*****************************************************************************/ 52 | 53 | #endif // ANDROID_PROXIMITY_SENSOR_H 54 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/CapSense.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_CAPSENSE_H 18 | #define ANDROID_CAPSENSE_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "Sensors.h" 26 | #include "SensorBase.h" 27 | #include "InputEventReader.h" 28 | 29 | /*****************************************************************************/ 30 | 31 | struct input_event; 32 | 33 | class CapSense : public SensorBase { 34 | public: 35 | CapSense(); 36 | virtual ~CapSense(); 37 | 38 | virtual int setEnable(int32_t handle, int enabled) override; 39 | virtual int setDelay(int32_t handle, int64_t ns) override; 40 | virtual int readEvents(sensors_event_t* data, int count) override; 41 | virtual int flush(int32_t handle) override; 42 | 43 | virtual int getEnable(int32_t handle); 44 | void processEvent(int code, int value); 45 | static CapSense* getInstance(); 46 | private: 47 | uint32_t mEnabled; 48 | uint32_t mPendingMask; 49 | InputEventCircularReader mInputReader; 50 | sensors_event_t mPendingEvents; 51 | sensors_event_t mFlushEvents; 52 | uint64_t mDelays; 53 | uint32_t mFlushEnabled; 54 | static CapSense self; 55 | }; 56 | 57 | /*****************************************************************************/ 58 | 59 | #endif // ANDROID_CAPSENSE_H 60 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/FusionSensorBase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2015 Motorola Mobility LLC 19 | */ 20 | 21 | #include "FusionSensorBase.h" 22 | 23 | FusionSensorBase::FusionSensorBase() 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/GeoMagRotationVector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2016 Motorola Mobility LLC 19 | */ 20 | 21 | #ifndef GEOMAG_ROTATION_VECTOR_H 22 | #define GEOMAG_ROTATION_VECTOR_H 23 | 24 | #include 25 | #include "FusionSensorBase.h" 26 | 27 | class GeoMagRotationVector : public FusionSensorBase { 28 | public: 29 | GeoMagRotationVector(); 30 | virtual ~GeoMagRotationVector(); 31 | 32 | static GeoMagRotationVector* getInstance(); 33 | 34 | bool processFusion(FusionData& fusionData, bool reset); 35 | 36 | private: 37 | static GeoMagRotationVector self; 38 | }; 39 | 40 | #endif // GEOMAG_ROTATION_VECTOR_H 41 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/GyroIntegration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2016 Motorola Mobility LLC 19 | */ 20 | 21 | #ifndef GYRO_INTEGRATION_H 22 | #define GYRO_INTEGRATION_H 23 | 24 | #include 25 | 26 | #include "FusionSensorBase.h" 27 | 28 | /* 29 | * \brief State to be passed into \c gyroIntegration() 30 | * 31 | * \see \c gyroIntegration() 32 | */ 33 | struct GyroIntegrationState 34 | { 35 | int initialized; 36 | QuatData quatGyro; 37 | }; 38 | 39 | class GyroIntegration { 40 | public: 41 | /* 42 | * \brief Use gyro to integrate a rotation vector forward 43 | * 44 | * Memoryless (stateless, amnesiatic...) function to integrate rvIn with 45 | * gyro to produce rvOut. 46 | * 47 | * \see \c GyroIntegrationState 48 | * 49 | * \param[inout] gis state of the function 50 | * \param[out] rvOut output integrated rotation vector 51 | * \param[in] rvIn input rotation vector to integrate 52 | * \param[in] rvGyroDelta if not null, stores the incremental gyro rotation 53 | * \param[in] timeStamp gyro data timestamp 54 | * vector 55 | */ 56 | 57 | static void integrate( 58 | struct GyroIntegrationState* gis, 59 | QuatData& rvOut, 60 | const QuatData& rvIn, 61 | FusionData& fusionData 62 | ); 63 | }; 64 | 65 | #endif // GYRO_INTEGRATION_H 66 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/LinearAccelGravity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2015 Motorola Mobility LLC 19 | */ 20 | 21 | #ifndef LINEAR_ACCEL_GRAVITY_H 22 | #define LINEAR_ACCEL_GRAVITY_H 23 | 24 | #include 25 | #include "FusionSensorBase.h" 26 | 27 | class LinearAccelGravity : public FusionSensorBase { 28 | public: 29 | LinearAccelGravity(); 30 | virtual ~LinearAccelGravity(); 31 | 32 | static LinearAccelGravity* getInstance(); 33 | 34 | bool processFusion(FusionData& fusionData, bool reset); 35 | 36 | private: 37 | static LinearAccelGravity self; 38 | float gameRVData[4]; 39 | int64_t gameRVts; 40 | }; 41 | 42 | #endif // LINEAR_ACCEL_GRAVITY_H 43 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/RearProxSensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_LASERPROX_SENSOR_H 18 | #define ANDROID_LASERPROX_SENSOR_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #include "Sensors.h" 26 | #include "SensorBase.h" 27 | #include "InputEventReader.h" 28 | 29 | /*****************************************************************************/ 30 | 31 | struct input_event; 32 | 33 | class RearProxSensor : public SensorBase { 34 | public: 35 | RearProxSensor(int n); 36 | virtual ~RearProxSensor(); 37 | 38 | virtual int setEnable(int32_t handle, int enabled) override; 39 | virtual int setDelay(int32_t handle, int64_t ns) override; 40 | virtual int readEvents(sensors_event_t* data, int count) override; 41 | virtual int flush(int32_t handle) override; 42 | 43 | virtual int getEnable(int32_t handle); 44 | void processEvent(int code, int value); 45 | private: 46 | uint32_t mEnabled; 47 | uint32_t mPendingMask; 48 | #ifdef _ENABLE_REARPROX_2 49 | uint32_t numrp; 50 | #endif 51 | InputEventCircularReader mInputReader; 52 | sensors_event_t mPendingEvents; 53 | sensors_event_t mFlushEvents; 54 | uint64_t mDelays; 55 | uint32_t mFlushEnabled; 56 | static RearProxSensor self; 57 | }; 58 | 59 | /*****************************************************************************/ 60 | 61 | #endif // ANDROID_LASERPROX_SENSOR_H 62 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/RotationVector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2016 Motorola Mobility LLC 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "GyroIntegration.h" 26 | #include "Quaternion.h" 27 | #include "RotationVector.h" 28 | #include "SensorList.h" 29 | 30 | RotationVector RotationVector::self; 31 | 32 | RotationVector::RotationVector() 33 | { 34 | } 35 | 36 | RotationVector::~RotationVector() 37 | { 38 | } 39 | 40 | RotationVector *RotationVector::getInstance() 41 | { 42 | return &self; 43 | } 44 | 45 | bool RotationVector::processFusion(FusionData& fusionData, bool reset) 46 | { 47 | static struct GyroIntegrationState gis; 48 | 49 | if (reset) { 50 | gis.initialized = 0; 51 | } 52 | 53 | // Integrate forward the 6-axis 54 | GyroIntegration::integrate(&gis, fusionData.rotationVector, fusionData.geoMagRotation, fusionData); 55 | fusionData.rotationVector.accuracy = 0; 56 | fusionData.rotationVector.timestamp = fusionData.gyro.timestamp; 57 | 58 | return true; 59 | } 60 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/RotationVector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /* 18 | * Copyright (C) 2016 Motorola Mobility LLC 19 | */ 20 | 21 | #ifndef ROTATION_VECTOR_H 22 | #define ROTATION_VECTOR_H 23 | 24 | #include 25 | #include "FusionSensorBase.h" 26 | 27 | class RotationVector : public FusionSensorBase { 28 | public: 29 | RotationVector(); 30 | virtual ~RotationVector(); 31 | 32 | static RotationVector* getInstance(); 33 | 34 | bool processFusion(FusionData& fusionData, bool reset); 35 | 36 | private: 37 | static RotationVector self; 38 | }; 39 | 40 | #endif // ROTATION_VECTOR_H 41 | -------------------------------------------------------------------------------- /hardware-moto-sensors/stml0xx_hal/SensorList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Motorola Mobility 3 | * 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef SENSORLIST_H 20 | #define SENSORLIST_H 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include "Sensors.h" 30 | 31 | #define ACCEL_MAX_DELAY_US 200000 32 | #define ACCEL_MIN_DELAY_US 10000 33 | 34 | #define GYRO_MAX_DELAY_US 200000 35 | #define GYRO_MIN_DELAY_US 5000 36 | 37 | #define MAG_MAX_DELAY_US 200000 38 | #define MAG_MIN_DELAY_US 20000 39 | 40 | #define FUSION_MAX_DELAY_US 10000 41 | 42 | extern std::vector sSensorList; 43 | #ifdef _ENABLE_MAGNETOMETER 44 | extern const struct sensor_t threeAxCalMagSensorType; 45 | extern const struct sensor_t threeAxunCalMagSensorType; 46 | extern const struct sensor_t orientationSensorType; 47 | extern const struct sensor_t geoRotationSensorType; 48 | extern const struct sensor_t rotationSensorType; 49 | #endif // _ENABLE_MAGNETOMETER 50 | #ifdef _ENABLE_CAPSENSE 51 | extern const struct sensor_t capSensorType; 52 | #endif // _ENABLE_CAPSENSE 53 | #endif // SENSORLIST_H 54 | 55 | -------------------------------------------------------------------------------- /hardware-moto-sensors/tof_hal/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009-2015 Motorola Mobility, Inc. 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_MODULE := sensors.tof 21 | LOCAL_MODULE_TAGS := optional 22 | 23 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 24 | LOCAL_CFLAGS += -DDEBUG 25 | endif 26 | 27 | LOCAL_CFLAGS += -DLOG_TAG=\"ToFSensors\" 28 | 29 | LOCAL_SRC_FILES := \ 30 | TofModule.cpp \ 31 | RearProxSensor.cpp \ 32 | SensorsPollContext.cpp \ 33 | ../motosh_hal/SensorBase.cpp \ 34 | ../InputEventReader.cpp 35 | 36 | LOCAL_C_INCLUDES += \ 37 | $(LOCAL_PATH)/.. \ 38 | $(LOCAL_PATH)/../motosh_hal \ 39 | system/core/base/include \ 40 | 41 | LOCAL_C_INCLUDES += external/zlib 42 | 43 | LOCAL_HEADER_LIBRARIES := libutils_headers libhardware_headers 44 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 45 | LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libc libbase 46 | LOCAL_CFLAGS += -Wall -Wextra 47 | LOCAL_CXXFLAGS += -Weffc++ -std=c++14 48 | 49 | #LOCAL_PRELINK_MODULE := false 50 | 51 | LOCAL_VENDOR_MODULE := true 52 | 53 | include $(BUILD_SHARED_LIBRARY) 54 | 55 | -------------------------------------------------------------------------------- /hardware-moto-sensors/tof_hal/TofModule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 Motorola Mobility 3 | * 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "SensorsPollContext.h" 20 | 21 | /** This is the HAL entry point. The main() equivalent. Every hardware module 22 | * must have a data structure named HAL_MODULE_INFO_SYM. */ 23 | SensorsModuleT< SensorsPollContext > HAL_MODULE_INFO_SYM("ToF Sensor Module"); 24 | 25 | -------------------------------------------------------------------------------- /hardware-moto-sensors/utils/sensor_time.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Motorola Mobility 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "sensor_time.h" 18 | #include 19 | 20 | int64_t sensor_elapsed_realtime() { 21 | return android::elapsedRealtime(); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /hardware-moto-sensors/utils/sensor_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Motorola Mobility 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SENSOR_TIME_H 18 | #define SENSOR_TIME_H 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | #define EXTERNC extern "C" 24 | #else 25 | #define EXTERNC 26 | #endif 27 | 28 | EXTERNC int64_t sensor_elapsed_realtime(); 29 | 30 | #undef EXTERNC 31 | 32 | #endif // SENSOR_TIME_H 33 | -------------------------------------------------------------------------------- /hardware-moto-sensors/vl53l0_hal/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017 Motorola Mobility, Inc. 2 | # Copyright (C) 2008 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | LOCAL_PATH := $(call my-dir) 17 | 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_MODULE := sensors.tof.vl53l0 21 | LOCAL_MODULE_TAGS := optional 22 | 23 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) 24 | LOCAL_CFLAGS += -DDEBUG 25 | endif 26 | 27 | LOCAL_CFLAGS += -DLOG_TAG=\"ToFSensors\" 28 | 29 | LOCAL_SRC_FILES := \ 30 | TofModule.cpp \ 31 | RearProxSensor.cpp \ 32 | SensorsPollContext.cpp \ 33 | SensorBase.cpp \ 34 | ../InputEventReader.cpp 35 | 36 | LOCAL_C_INCLUDES += \ 37 | $(LOCAL_PATH)/.. \ 38 | system/core/base/include \ 39 | 40 | LOCAL_C_INCLUDES += external/zlib 41 | 42 | LOCAL_HEADER_LIBRARIES := libutils_headers libhardware_headers 43 | LOCAL_HEADER_LIBRARIES += generated_kernel_headers 44 | LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libc libbase 45 | LOCAL_CFLAGS += -Wall -Wextra 46 | LOCAL_CXXFLAGS += -Weffc++ -std=c++14 47 | 48 | #LOCAL_PRELINK_MODULE := false 49 | 50 | LOCAL_VENDOR_MODULE := true 51 | 52 | include $(BUILD_SHARED_LIBRARY) 53 | 54 | -------------------------------------------------------------------------------- /hardware-moto-sensors/vl53l0_hal/TofModule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Motorola Mobility 3 | * 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "SensorsPollContext.h" 20 | 21 | /** This is the HAL entry point. The main() equivalent. Every hardware module 22 | * must have a data structure named HAL_MODULE_INFO_SYM. */ 23 | SensorsModuleT< SensorsPollContext > HAL_MODULE_INFO_SYM("ToF Sensor Module"); 24 | 25 | -------------------------------------------------------------------------------- /idc/fpc1020.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = fpc1020 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 0 -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019-2020 The LineageOS Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | cc_library_static { 18 | name: "libinit_msm8953", 19 | recovery_available: true, 20 | srcs: ["init_msm8953.cpp"], 21 | include_dirs: [ 22 | "system/core/base/include", 23 | "system/core/init" 24 | ], 25 | shared_libs: [ 26 | "libbase", 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /keylayout/fpc1020.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | # fpc1020 "finger present" 12 | key 614 NOTHING 13 | -------------------------------------------------------------------------------- /libhidl/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include $(CLEAR_VARS) 17 | LOCAL_SHARED_LIBRARIES := libhidlbase 18 | LOCAL_MODULE := android.hidl.base@1.0 19 | LOCAL_MODULE_TAGS := optional 20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 21 | LOCAL_VENDOR_MODULE := true 22 | include $(BUILD_SHARED_LIBRARY) 23 | 24 | include $(CLEAR_VARS) 25 | LOCAL_SHARED_LIBRARIES := libhidlbase 26 | LOCAL_MODULE := android.hidl.base@1.0_system 27 | LOCAL_INSTALLED_MODULE_STEM := android.hidl.base@1.0.so 28 | LOCAL_MODULE_TAGS := optional 29 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 30 | include $(BUILD_SHARED_LIBRARY) 31 | 32 | include $(CLEAR_VARS) 33 | LOCAL_SHARED_LIBRARIES := libhidlbase 34 | LOCAL_MODULE := android.hidl.manager@1.0 35 | LOCAL_MODULE_TAGS := optional 36 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 37 | LOCAL_VENDOR_MODULE := true 38 | include $(BUILD_SHARED_LIBRARY) 39 | -------------------------------------------------------------------------------- /libshims/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library { 2 | name: "libmemset_shim", 3 | vendor: true, 4 | target: { 5 | android_arm: { 6 | srcs: ["memset32.S"], 7 | sanitize: { 8 | misc_undefined: ["integer"], 9 | }, 10 | }, 11 | android_arm64: { 12 | srcs: ["android_memset.S"], 13 | sanitize: { 14 | misc_undefined: ["integer"], 15 | }, 16 | }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /libshims/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 The CyanogenMod Project 3 | # Copyright (C) 2017 The LineageOS Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | LOCAL_PATH := $(call my-dir) 18 | 19 | include $(CLEAR_VARS) 20 | LOCAL_SRC_FILES := libqsap_shim.c 21 | LOCAL_SHARED_LIBRARIES := libqsap_sdk liblog 22 | LOCAL_C_INCLUDES := $(TOP)/system/qcom/softap/sdk 23 | LOCAL_MODULE := libqsapshim 24 | LOCAL_MODULE_TAGS := optional 25 | LOCAL_VENDOR_MODULE := true 26 | include $(BUILD_SHARED_LIBRARY) 27 | 28 | include $(CLEAR_VARS) 29 | LOCAL_SRC_FILES := justshoot_shim.cpp 30 | LOCAL_SHARED_LIBRARIES := libutils 31 | LOCAL_MODULE := libjustshoot_shim 32 | LOCAL_MODULE_TAGS := optional 33 | LOCAL_PROPRIETARY_MODULE := true 34 | LOCAL_VENDOR_MODULE := true 35 | include $(BUILD_SHARED_LIBRARY) 36 | 37 | include $(CLEAR_VARS) 38 | LOCAL_SHARED_LIBRARIES := libgui_vendor 39 | LOCAL_MODULE := libwui 40 | LOCAL_MODULE_TAGS := optional 41 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 42 | LOCAL_VENDOR_MODULE := true 43 | include $(BUILD_SHARED_LIBRARY) 44 | 45 | include $(CLEAR_VARS) 46 | LOCAL_SRC_FILES := strdup16to8.cpp 47 | LOCAL_SHARED_LIBRARIES := libcutils 48 | LOCAL_MODULE := libcutils_shim 49 | LOCAL_MODULE_TAGS := optional 50 | LOCAL_VENDOR_MODULE := true 51 | include $(BUILD_SHARED_LIBRARY) 52 | -------------------------------------------------------------------------------- /libshims/jstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #if __STDC_VERSION__ < 201112L && __cplusplus < 201103L 27 | typedef uint16_t char16_t; 28 | #endif 29 | // otherwise char16_t is a keyword with the right semantics 30 | 31 | extern char * strndup16to8 (const char16_t* s, size_t n); 32 | extern size_t strnlen16to8 (const char16_t* s, size_t n); 33 | extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /libshims/justshoot_shim.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace android { 4 | extern "C" void _ZN7android9StopWatchC1EPKci(const char* name, int clock); 5 | 6 | extern "C" void _ZN7android10frameworks13sensorservice4V1_08toStringENS2_6ResultE() {} 7 | extern "C" void _ZN7android9StopWatchC1EPKcij(const char* name, int clock, uint32_t flags) { 8 | _ZN7android9StopWatchC1EPKci(name, clock); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /light/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2017 The LineageOS Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | cc_binary { 17 | relative_install_path: "hw", 18 | defaults: ["hidl_defaults"], 19 | name: "android.hardware.light@2.0-service.addison", 20 | proprietary: true, 21 | init_rc: ["android.hardware.light@2.0-service.addison.rc"], 22 | vintf_fragments: ["android.hardware.light@2.0-service.addison.xml"], 23 | srcs: ["service.cpp", "Light.cpp"], 24 | shared_libs: [ 25 | "libhardware", 26 | "libhidlbase", 27 | "liblog", 28 | "libutils", 29 | "android.hardware.light@2.0", 30 | ], 31 | } 32 | -------------------------------------------------------------------------------- /light/Light.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 18 | #define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace android { 27 | namespace hardware { 28 | namespace light { 29 | namespace V2_0 { 30 | namespace implementation { 31 | 32 | using ::android::hardware::Return; 33 | using ::android::hardware::Void; 34 | using ::android::hardware::hidl_vec; 35 | using ::android::hardware::light::V2_0::ILight; 36 | using ::android::hardware::light::V2_0::LightState; 37 | using ::android::hardware::light::V2_0::Status; 38 | using ::android::hardware::light::V2_0::Type; 39 | 40 | class Light : public ILight { 41 | public: 42 | Light(); 43 | 44 | Return setLight(Type type, const LightState& state) override; 45 | Return getSupportedTypes(getSupportedTypes_cb _hidl_cb) override; 46 | 47 | private: 48 | std::mutex globalLock; 49 | }; 50 | 51 | } // namespace implementation 52 | } // namespace V2_0 53 | } // namespace light 54 | } // namespace hardware 55 | } // namespace android 56 | 57 | #endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 58 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.addison.rc: -------------------------------------------------------------------------------- 1 | service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.addison 2 | interface android.hardware.light@2.0::ILight default 3 | class hal 4 | user system 5 | group system 6 | shutdown critical 7 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.addison.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.light 4 | hwbinder 5 | 2.0 6 | 7 | ILight 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /light/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "android.hardware.light@2.0-service.addison" 18 | 19 | #include 20 | 21 | #include "Light.h" 22 | 23 | using android::hardware::configureRpcThreadpool; 24 | using android::hardware::joinRpcThreadpool; 25 | 26 | using android::hardware::light::V2_0::ILight; 27 | using android::hardware::light::V2_0::implementation::Light; 28 | 29 | using android::OK; 30 | using android::sp; 31 | using android::status_t; 32 | 33 | int main() { 34 | sp service = new Light(); 35 | 36 | configureRpcThreadpool(1, true); 37 | 38 | status_t status = service->registerAsService(); 39 | if (status != OK) { 40 | ALOGE("Cannot register Light HAL service."); 41 | return 1; 42 | } 43 | 44 | ALOGI("Light HAL service ready."); 45 | 46 | joinRpcThreadpool(); 47 | 48 | ALOGI("Light HAL service failed to join thread pool."); 49 | return 1; 50 | } 51 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_kernel_motorola_msm8953", 4 | "target_path": "kernel/motorola/msm8953" 5 | }, 6 | { 7 | "repository": "android_external_bson", 8 | "target_path": "external/bson" 9 | }, 10 | { 11 | "repository": "android_hardware_motorola", 12 | "target_path": "hardware/motorola" 13 | }, 14 | { 15 | "repository": "android_system_qcom", 16 | "target_path": "system/qcom" 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /lineage_addison.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 The CyanogenMod Project 3 | # Copyright (C) 2017-2022 The LineageOS Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | 18 | # Inherit from device product 19 | $(call inherit-product, device/motorola/addison/full_addison.mk) 20 | 21 | # Inherit from core products - Most specific first 22 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 23 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 24 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 25 | 26 | # Boot Animation 27 | TARGET_SCREEN_WIDTH := 1080 28 | TARGET_SCREEN_HEIGHT := 1920 29 | TARGET_BOOTANIMATION_HALF_RES := true 30 | 31 | ## Device identifier - This must come after all inclusions 32 | PRODUCT_DEVICE := addison 33 | PRODUCT_BRAND := Motorola 34 | PRODUCT_MANUFACTURER := Motorola 35 | PRODUCT_MODEL := Moto Z Play 36 | PRODUCT_NAME := lineage_addison 37 | 38 | PRODUCT_GMS_CLIENTID_BASE := android-motorola 39 | 40 | BUILD_FINGERPRINT := "motorola/addison_retail/addison:8.0.0/OPNS27.76-12-22-9/10:user/release-keys" 41 | -------------------------------------------------------------------------------- /mot_aids.fs: -------------------------------------------------------------------------------- 1 | 2 | [AID_VENDOR_MOT_ACCY] 3 | value: 5000 4 | 5 | [AID_VENDOR_MOT_PWRIC] 6 | value: 5001 7 | 8 | [AID_VENDOR_MOT_USB] 9 | value: 5002 10 | 11 | [AID_VENDOR_MOT_DRM] 12 | value: 5003 13 | 14 | [AID_VENDOR_MOT_TCMD] 15 | value: 5004 16 | 17 | [AID_VENDOR_MOT_SEC_RTC] 18 | value: 5005 19 | 20 | [AID_VENDOR_MOT_TOMBSTONE] 21 | value: 5006 22 | 23 | [AID_VENDOR_MOT_TPAPI] 24 | value: 5007 25 | 26 | [AID_VENDOR_MOT_SECCLKD] 27 | value: 5008 28 | 29 | [AID_VENDOR_MOT_WHISPER] 30 | value: 5009 31 | 32 | [AID_VENDOR_MOT_CAIF] 33 | value: 5010 34 | 35 | [AID_VENDOR_MOT_DLNA] 36 | value: 5011 37 | 38 | [AID_VENDOR_MOT_ATVC] 39 | value: 5012 40 | 41 | [AID_VENDOR_MOT_DBVC] 42 | value: 5014 43 | 44 | [AID_VENDOR_FINGERP] 45 | value: 5015 46 | 47 | [AID_VENDOR_MOT_ESDFS] 48 | value: 5016 49 | 50 | [AID_VENDOR_POWER] 51 | value: 5017 52 | 53 | [AID_VENDOR_ITSON] 54 | value: 5018 55 | 56 | [AID_VENDOR_MOT_DTV] 57 | value: 5019 58 | 59 | [AID_VENDOR_MOT_MOD] 60 | value: 5020 61 | 62 | [AID_VENDOR_MOT_SHARED] 63 | value: 5323 64 | 65 | [AID_VENDOR_MOT_COMMON] 66 | value: 5341 67 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc204-mnc04/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | false 24 | 25 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc004/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | false 24 | 25 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc311-mnc480/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | false 24 | 25 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | 25 | Moto Z2 Play 26 | 27 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/xml/power_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 89.8 5 | 264.2 6 | 0.169 7 | 49.8 8 | 20 9 | 158.5 10 | 559.7 11 | 16 12 | 232.8 13 | 39.8 14 | 15 | 28.8 16 | 25 17 | 20 18 | 15 19 | 10 20 | 5 21 | 1.8 22 | 23 | 24 | 8 25 | 26 | 27 | 652800 28 | 1036800 29 | 1401600 30 | 1689600 31 | 1804800 32 | 1958400 33 | 2016000 34 | 35 | 36 | 34.551 37 | 49.412 38 | 62.788 39 | 80.948 40 | 102.204 41 | 113.371 42 | 123.085 43 | 44 | 2 45 | 4 46 | 3510 47 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | -------------------------------------------------------------------------------- /overlay/packages/apps/Bluetooth/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | true 31 | true 32 | true 33 | true 34 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 25 | 26 | 0 27 | -1 28 | -1 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 25 | 1 26 | 27 | 28 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 5dp 21 | 81% 22 | 23 | 24 | -------------------------------------------------------------------------------- /overlay/packages/apps/Snap/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 16 | 17 | 18 | 19 | false 20 | 21 | 22 | false 23 | 24 | 25 | false 26 | 27 | 28 | true 29 | 30 | 31 | true 32 | 33 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 21 | 22 | org.codeaurora.ims 23 | 24 | 25 | org.codeaurora.ims 26 | 27 | -------------------------------------------------------------------------------- /pocketmode/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE_TAGS := optional 5 | 6 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 7 | 8 | LOCAL_PACKAGE_NAME := MotoPocketMode 9 | LOCAL_CERTIFICATE := platform 10 | LOCAL_PRIVATE_PLATFORM_APIS := true 11 | LOCAL_VENDOR_MODULE := true 12 | LOCAL_REQUIRED_MODULES := pocketmode_whitelist.xml 13 | 14 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags 15 | 16 | include $(BUILD_PACKAGE) 17 | 18 | include $(CLEAR_VARS) 19 | LOCAL_MODULE := pocketmode_whitelist.xml 20 | LOCAL_MODULE_CLASS := ETC 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE_RELATIVE_PATH := sysconfig 23 | LOCAL_VENDOR_MODULE := true 24 | LOCAL_SRC_FILES := $(LOCAL_MODULE) 25 | include $(BUILD_PREBUILT) 26 | -------------------------------------------------------------------------------- /pocketmode/pocketmode_whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /pocketmode/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.pocketmode.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The CyanogenMod Project 3 | * 2017-2019 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.pocketmode; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.os.UserHandle; 24 | import android.util.Log; 25 | 26 | public class BootCompletedReceiver extends BroadcastReceiver { 27 | 28 | private static final String TAG = "MotoPocketMode"; 29 | 30 | @Override 31 | public void onReceive(Context context, Intent intent) { 32 | Log.d(TAG, "Starting"); 33 | context.startServiceAsUser(new Intent(context, PocketModeService.class), 34 | UserHandle.CURRENT); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /power/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_C_INCLUDES := vendor/qcom/opensource/power 6 | LOCAL_CFLAGS += -Wall -Wextra -Wno-error -Wno-implicit-function-declaration 7 | LOCAL_SHARED_LIBRARIES := liblog 8 | LOCAL_HEADER_LIBRARIES += libhardware_headers 9 | 10 | ifeq ($(TARGET_USES_INTERACTION_BOOST),true) 11 | LOCAL_CFLAGS += -DINTERACTION_BOOST 12 | endif 13 | 14 | LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable 15 | LOCAL_SRC_FILES := power-8953.c 16 | LOCAL_MODULE := libpower_8953 17 | LOCAL_VENDOR_MODULE := true 18 | include $(BUILD_STATIC_LIBRARY) -------------------------------------------------------------------------------- /rootdir/bin/init.gbmods.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | 3 | debug=$(getprop ro.boot.gbdebug 2> /dev/null) 4 | bootmode=$(getprop ro.bootmode 2> /dev/null) 5 | 6 | # If androidboot.gbdebug is set on command line, skip inserting 7 | # the pre-installed modules. 8 | if [ "$debug" == "1" ]; then 9 | return 0 10 | fi 11 | 12 | insmod /vendor/lib/modules/greybus.ko 13 | 14 | # Only support PTP and BATTERY in charge-only mode 15 | if [ "$bootmode" == "charger" ]; then 16 | insmod /vendor/lib/modules/gb-mods.ko 17 | insmod /vendor/lib/modules/gb-battery.ko 18 | insmod /vendor/lib/modules/gb-ptp.ko 19 | 20 | return 0 21 | fi 22 | 23 | gbmods="/vendor/lib/modules/gb-*" 24 | for mod in $gbmods 25 | do 26 | insmod $mod 27 | done 28 | 29 | insmod /vendor/lib/modules/v4l2-hal.ko 30 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.sensors.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # Copyright (c) 2015, The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | # 30 | # Function to start sensors for SSC enabled platforms 31 | # 32 | start_sensors() 33 | { 34 | if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then 35 | chmod -h 775 /persist/sensors 36 | chmod -h 664 /persist/sensors/sensors_settings 37 | mkdir -p /persist/sensors/registry/registry 38 | chown -h system.root /persist/sensors/sensors_settings 39 | start sensors 40 | fi 41 | } 42 | 43 | start_sensors 44 | -------------------------------------------------------------------------------- /rootdir/bin/wlan_carrier_bin.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | carrier=`getprop ro.boot.carrier` 3 | 4 | case "$carrier" in 5 | "retbr" | "timbr" | "tefbr" | "oibr" | "amxbr" | "niibr") 6 | echo -n wlan/prima/WCNSS_qcom_wlan_nv_Brazil.bin > /sys/module/wcnsscore/parameters/nv_file 7 | ;; 8 | "perar" | "retar" | "tefar" | "amxar") 9 | echo -n wlan/prima/WCNSS_qcom_wlan_nv_Argentina.bin > /sys/module/wcnsscore/parameters/nv_file 10 | ;; 11 | "retin" | "amzin") 12 | echo -n wlan/prima/WCNSS_qcom_wlan_nv_India.bin > /sys/module/wcnsscore/parameters/nv_file 13 | ;; 14 | * ) 15 | echo -n wlan/prima/WCNSS_qcom_wlan_nv.bin > /sys/module/wcnsscore/parameters/nv_file 16 | ;; 17 | esac 18 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | on fs 2 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 3 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 4 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "TetheringConfigOverlay", 3 | theme: "TetheringConfigOverlay", 4 | certificate: "platform", 5 | sdk_version: "current", 6 | vendor: true 7 | } 8 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 25 | 26 | "rndis\\d" 27 | 28 | 32 | false 33 | 34 | 35 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /seccomp_policy/mediacodec.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | inotify_init1: 1 12 | inotify_add_watch: 1 13 | -------------------------------------------------------------------------------- /seccomp_policy/mediaextractor.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls. 2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy 3 | readlinkat: 1 4 | pread64: 1 5 | -------------------------------------------------------------------------------- /sepolicy-mods/private/mods_app.te: -------------------------------------------------------------------------------- 1 | # ModService 2 | typeattribute mods_app coredomain; 3 | 4 | app_domain(mods_app) 5 | net_domain(mods_app) 6 | 7 | allow mods_app { 8 | app_api_service 9 | system_api_service 10 | }:service_manager find; 11 | 12 | -------------------------------------------------------------------------------- /sepolicy-mods/private/seapp_contexts: -------------------------------------------------------------------------------- 1 | # ModService 2 | user=_app isPrivApp=true seinfo=platform name=com.motorola.modservice domain=mods_app type=app_data_file levelFrom=user 3 | -------------------------------------------------------------------------------- /sepolicy-mods/private/service_contexts: -------------------------------------------------------------------------------- 1 | ModService u:object_r:mods_service:s0 2 | -------------------------------------------------------------------------------- /sepolicy-mods/public/mods_app.te: -------------------------------------------------------------------------------- 1 | type mods_app, domain, mlstrustedsubject; 2 | -------------------------------------------------------------------------------- /sepolicy-mods/public/service.te: -------------------------------------------------------------------------------- 1 | type mods_service, service_manager_type; 2 | type mot_app_service, service_manager_type; 3 | type mot_panel_service, service_manager_type; 4 | type mot_system_service, service_manager_type; 5 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/cameraserver.te: -------------------------------------------------------------------------------- 1 | allow cameraserver mods_service:service_manager find; 2 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/device.te: -------------------------------------------------------------------------------- 1 | type greybus_raw_device, dev_type, mlstrustedobject; 2 | type mods_camd_device, dev_type, mlstrustedobject; 3 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Greybus 2 | type sysfs_greybus, fs_type, sysfs_type, mlstrustedobject; 3 | type gbfirmware_file, file_type, core_data_file_type, data_file_type, mlstrustedobject; 4 | type sysfs_mods_camd, fs_type, sysfs_type, mlstrustedobject; 5 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | genfscon sysfs /devices/platform/mods_ap u:object_r:sysfs_greybus:s0 2 | genfscon sysfs /devices/soc/0.apba_ctrl u:object_r:sysfs_greybus:s0 3 | genfscon sysfs /devices/soc/0.muc u:object_r:sysfs_greybus:s0 4 | genfscon sysfs /devices/soc/soc:muc_svc@0 u:object_r:sysfs_greybus:s0 5 | genfscon sysfs /devices/soc/soc:muc u:object_r:sysfs_greybus:s0 6 | genfscon sysfs /devices/platform/mods_codec.0 u:object_r:sysfs_greybus:s0 7 | genfscon sysfs /devices/virtual/hwmon/hwmon41/subsystem u:object_r:sysfs_greybus:s0 8 | genfscon sysfs /class/vendor/mod0 u:object_r:sysfs_greybus:s0 9 | genfscon sysfs /class/power_supply/gb_ptp u:object_r:sysfs_greybus:s0 10 | genfscon sysfs /module/qpnp_smbcharger_mmi u:object_r:sysfs_greybus:s0 11 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | allow hal_audio_default sysfs_greybus:dir { search }; 2 | allow hal_audio_default sysfs_greybus:file { getattr open read }; 3 | 4 | # MotSpeakerHelperProximity 5 | allow hal_audio_default fwk_sensor_hwservice:hwservice_manager find; 6 | binder_call(hal_audio_default, system_server) 7 | 8 | # Speaker calibration 9 | r_dir_file(hal_audio_default, mnt_vendor_file) 10 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default sysfs_mods_camd:dir r_dir_perms; 2 | allow hal_camera_default sysfs_mods_camd:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hal_graphics_composer_default.te: -------------------------------------------------------------------------------- 1 | allow hal_graphics_composer_default sysfs_mods_camd:dir r_dir_perms; 2 | allow hal_graphics_composer_default sysfs_mods_camd:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hal_health_default.te: -------------------------------------------------------------------------------- 1 | allow hal_health_default sysfs_greybus:dir r_dir_perms; 2 | allow hal_health_default sysfs_greybus:file rw_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/healthd.te: -------------------------------------------------------------------------------- 1 | allow healthd sysfs_greybus:dir r_dir_perms; 2 | allow healthd sysfs_greybus:file rw_file_perms; 3 | allow healthd sysfs_mods_camd:dir r_dir_perms; 4 | allow healthd sysfs_mods_camd:file rw_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type hal_modmanager_hwservice, hwservice_manager_type; 2 | type hal_motvibrator_hwservice, hwservice_manager_type; 3 | 4 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | com.motorola.mod::IModManager u:object_r:hal_modmanager_hwservice:s0 2 | motorola.hardware.vibrator::IMotVibrator u:object_r:hal_motvibrator_hwservice:s0 3 | 4 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/init_mods.te: -------------------------------------------------------------------------------- 1 | type init_mods, domain; 2 | type init_mods_exec, exec_type, vendor_file_type, file_type; 3 | 4 | init_daemon_domain(init_mods) 5 | 6 | allow init_mods sysfs_greybus:dir r_dir_perms; 7 | allow init_mods sysfs_greybus:{ file lnk_file } rw_file_perms; 8 | allow init_mods vendor_file:file execute_no_trans; 9 | allow init_mods vendor_shell_exec:file r_file_perms; 10 | allow init_mods vendor_toolbox_exec:file rx_file_perms; 11 | 12 | # execute grep 13 | allow init_mods vendor_file:file execute_no_trans; 14 | 15 | # Allow insmod 16 | allow init_mods kernel:key search; 17 | allow init_mods self:capability sys_module; 18 | allow init_mods vendor_file:dir r_dir_perms; 19 | allow init_mods vendor_file:system module_load; 20 | 21 | set_prop(init_mods, ctl_default_prop) 22 | 23 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/mods_app.te: -------------------------------------------------------------------------------- 1 | allow mods_app ion_device:chr_file { open read }; 2 | allow mods_app self:netlink_kobject_uevent_socket { bind create read setopt }; 3 | 4 | allow mods_app gbfirmware_file:dir create_dir_perms; 5 | allow mods_app gbfirmware_file:file create_file_perms; 6 | allow mods_app greybus_raw_device:chr_file open; 7 | 8 | allow mods_app audioserver_service:service_manager find; 9 | allow mods_app cameraserver_service:service_manager find; 10 | allow mods_app mods_service:service_manager find; 11 | allow mods_app mods_service:service_manager add; 12 | allow mods_app radio_service:service_manager find; 13 | 14 | allow mods_app sysfs_battery_supply:dir r_dir_perms; 15 | allow mods_app sysfs_battery_supply:{ file lnk_file } r_file_perms; 16 | allow mods_app sysfs_graphics:dir search; 17 | allow mods_app sysfs_graphics:file rw_file_perms; 18 | allow mods_app sysfs_greybus:dir r_dir_perms; 19 | allow mods_app sysfs_greybus:{ file lnk_file } rw_file_perms; 20 | allow mods_app sysfs_mods_camd:dir r_dir_perms; 21 | allow mods_app sysfs_mods_camd:file rw_file_perms; 22 | allow mods_app sysfs_thermal:dir r_dir_perms; 23 | allow mods_app sysfs_thermal:{ file lnk_file } r_file_perms; 24 | allow mods_app sysfs_usb_supply:dir r_dir_perms; 25 | allow mods_app sysfs_usb_supply:{ file lnk_file} r_file_perms; 26 | 27 | allow mods_app mods_camd_device:chr_file rw_file_perms; 28 | 29 | get_prop(mods_app, moto_boot_prop) 30 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/mods_camd.te: -------------------------------------------------------------------------------- 1 | type mods_camd, domain; 2 | type mods_camd_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(mods_camd) 4 | 5 | allow mods_camd ion_device:chr_file rw_file_perms; 6 | allow mods_camd video_device:chr_file rw_file_perms; 7 | 8 | allow mods_camd self:netlink_kobject_uevent_socket { bind create read setopt }; 9 | allow mods_camd sysfs_mods_camd:file rw_file_perms; 10 | allow mods_camd sysfs_mods_camd:dir r_dir_perms; 11 | allow mods_camd sysfs:file { getattr open read write }; 12 | 13 | allow mods_camd mods_camd_device:chr_file rw_file_perms; 14 | 15 | allow mods_camd sysfs_greybus:file rw_file_perms; 16 | allow mods_camd sysfs_greybus:dir r_dir_perms; 17 | 18 | allow mods_camd cameraserver:fd use; 19 | allow mods_camd gpu_device:chr_file { ioctl open read write }; 20 | allow mods_camd init:unix_stream_socket connectto; 21 | allow mods_camd property_socket:sock_file write; 22 | allow mods_camd surfaceflinger:fd use; 23 | allow mods_camd camera_prop:property_service set; 24 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | allow platform_app mods_service:service_manager find; 2 | allow platform_app mods_service:service_manager add; 3 | 4 | allow platform_app mods_app:unix_stream_socket connectto; 5 | 6 | allow platform_app sysfs_vibrator:file rw_file_perms; 7 | allow platform_app sysfs_usb_supply:dir search; 8 | allow platform_app sysfs_vibrator:dir { search r_dir_perms }; 9 | allow platform_app greybus_raw_device:chr_file rw_file_perms; 10 | allow platform_app greybus_raw_device:dir rw_dir_perms; 11 | allow platform_app input_device:chr_file getattr; 12 | allow platform_app input_device:dir search; 13 | allow platform_app self:netlink_kobject_uevent_socket { bind create read setopt }; 14 | allow platform_app sysfs_greybus:dir r_dir_perms; 15 | allow platform_app sysfs_greybus:file rw_file_perms; 16 | allow platform_app sysfs_greybus:lnk_file r_file_perms; 17 | allow platform_app sysfs_mods_camd:file rw_file_perms; 18 | allow platform_app sysfs_mods_camd:dir r_dir_perms; 19 | allow platform_app gbfirmware_file:dir create_dir_perms; 20 | allow platform_app gbfirmware_file:file create_file_perms; 21 | 22 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | add_hwservice(system_app, hal_modmanager_hwservice) 2 | add_hwservice(system_app, hal_motvibrator_hwservice) 3 | allow system_app mods_service:service_manager find; 4 | allow system_app mods_service:service_manager add; 5 | 6 | allow system_app mods_app:unix_stream_socket connectto; 7 | -------------------------------------------------------------------------------- /sepolicy-mods/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # MotSpeakerHelperProximity 2 | binder_call(system_server, hal_audio_default) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/akmd.te: -------------------------------------------------------------------------------- 1 | type akmd, domain; 2 | type akmd_exec, exec_type, file_type, vendor_file_type; 3 | init_daemon_domain(akmd) 4 | 5 | allow akmd compass_device:chr_file rw_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | get_prop(appdomain, exported_camera_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/atfwd.te: -------------------------------------------------------------------------------- 1 | allow atfwd sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/audioserver.te: -------------------------------------------------------------------------------- 1 | allow audioserver sysfs:dir { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/bootanim.te: -------------------------------------------------------------------------------- 1 | allow bootanim sysfs_kgsl:dir search; 2 | get_prop(bootanim, userspace_reboot_exported_prop) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/capsense_reset.te: -------------------------------------------------------------------------------- 1 | type capsense_reset, domain; 2 | type capsense_reset_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(capsense_reset) 4 | 5 | allow capsense_reset capsense_reset_exec:file execute; 6 | 7 | allow capsense_reset sysfs_capsense:dir r_dir_perms; 8 | allow capsense_reset sysfs_capsense:file rw_file_perms; 9 | 10 | allow capsense_reset self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/charge_only.te: -------------------------------------------------------------------------------- 1 | type charge_only, domain; 2 | type charge_only_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(charge_only) 4 | 5 | # Write to /dev/kmsg 6 | allow charge_only kmsg_device:chr_file rw_file_perms; 7 | 8 | # Read access to pseudo filesystems. 9 | r_dir_file(charge_only, sysfs_type) 10 | r_dir_file(charge_only, rootfs) 11 | r_dir_file(charge_only, cgroup) 12 | 13 | allow charge_only self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 14 | 15 | wakelock_use(charge_only) 16 | 17 | # Write to /sys/power/state 18 | # TODO: Split into a separate type? 19 | allow charge_only sysfs:dir { read open }; 20 | allow charge_only sysfs:file { read open write }; 21 | 22 | allow charge_only sysfs_wake_lock:file rw_file_perms; 23 | 24 | allow charge_only sysfs_batteryinfo:file r_file_perms; 25 | 26 | # Read /sys/fs/pstore/console-ramoops 27 | # Don't worry about overly broad permissions for now, as there's 28 | # only one file in /sys/fs/pstore 29 | allow charge_only pstorefs:dir r_dir_perms; 30 | allow charge_only pstorefs:file r_file_perms; 31 | 32 | allow charge_only graphics_device:dir r_dir_perms; 33 | allow charge_only graphics_device:chr_file rw_file_perms; 34 | allow charge_only input_device:dir r_dir_perms; 35 | allow charge_only input_device:chr_file r_file_perms; 36 | allow charge_only tty_device:chr_file rw_file_perms; 37 | allow charge_only proc_sysrq:file rw_file_perms; 38 | 39 | # charger needs to tell init to continue the boot 40 | # process when running in charger mode. 41 | set_prop(charge_only, system_prop) 42 | -------------------------------------------------------------------------------- /sepolicy/vendor/cnd.te: -------------------------------------------------------------------------------- 1 | allow cnd diag_device:chr_file { read write }; 2 | 3 | allow cnd sysfs:file { read open }; 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type adspd_device, dev_type; 2 | type amps_raw_device, dev_type; 3 | type compass_device, dev_type; 4 | type haptics_device, dev_type; 5 | type hob_device, dev_type; 6 | type hw_block_device, dev_type; 7 | type graphics_fb_device, dev_type; 8 | type laser_device, dev_type; 9 | type synaptics_rmi_device, dev_type; 10 | type shwi_device, dev_type; 11 | type isdbt_device, dev_type; 12 | type utags_block_device, dev_type; 13 | type vl53l1_device, dev_type; 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/energyawareness.te: -------------------------------------------------------------------------------- 1 | allow energyawareness sysfs_uio:file r_file_perms; 2 | allow energyawareness sysfs_rmt_storage:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/firmware_file.te: -------------------------------------------------------------------------------- 1 | allow firmware_file rootfs:filesystem associate; 2 | 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/fsck.te: -------------------------------------------------------------------------------- 1 | allow fsck modem_efs_partition_device:blk_file rw_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # sysfs 2 | genfscon sysfs /devices/soc/6a00000.ssusb/power_supply u:object_r:sysfs_battery_supply:s0 3 | genfscon sysfs /devices/soc/7600000.hsusb/power_supply u:object_r:sysfs_battery_supply:s0 4 | genfscon sysfs /devices/soc/75b5000.i2c/i2c-7/7-0022/power_supply u:object_r:sysfs_battery_supply:s0 5 | genfscon sysfs /devices/soc/msm-bcl-15/power_supply u:object_r:sysfs_battery_supply:s0 6 | genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_battery_supply:s0 7 | genfscon sysfs /devices/soc/qpnp-fg-18 u:object_r:sysfs_battery_supply:s0 8 | genfscon sysfs /devices/soc/qpnp-smbcharger-17/power_supply u:object_r:sysfs_battery_supply:s0 9 | genfscon sysfs /devices/soc/qpnp-smbcharger-17/power_supply/battery/system_temp_level u:object_r:sysfs_battery_supply:s0 10 | 11 | genfscon sysfs /devices/soc/soc:qcom,cpubw u:object_r:sysfs_msm_subsys:s0 12 | genfscon sysfs /module/stmvl53l1 u:object_r:sysfs_sensor:s0 13 | 14 | # Real-time clock 15 | genfscon sysfs /devices/soc/qpnp-rtc-8/rtc u:object_r:sysfs_rtc:s0 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | binder_call(hal_audio_default, system_server) 2 | 3 | allow hal_audio_default vendor_data_file:dir {add_name rw_file_perms }; 4 | allow hal_audio_default vendor_data_file:file create_file_perms; 5 | allow hal_audio_default fwk_sensor_hwservice:hwservice_manager { find }; 6 | allow hal_audio_default mnt_vendor_file:file { read }; 7 | allow hal_audio_default mnt_vendor_file:dir search; 8 | allow hal_audio_default persist_audio_file:dir rw_dir_perms; 9 | allow hal_audio_default persist_audio_file:file create_file_perms; 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default vl53l1_device:chr_file rw_file_perms; 2 | allow hal_camera_default gpu_device:dir r_dir_perms; 3 | allow hal_camera_default gpu_device:file r_file_perms; 4 | allow hal_camera_default hal_configstore_default:binder call; 5 | allow hal_camera_default unlabeled:file {open getattr read }; 6 | allow hal_camera_default camera_data_file:sock_file write; 7 | allow hal_camera_default persist_file:file { rw_file_perms setattr }; 8 | allow hal_camera_default system_server:unix_stream_socket { read write }; 9 | allow hal_camera_default sysfs:file { getattr open read }; 10 | 11 | binder_call(hal_camera_default, hal_configstore_default) 12 | binder_call(hal_camera_default, hal_graphics_allocator_default) 13 | 14 | get_prop(hal_camera_default, moto_boot_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cas_default.te: -------------------------------------------------------------------------------- 1 | vndbinder_use(hal_cas_default) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 2 | 3 | allow hal_fingerprint_default tee_device:chr_file { open read write ioctl }; 4 | 5 | allow hal_fingerprint_default fingerprint_data_file:dir rw_dir_perms; 6 | allow hal_fingerprint_default fingerprint_data_file:file create_file_perms; 7 | 8 | allow hal_fingerprint_default sysfs_fingerprint:dir r_dir_perms; 9 | allow hal_fingerprint_default sysfs_fingerprint:file rw_file_perms; 10 | 11 | allow hal_fingerprint_default sysfs_greybus:dir { search }; 12 | allow hal_fingerprint_default sysfs_greybus:file r_file_perms; 13 | 14 | allow hal_fingerprint_default fingerprintd_data_file:dir rw_dir_perms; 15 | allow hal_fingerprint_default fingerprintd_data_file:file create_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_gnss_qti.te: -------------------------------------------------------------------------------- 1 | get_prop(hal_gnss_qti, diag_prop); 2 | allow hal_gnss_qti debug_prop:file read; 3 | allow hal_gnss_qti property_socket:sock_file write; 4 | 5 | # Most HALs are not allowed to use network sockets. Qcom library 6 | # libqdi is used across multiple processes which are clients of 7 | # netmgrd including the GNSS HAL. libqdi first attempts to get the network 8 | # interface using an IOCTL on a UDP INET socket, which isn't allowed here. 9 | # If that fails, it falls back to using libc's if_nameindex() which requires 10 | # a netlink route socket, which HALs may use. Due to the initial 11 | # attempt to use a UDP socket, we still see a selinux denial, 12 | # but it is safe to ignore. 13 | # TODO (b/37730994) Remove udp_socket requirement from 14 | # libqdi and have all its clients use netlink route 15 | # sockets. 16 | # Taken from device/google/wahoo 17 | dontaudit hal_gnss_qti self:udp_socket create; 18 | 19 | allow hal_gnss_qti sysfs:file {open read }; 20 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_graphics_composer_default.te: -------------------------------------------------------------------------------- 1 | allow hal_graphics_composer_default persist_file:dir { getattr search }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_health_default.te: -------------------------------------------------------------------------------- 1 | allow hal_health_default persist_file:file rw_file_perms; 2 | 3 | allow hal_health_default mnt_vendor_file:dir search; 4 | allow hal_health_default persist_battery_file:dir search; 5 | allow hal_health_default persist_battery_file:file rw_file_perms; 6 | allow hal_health_default sysfs:file rw_file_perms; 7 | allow hal_health_default self:binder call; 8 | allow hal_health_default sysfs_greybus:dir search; 9 | allow hal_health_default sysfs_greybus:file rw_file_perms; 10 | allow hal_health_default mnt_vendor_file:file { getattr open read }; 11 | allow hal_health_default mnt_vendor_file:dir { search write }; 12 | allow hal_health_default sysfs_mods_camd:file r_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | allow hal_light_default sysfs_leds:file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_touch.te: -------------------------------------------------------------------------------- 1 | # Allow binder communication with hal_fingerprint 2 | binder_call(hal_lineage_touch_default, hal_fingerprint) 3 | 4 | # Allow hal_lineage_touch_default to find fpc_extension_service 5 | allow hal_lineage_touch_default fpc_extension_service:hwservice_manager find; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_touch_default.te: -------------------------------------------------------------------------------- 1 | # Allow binder communication with hal_fingerprint 2 | binder_call(hal_lineage_touch_default, hal_fingerprint) 3 | 4 | # Allow hal_lineage_touch_default to find fpc_extension_service 5 | allow hal_lineage_touch_default fpc_extension_service:hwservice_manager find; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_nfc_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_nfc_default binder_in_vendor_violators; 2 | 3 | allow hal_nfc_default nxpese_hwservice:hwservice_manager { add find }; 4 | allow hal_nfc_default nxpnfc_hwservice:hwservice_manager { add find }; 5 | 6 | allow hal_nfc_default nfc_vendor_data_file:dir { search write add_name create }; 7 | allow hal_nfc_default nfc_vendor_data_file:file create_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow hal_perf_default sysfs_msm_subsys:dir search; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_default sysfs:file rw_file_perms; 2 | allow hal_power_default sysfs_msm_subsys:dir r_dir_perms; 3 | 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_stats_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_stats_default sysfs_sensors:dir {open read}; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | allow hal_sensors_default sysfs:file rw_file_perms; 2 | allow hal_sensors_default sysfs:dir r_dir_perms; 3 | 4 | allow hal_sensors_default sensorhub_data_file:dir create_dir_perms; 5 | allow hal_sensors_default sensorhub_data_file:file create_file_perms; 6 | allow hal_sensors_default sensors_device:chr_file rw_file_perms; 7 | 8 | allow hal_sensors_default sysfs_mmi_laser:file rw_file_perms; 9 | allow hal_sensors_default sysfs_mmi_laser:dir { search }; 10 | 11 | allow hal_sensors_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 12 | allow hal_sensors_default sysfs_sensors:file rw_file_perms; 13 | allow hal_sensors_default debugfs_iio:dir r_dir_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default kernel:system module_request; 2 | allow hal_wifi_default firmware_file:dir r_dir_perms; 3 | allow hal_wifi_default firmware_file:file r_file_perms; 4 | allow hal_wifi_default proc_net:file w_file_perms; -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type nxpnfc_hwservice, hwservice_manager_type; 2 | type nxpese_hwservice, hwservice_manager_type; 3 | type fpc_extension_service, hwservice_manager_type; 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | motorola.hardware.camera.provider::ICameraProvider u:object_r:hal_camera_hwservice:s0 2 | motorola.hardware.mods_camera.provider::ICameraProvider u:object_r:hal_camera_hwservice:s0 3 | motorola.hardware.health::IMotHealth u:object_r:hal_health_hwservice:s0 4 | vendor.nxp.nxpnfc::INxpNfc u:object_r:nxpnfc_hwservice:s0 5 | vendor.nxp.nxpese::INxpEse u:object_r:nxpese_hwservice:s0 6 | com.fingerprints.extension::IFingerprintAuthenticator u:object_r:fpc_extension_service:s0 7 | com.fingerprints.extension::IFingerprintCalibration u:object_r:fpc_extension_service:s0 8 | com.fingerprints.extension::IFingerprintEngineering u:object_r:fpc_extension_service:s0 9 | com.fingerprints.extension::IFingerprintNavigation u:object_r:fpc_extension_service:s0 10 | com.fingerprints.extension::IFingerprintSensorTest u:object_r:fpc_extension_service:s0 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservicemanager.te: -------------------------------------------------------------------------------- 1 | #allow hwservicemanager init:binder call; 2 | allow hwservicemanager init:dir search; 3 | allow hwservicemanager init:file { open read }; 4 | allow hwservicemanager init:process getattr; 5 | 6 | binder_use(hwservicemanager); 7 | 8 | binder_call(hwservicemanager, hal_power_default); 9 | binder_call(hwservicemanager, hal_usb_default); 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/ims.te: -------------------------------------------------------------------------------- 1 | allow ims debug_prop:property_service set; 2 | get_prop(ims, debug_prop); 3 | allow ims self:capability net_raw; 4 | allow ims diag_device:chr_file { read write }; 5 | allow ims sysfs:file {open read }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | # binder_call(init, mm-qcamerad); 2 | #binder_call(init, hwservicemanager); 3 | # binder_call(init, servicemanager); 4 | 5 | allow init hwservicemanager:binder call; 6 | allow init mm-qcamerad:binder transfer; 7 | allow init platform_app:binder transfer; 8 | 9 | allow init system_app:binder transfer; 10 | allow init system_data_file:file lock; 11 | 12 | allow init audio_device:chr_file { write ioctl }; 13 | allow init input_device:chr_file rw_file_perms; 14 | allow init sensors_device:chr_file { write ioctl }; 15 | 16 | allow init servicemanager:binder { transfer call }; 17 | allow init system_server:binder { transfer call }; 18 | 19 | allow init property_socket:sock_file write; 20 | allow init socket_device:sock_file { create setattr unlink }; 21 | 22 | allow init system_data_file:file { rename append }; 23 | allow init firmware_file:dir mounton; 24 | 25 | allow init system_file:system module_load; 26 | 27 | # ptt_socket_app 28 | allow init dnsproxyd_socket:sock_file write; 29 | allow init netd:unix_stream_socket connectto; 30 | allow init self:netlink_socket { read write getattr connect }; 31 | 32 | allow init debugfs:file write; 33 | allow init persist_file:filesystem { getattr mount relabelfrom relabelto unmount }; 34 | 35 | # Screen off gestures 36 | allow init sysfs_screen_off_gestures:file { rw_file_perms setattr }; 37 | 38 | allow init self:capability sys_nice; 39 | 40 | allow init firmware_file:filesystem getattr; 41 | 42 | allow init sensors_device:chr_file { rw_file_perms create }; 43 | allow init pmsg_device:chr_file { open }; 44 | 45 | allow init self:netlink_route_socket { bind create getopt nlmsg_read read setopt write }; 46 | 47 | allow init self:capability2 { block_suspend }; 48 | 49 | 50 | allow init hal_perf_hwservice:hwservice_manager find; 51 | allow init hidl_base_hwservice:hwservice_manager add; 52 | 53 | allow init debugfs:dir mounton; 54 | allow init persist_file:dir mounton; 55 | allow init sysfs:file { setattr }; 56 | allow init sysfs_battery_supply:lnk_file {open read }; 57 | allow init sysfs_fpc:file { rw_file_perms setattr }; 58 | allow init sysfs_capsense:file setattr; 59 | 60 | allow init vendor_file:file { execute }; 61 | -------------------------------------------------------------------------------- /sepolicy/vendor/init_wifi.te: -------------------------------------------------------------------------------- 1 | type init_wifi, domain; 2 | type init_wifi_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(init_wifi) 4 | 5 | binder_call(init_wifi, system_server) 6 | 7 | # shell scripts need to execute /system/bin/sh 8 | allow init_wifi vendor_shell_exec:file rx_file_perms; 9 | allow init_wifi vendor_toolbox_exec:file rx_file_perms; 10 | allow init_wifi vendor_shell_exec:file entrypoint; 11 | 12 | allow init_wifi sysfs_wcnsscore:file rw_file_perms; 13 | allow init_wifi sysfs_wcnsscore:dir r_dir_perms; 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/installd.te: -------------------------------------------------------------------------------- 1 | allow installd firmware_file:filesystem quotaget; 2 | allow installd fsg_file:filesystem quotaget; 3 | allow installd persist_file:filesystem quotaget; 4 | allow installd idmap:process noatsecure; -------------------------------------------------------------------------------- /sepolicy/vendor/isdbt_app.te: -------------------------------------------------------------------------------- 1 | type isdbt_app, domain, mlstrustedsubject; 2 | 3 | app_domain(isdbt_app) 4 | binder_use(isdbt_app) 5 | 6 | allow isdbt_app isdbt_device:chr_file rw_file_perms; 7 | allow isdbt_app media_rw_data_file:dir { rw_dir_perms create getattr rmdir search }; 8 | allow isdbt_app { accessibility_service activity_service appops_service connectivity_service content_service display_service graphicsstats_service input_method_service input_service location_service mount_service network_management_service radio_service registry_service surfaceflinger_service textservices_service uimode_service vibrator_service wifi_service audio_service audioserver_service media_router_service notification_service autofill_service mediametrics_service mediaserver_service media_session_service mediametrics_service batterystats_service power_service user_service }:service_manager find; 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel hw_block_device:blk_file rw_file_perms; 2 | allow kernel vfat:file open; 3 | allow kernel self:socket create; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/location.te: -------------------------------------------------------------------------------- 1 | allow location sysfs:file r_file_perms; 2 | allow location kernel:system module_request; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediacodec.te: -------------------------------------------------------------------------------- 1 | allow mediacodec firmware_file:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediadrmserver.te: -------------------------------------------------------------------------------- 1 | allow mediadrmserver firmware_file:dir search; -------------------------------------------------------------------------------- /sepolicy/vendor/mediaextractor.te: -------------------------------------------------------------------------------- 1 | allow mediaextractor fuse:file r_file_perms; 2 | allow mediaextractor system_server:fifo_file { write append }; 3 | allow mediaextractor sdcardfs:file r_file_perms; 4 | allow mediaextractor vfat:file r_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | typeattribute mm-qcamerad data_between_core_and_vendor_violators; 2 | allow mm-qcamerad camera_prop:property_service set; 3 | allow mm-qcamerad init:unix_stream_socket connectto; 4 | allow mm-qcamerad persist_file:dir { getattr open read search }; 5 | allow mm-qcamerad persist_file:file { read open getattr }; 6 | allow mm-qcamerad property_socket:sock_file write; 7 | allow mm-qcamerad mnt_vendor_file:file rw_file_perms; 8 | allow mm-qcamerad laser_device:chr_file { ioctl open read write }; 9 | 10 | # TODO(b/36599434): Remove this once mm-qcamerad stops using Binder services 11 | typeattribute mm-qcamerad binder_in_vendor_violators; 12 | allow mm-qcamerad binder_device:chr_file { read write }; 13 | 14 | allow mm-qcamerad fwk_sensor_hwservice:hwservice_manager find; 15 | allow mm-qcamerad camera_data_file:dir search; 16 | 17 | allow mm-qcamerad vendor_data_file:dir r_dir_perms; 18 | allow mm-qcamerad vendor_data_file:file rw_file_perms; 19 | 20 | allow mm-qcamerad sysfs_mods_camd:file rw_file_perms; 21 | allow mm-qcamerad sysfs_mods_camd:dir r_dir_perms; 22 | 23 | vndbinder_use(mm-qcamerad); 24 | get_prop(mm-qcamerad, moto_boot_prop); -------------------------------------------------------------------------------- /sepolicy/vendor/msm_irqbalanced.te: -------------------------------------------------------------------------------- 1 | allow vendor_msm_irqbalanced self:capability { setgid setuid }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/netd.te: -------------------------------------------------------------------------------- 1 | allow netd untrusted_app_25:unix_stream_socket { read write }; 2 | 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/netmgrd.te: -------------------------------------------------------------------------------- 1 | allow netmgrd netutils_wrapper:process noatsecure; 2 | 3 | allow netmgrd sysfs:file r_file_perms; 4 | allow netmgrd property_socket:sock_file write; 5 | allow netmgrd init:unix_stream_socket connectto; 6 | set_prop(netmgrd, vendor_xlat_prop) 7 | 8 | allow netmgrd kernel:system module_request; 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/netutils_wrapper.te: -------------------------------------------------------------------------------- 1 | allow netutils_wrapper netmgrd:socket { read write }; 2 | 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/nfc.te: -------------------------------------------------------------------------------- 1 | allow nfc nfc_vendor_data_file:dir {write add_name search}; 2 | allow nfc nfc_vendor_data_file:file {write create open read }; 3 | get_prop(nfc, moto_boot_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/per_mgr.te: -------------------------------------------------------------------------------- 1 | allow vendor_per_mgr self:capability net_raw; 2 | allow vendor_per_mgr firmware_file:file { open read }; -------------------------------------------------------------------------------- /sepolicy/vendor/perfd.te: -------------------------------------------------------------------------------- 1 | type perfd, domain; 2 | type perfd_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(perfd) 4 | 5 | allow perfd cgroup:file r_file_perms; 6 | 7 | allow perfd cameraserver:process signull; 8 | 9 | allow perfd proc_kernel_sched:file r_file_perms; 10 | 11 | # read access /sys 12 | r_dir_file(perfd, sysfs_type) 13 | # normally write is not granted to the default "sysfs" label. 14 | # In this case, perfd needs access to files in /sys that are 15 | # commonly created and destroyed. When the kernel creates them, 16 | # they are created with the default label "sysfs". For robustness, 17 | # allow perfd to write to "sysfs" to ensure it can optimally 18 | # tune the power/cpu settings. 19 | allow perfd sysfs:file write; 20 | allow perfd sysfs_msm_perf:file write; 21 | allow perfd sysfs_ssr:file write; 22 | allow perfd sysfs_devices_system_cpu:file write; 23 | allow perfd sysfs_power_management:file write; 24 | allow perfd sysfs_devfreq:file write; 25 | allow perfd sysfs_lib:file write; 26 | 27 | allow perfd proc_kernel_sched:file w_file_perms; 28 | allow perfd gpu_device:chr_file rw_file_perms; 29 | 30 | # perfd uses kill(pid, 0) to determine if a process exists. 31 | # Determining if a process exists does not require the kill capability 32 | # since a permission denied indicates the process exists. 33 | dontaudit perfd self:capability kill; 34 | 35 | allow perfd surfaceflinger:process signull; 36 | allow perfd hal_graphics_composer_default:process signull; 37 | -------------------------------------------------------------------------------- /sepolicy/vendor/persist_file.te: -------------------------------------------------------------------------------- 1 | allow persist_file self:filesystem associate; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | get_prop(platform_app, camera_prop); 2 | binder_call(platform_app, hal_sensors_default); 3 | 4 | allow platform_app rootfs:dir getattr; 5 | 6 | allow platform_app init:unix_stream_socket { read write }; 7 | allow platform_app hal_sensors_default:unix_stream_socket { read write }; 8 | 9 | allow platform_app moto_boot_prop:file read; 10 | allow platform_app sysfs:dir { read open }; 11 | allow platform_app sysfs:file getattr; 12 | get_prop(platform_app, moto_boot_prop); -------------------------------------------------------------------------------- /sepolicy/vendor/pocketmode_app.te: -------------------------------------------------------------------------------- 1 | type pocketmode_app, domain; 2 | 3 | app_domain(pocketmode_app) 4 | 5 | # Allow pocketmode_app to find app_api_service 6 | allow pocketmode_app app_api_service:service_manager find; 7 | 8 | # Allow pocketmode_app read and write /data/data subdirectory 9 | allow pocketmode_app system_app_data_file:dir create_dir_perms; 10 | allow pocketmode_app system_app_data_file:{ file lnk_file } create_file_perms; 11 | 12 | # Allow pocketmode_app to search for sysfs fingerprint nodes 13 | allow pocketmode_app sysfs_fingerprint:dir search; 14 | 15 | # Allow pocketmode_app to write to sysfs fingerprint nodes 16 | allow pocketmode_app sysfs_fingerprint:file { w_file_perms getattr }; 17 | -------------------------------------------------------------------------------- /sepolicy/vendor/priv_app.te: -------------------------------------------------------------------------------- 1 | allow priv_app device:dir r_dir_perms; 2 | allow priv_app persist_file:filesystem getattr; 3 | allow priv_app proc_interrupts:file { open read getattr }; 4 | allow priv_app proc_modules:file { open read getattr }; 5 | allow priv_app adsprpcd_file:filesystem getattr; 6 | allow priv_app firmware_file:filesystem getattr; 7 | allow priv_app sysfs_android_usb:file open; 8 | allow priv_app sysfs:dir open; 9 | 10 | get_prop(priv_app, adspd_prop); 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | type adspd_prop, property_type; 2 | type motosh_prop, property_type; 3 | type hw_rev_prop, property_type; 4 | type touch_prop, property_type; 5 | type diag_prop, property_type; 6 | type thermal_prop, property_type; 7 | type qti_telephony_prop, property_type; 8 | type moto_boot_prop, property_type; 9 | type power_prop, property_type; 10 | type rmnet_prop, property_type; 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/qseeproxy.te: -------------------------------------------------------------------------------- 1 | allow qseeproxy self:process getattr; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti.te: -------------------------------------------------------------------------------- 1 | get_prop(qti, diag_prop) 2 | allow qti diag_device:chr_file { read write }; 3 | allow qti sysfs:file { open read }; 4 | allow qti vendor_data_file:dir r_dir_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | set_prop(qti_init_shell, ctl_start_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | binder_call(radio, cnd) 2 | 3 | allow radio hal_datafactory_hwservice:hwservice_manager find; 4 | allow radio hal_iwlan_hwservice:hwservice_manager find; 5 | 6 | get_prop(radio, vendor_qcom_ims_prop) 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/rfs_access.te: -------------------------------------------------------------------------------- 1 | allow rfs_access self:capability net_raw; 2 | allow rfs_access persist_file:file { getattr open read rename setattr unlink write }; 3 | allow rfs_access vendor_tombstone_data_file:dir search; 4 | 5 | allow rfs_access fsg_file:dir search; 6 | allow rfs_access fsg_file:file { getattr open read }; 7 | allow rfs_access fsg_file:lnk_file read; 8 | 9 | allow rfs_access persist_file:dir { add_name open remove_name read search setattr write }; 10 | allow rfs_access persist_file:file create; 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/rfs_file.te: -------------------------------------------------------------------------------- 1 | allow rfs_file persist_file:filesystem associate; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | binder_call(rild, audioserver_service); 2 | binder_call(rild, system_server); 3 | set_prop(rild, diag_prop); 4 | allow rild fsg_file:file { getattr open read }; 5 | allow rild fsg_file:dir { search open read }; 6 | allow rild fsg_file:lnk_file read; 7 | 8 | allow rild firmware_file:dir { getattr read open search }; 9 | allow rild mnt_vendor_file:dir search; 10 | 11 | allow rild cutback_data_file:dir rw_dir_perms; 12 | allow rild cutback_data_file:sock_file create_file_perms; 13 | 14 | allow rild rild_exec:file execute_no_trans; 15 | allow rild persist_file:dir r_dir_perms; 16 | allow rild persist_file:file rw_file_perms; 17 | allow rild fwk_sensor_hwservice:hwservice_manager find; 18 | allow rild proc:file { open read }; 19 | get_prop(rild, moto_boot_prop) 20 | set_prop(rild, vendor_radio_prop) 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/rmt_storage.te: -------------------------------------------------------------------------------- 1 | allow rmt_storage sysfs_rmt_storage:file rw_file_perms; 2 | allow rmt_storage sysfs_rmt_storage:dir { search open }; 3 | allow rmt_storage sysfs_uio:file r_file_perms; 4 | allow rmt_storage sysfs_uio:dir { read open search }; 5 | allow rmt_storage sysfs_uio:lnk_file { read }; 6 | allow rmt_storage debugfs_rmt_storage:dir search; 7 | allow rmt_storage debugfs_rmt_storage:file w_file_perms; 8 | 9 | allow rmt_storage fsg_file:file { read open getattr }; 10 | allow rmt_storage fsg_file:dir search; 11 | allow rmt_storage fsg_file:lnk_file read; 12 | allow rmt_storage fsg_file:dir r_dir_perms; 13 | allow rmt_storage fsg_file:file r_file_perms; 14 | 15 | allow rmt_storage firmware_file:file { read open getattr }; 16 | 17 | allow rmt_storage persist_file:dir r_dir_perms; 18 | get_prop(rmt_storage, moto_boot_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/seapp_contexts: -------------------------------------------------------------------------------- 1 | user=_app seinfo=platform name=com.motorola.dtv domain=isdbt_app type=app_data_file levelFrom=user 2 | user=_app seinfo=platform name=com.motorola.dtvservice domain=isdbt_app type=app_data_file levelFrom=user 3 | 4 | user=system seinfo=platform name=org.lineageos.pocketmode domain=pocketmode_app type=system_app_data_file 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/sensor_hub.te: -------------------------------------------------------------------------------- 1 | type sensor_hub, domain; 2 | type sensor_hub_exec, exec_type, vendor_file_type, file_type; 3 | init_daemon_domain(sensor_hub) 4 | 5 | allow sensor_hub sensors_device:chr_file rw_file_perms; 6 | allow sensor_hub sensorhub_data_file:dir { search }; 7 | set_prop(sensor_hub, motosh_prop) 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/service.te: -------------------------------------------------------------------------------- 1 | type qseeproxy_service_old, service_manager_type; 2 | type per_mgr_service_old, service_manager_type; 3 | type camera_bgproc_service, service_manager_type; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/service_contexts: -------------------------------------------------------------------------------- 1 | com.qualcomm.qti.qseeproxy u:object_r:qseeproxy_service_old:s0 2 | vendor.qcom.PeripheralManager u:object_r:per_mgr_service_old:s0 3 | media.camera_bgproc u:object_r:camera_bgproc_service:s0 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/servicemanager.te: -------------------------------------------------------------------------------- 1 | allow servicemanager init:dir search; 2 | allow servicemanager init:file { open read }; 3 | allow servicemanager init:process getattr; 4 | allow servicemanager qseeproxy:dir search; 5 | allow servicemanager qseeproxy:file { open read }; 6 | allow servicemanager rild:dir search; 7 | allow servicemanager rild:file { open read }; 8 | allow servicemanager rild:process getattr; 9 | 10 | allow servicemanager hal_fingerprint_default:dir search; 11 | allow servicemanager hal_fingerprint_default:file read; 12 | allow servicemanager qseeproxy:process getattr; 13 | 14 | 15 | allow servicemanager hal_camera_default:dir search; 16 | allow servicemanager hal_camera_default:file r_file_perms; 17 | allow servicemanager hal_camera_default:process getattr; 18 | 19 | allow servicemanager hal_fingerprint_default:file open; 20 | allow servicemanager hal_fingerprint_default:process getattr; 21 | 22 | allow servicemanager wcnss_service:dir search; 23 | allow servicemanager wcnss_service:file { open read }; 24 | 25 | allow servicemanager esepmdaemon:dir search; 26 | allow servicemanager esepmdaemon:file { open read }; 27 | allow servicemanager esepmdaemon:process getattr; 28 | 29 | allow servicemanager vendor_per_mgr:dir search; 30 | allow servicemanager vendor_per_mgr:file { open read }; 31 | allow servicemanager vendor_per_mgr:process getattr; 32 | allow servicemanager wcnss_service:process getattr; 33 | 34 | allow servicemanager hal_gnss_qti:dir search; 35 | allow servicemanager hal_gnss_qti:file { open read }; 36 | allow servicemanager hal_gnss_qti:process getattr; 37 | 38 | allow servicemanager hal_sensors_default:dir search; 39 | allow servicemanager hal_sensors_default:file { open read }; 40 | allow servicemanager hal_sensors_default:process getattr; 41 | 42 | allow servicemanager sensors:dir search; 43 | allow servicemanager sensors:file { open read }; 44 | allow servicemanager sensors:process getattr; 45 | 46 | -------------------------------------------------------------------------------- /sepolicy/vendor/surfaceflinger.te: -------------------------------------------------------------------------------- 1 | get_prop(surfaceflinger, diag_prop); 2 | allow surfaceflinger perfd_data_file:sock_file write; 3 | allow surfaceflinger perfd_data_file:dir search; 4 | allow surfaceflinger diag_device:chr_file { read write }; 5 | 6 | binder_call(surfaceflinger, hwservicemanager) 7 | 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app proc_touchpanel:dir search; 2 | allow system_app sysfs_vibrator:file rw_file_perms; 3 | allow system_app sysfs_vibrator:dir search; 4 | allow system_app sysfs_graphics:file rw_file_perms; 5 | allow system_app sysfs_graphics:dir search; 6 | allow system_app proc_touchpanel:file rw_file_perms; 7 | allow system_app sysfs_fpc:file rw_file_perms; 8 | allow system_app fuse_device:filesystem getattr; 9 | 10 | allow system_app init:unix_stream_socket { read write }; 11 | allow system_app sysfs_homebutton:file rw_file_perms; 12 | allow system_app sysfs_homebutton:dir search; 13 | allow system_app sysfs_screen_off_gestures:file { getattr open write }; 14 | allow system_app sysfs_zram:dir { search read }; 15 | allow system_app proc_pagetypeinfo:file { read open getattr }; 16 | 17 | allow system_app sysfs_zram:file { read open getattr}; 18 | allow system_app sysfs_rtc:dir { r_dir_perms search }; 19 | 20 | get_prop(system_app, diag_prop); 21 | binder_call(system_app, wificond); 22 | binder_call(system_app, vold) -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | binder_call(system_server, rild); 2 | binder_call(system_server, hal_audio_default) 3 | 4 | allow system_server sysfs_homebutton:file rw_file_perms; 5 | allow system_server sysfs_homebutton:dir r_dir_perms; 6 | allow system_server rild:binder transfer; 7 | allow system_server sysfs_capsense:dir search; 8 | allow system_server sysfs_capsense:file rw_file_perms; 9 | allow system_server init:unix_stream_socket { read }; 10 | # allow system_server dalvikcache_data_file:file { execute }; 11 | 12 | allow system_server qti_debugfs:file { getattr open read }; 13 | allow system_server init:unix_stream_socket write; 14 | 15 | allow system_server sensors_device:chr_file { ioctl open read }; 16 | 17 | allow system_server mm-qcamerad:binder call; 18 | allow system_server sysfs:file { getattr }; 19 | 20 | allow system_server fpc_extension_service:hwservice_manager find; 21 | allow system_server vendor_idc_file:dir r_dir_perms; 22 | allow system_server vendor_keylayout_file:dir r_dir_perms; 23 | 24 | allow system_server sysfs_battery_supply:file r_file_perms; 25 | 26 | get_prop(system_server, exported_camera_prop) 27 | get_prop(system_server, userspace_reboot_config_prop) 28 | get_prop(system_server, userspace_reboot_exported_prop) 29 | allow system_server sysfs_livedisplay_tuneable:file { read write }; 30 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | typeattribute tee data_between_core_and_vendor_violators; 2 | 3 | allow tee persist_file:file r_file_perms; 4 | allow tee persist_file:dir r_dir_perms; 5 | 6 | allow tee fingerprintd_data_file:dir rw_dir_perms; 7 | allow tee fingerprintd_data_file:file create_file_perms; 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine thermal_device:chr_file { ioctl }; 2 | r_dir_file(thermal-engine, sysfs) 3 | r_dir_file(thermal-engine, sysfs_vadc_dev) -------------------------------------------------------------------------------- /sepolicy/vendor/time_daemon.te: -------------------------------------------------------------------------------- 1 | get_prop(time_daemon, diag_prop); 2 | 3 | allow time_daemon persist_file:file { open read write }; 4 | allow time_daemon sysfs:file {open read }; 5 | allow time_daemon persist_file:dir r_dir_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/toolbox.te: -------------------------------------------------------------------------------- 1 | set_prop(toolbox, diag_prop); 2 | set_prop(toolbox, hw_rev_prop); 3 | set_prop(toolbox, touch_prop); 4 | allow toolbox init:fifo_file { write getattr }; 5 | 6 | allow toolbox self:capability { chown }; 7 | 8 | allow toolbox radio_data_file:file rw_file_perms; 9 | allow toolbox init:fifo_file ioctl; 10 | allow toolbox sysfs:dir r_dir_perms; 11 | allow toolbox init:fifo_file read; 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | allow ueventd sysfs_mmi_fp:file w_file_perms; 2 | 3 | allow ueventd synaptics_rmi_device:chr_file { rw_file_perms relabelfrom relabelto}; 4 | allow ueventd sysfs_fpc:file rw_file_perms; 5 | 6 | allow ueventd unlabeled:dir { search }; 7 | allow ueventd unlabeled:file { getattr open read }; 8 | allow ueventd self:capability sys_nice; -------------------------------------------------------------------------------- /sepolicy/vendor/untrusted_app.te: -------------------------------------------------------------------------------- 1 | get_prop(untrusted_app, camera_prop); 2 | get_prop(untrusted_app_25, camera_prop); 3 | allow untrusted_app sysfs_zram:dir { search read }; 4 | allow untrusted_app sysfs_zram:file { open read getattr }; 5 | 6 | allow untrusted_app firmware_file:dir read; 7 | allow untrusted_app fsg_file:dir read; 8 | 9 | allow untrusted_app proc_asound:dir search; 10 | allow untrusted_app proc_qtaguid_stat:file read; 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | dhcp_data_file 5 | media_rw_data_file 6 | system_data_file 7 | tombstone_data_file 8 | wifi_data_file 9 | camera_data_file 10 | bluetooth_data_file 11 | fingerprintd_data_file 12 | fingerprint_data_file 13 | gbfirmware_file 14 | persist_file 15 | dbvc_data_file 16 | moodle_data_file 17 | wapi_supplicant_data_file 18 | sds_data_file 19 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 20 | 21 | allow vendor_init debugfs:dir write; 22 | allow vendor_init media_rw_data_file:file { create getattr open read write setattr relabelfrom unlink }; 23 | allow vendor_init rootfs:lnk_file { setattr }; 24 | allow vendor_init rootfs:dir { write add_name }; 25 | allow vendor_init adsprpcd_file:filesystem getattr; 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_qti_init_shell.te: -------------------------------------------------------------------------------- 1 | allow vendor_qti_init_shell kmsg_device:chr_file { open write }; 2 | allow vendor_qti_init_shell sysfs_sensor:file { rw_file_perms setattr }; 3 | allow vendor_qti_init_shell persist_camera_file:file r_file_perms; 4 | allow vendor_qti_init_shell kmsg_device:chr_file { open write }; 5 | allow vendor_qti_init_shell sysfs:file { rw_file_perms setattr }; 6 | allow vendor_qti_init_shell vendor_radio_data_file:dir rw_dir_perms; 7 | allow vendor_qti_init_shell vendor_radio_data_file:file create_file_perms; 8 | 9 | allow vendor_qti_init_shell system_prop:property_service set; 10 | 11 | allow vendor_qti_init_shell vendor_default_prop:property_service set; 12 | 13 | dontaudit vendor_qti_init_shell self:capability dac_override; 14 | 15 | set_prop(vendor_qti_init_shell, rmnet_prop) 16 | get_prop(vendor_qti_init_shell, moto_boot_prop) 17 | get_prop(vendor_qti_init_shell, vendor_radio_prop) 18 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_ssr_setup.te: -------------------------------------------------------------------------------- 1 | allow vendor_ssr_setup sysfs:file read; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | allow vold metadata_block_device:blk_file { rw_file_perms }; 2 | 3 | # For setting read_ahead_kb 4 | allow vold sysfs_mmc_host:file w_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | set_prop(wcnss_service, wifi_prop); 2 | get_prop(wcnss_service, diag_prop); 3 | allowxperm wcnss_service self:udp_socket ioctl priv_sock_ioctls; 4 | 5 | allow wcnss_service sysfs:file rw_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/webview_zygote.te: -------------------------------------------------------------------------------- 1 | allow webview_zygote zygote:unix_dgram_socket write; -------------------------------------------------------------------------------- /sepolicy/vendor/zygote.te: -------------------------------------------------------------------------------- 1 | allow zygote self:capability sys_nice; 2 | allow zygote proc_cmdline:file { getattr open read }; 3 | get_prop(zygote, exported_camera_prop) 4 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | DEVICE=addison 12 | VENDOR=motorola 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | . "$HELPER" 26 | 27 | # Initialize the helper 28 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" 29 | 30 | # Copyright headers and guards 31 | write_headers 32 | 33 | write_makefiles "$MY_DIR"/proprietary-files.txt 34 | write_makefiles "$MY_DIR"/proprietary-files_addison.txt 35 | 36 | # Finish 37 | write_footers 38 | -------------------------------------------------------------------------------- /vibrator/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2017 The Android Open Source Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | cc_binary { 16 | name: "android.hardware.vibrator@1.0-service.addison", 17 | relative_install_path: "hw", 18 | init_rc: ["android.hardware.vibrator@1.0-service.addison.rc"], 19 | vintf_fragments: ["android.hardware.vibrator@1.0-service.addison.xml"], 20 | srcs: ["service.cpp", "Vibrator.cpp"], 21 | cflags: ["-Wall", "-Werror"], 22 | shared_libs: [ 23 | "libhidlbase", 24 | "liblog", 25 | "libutils", 26 | "libhardware", 27 | "android.hardware.vibrator@1.0", 28 | ], 29 | vendor: true, 30 | } 31 | -------------------------------------------------------------------------------- /vibrator/Vibrator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #ifndef ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H 17 | #define ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace vibrator { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | class Vibrator : public IVibrator { 31 | public: 32 | Vibrator(std::ofstream&& enable, std::ofstream&& amplitude); 33 | 34 | // Methods from ::android::hardware::vibrator::V1_0::IVibrator follow. 35 | Return on(uint32_t timeoutMs) override; 36 | Return off() override; 37 | Return supportsAmplitudeControl() override; 38 | Return setAmplitude(uint8_t amplitude) override; 39 | Return perform(Effect effect, EffectStrength strength, perform_cb _hidl_cb) override; 40 | 41 | private: 42 | std::ofstream mEnable; 43 | std::ofstream mAmplitude; 44 | }; 45 | } // namespace implementation 46 | } // namespace V1_0 47 | } // namespace vibrator 48 | } // namespace hardware 49 | } // namespace android 50 | 51 | #endif // ANDROID_HARDWARE_VIBRATOR_V1_0_VIBRATOR_H 52 | -------------------------------------------------------------------------------- /vibrator/android.hardware.vibrator@1.0-service.addison.rc: -------------------------------------------------------------------------------- 1 | service vendor.vibrator-1-0 /vendor/bin/hw/android.hardware.vibrator@1.0-service.addison 2 | interface android.hardware.vibrator@1.0::IVibrator default 3 | class hal 4 | user system 5 | group system 6 | -------------------------------------------------------------------------------- /vibrator/android.hardware.vibrator@1.0-service.addison.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.vibrator 4 | hwbinder 5 | 1.0 6 | 7 | IVibrator 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /wifi/WCNSS_cfg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_motorola_addison/daf1d8d27e577517e4dd52560180746f88212165/wifi/WCNSS_cfg.dat -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | interworking=1 6 | hs20=1 7 | auto_interworking=0 8 | bss_max_count=512 9 | bss_no_flush_when_down=1 10 | driver_param=use_p2p_group_interface=1 11 | --------------------------------------------------------------------------------