From 765503ce5ea4f2635ba51b3ffc81423f02d47d15 Mon Sep 17 00:00:00 2001 From: Astrako Date: Sun, 17 Nov 2019 18:53:04 +0100 Subject: [PATCH] Initial common device tree --- Android.mk | 24 + BoardConfigCommon.mk | 188 + compatibility_matrix.xml | 58 + config.fs | 11 + configs/audio/audio_effects.xml | 25 + configs/audio/audio_policy.conf | 122 + configs/audio/audio_policy_configuration.xml | 148 + configs/audio/mixer_gains.xml | 1867 ++++ configs/audio/mixer_paths_0.xml | 1638 ++++ configs/camera/external_camera_config.xml | 58 + configs/idc/AVRCP.idc | 19 + configs/idc/qwerty.idc | 28 + configs/idc/qwerty2.idc | 28 + configs/keylayout/gpio-keys.kl | 30 + configs/keylayout/sec_touchkey.kl | 19 + configs/keylayout/sec_touchscreen.kl | 18 + configs/media/media_codecs.xml | 223 + configs/media/media_codecs_performance.xml | 158 + configs/media/media_profiles_V1_0.xml | 637 ++ .../com.samsung.permission.SSENSOR.xml | 16 + device-common.mk | 324 + extract-files.sh | 67 + hidl/Android.mk | 47 + include/hardware/audio_amplifier.h | 157 + include/hardware/gnss-base.h | 275 + include/hardware/gps.h | 2006 +++++ include/hardware/gralloc.h | 437 + include/samsung_audio.h | 84 + include/samsung_dtbh.h | 46 + include/telephony/ril.h | 7481 +++++++++++++++++ include/telephony/ril_cdma_sms.h | 806 ++ include/telephony/ril_commands_vendor.h | 46 + include/telephony/ril_msim.h | 48 + include/telephony/ril_nv_items.h | 88 + include/telephony/ril_unsol_commands_vendor.h | 85 + lineage.dependencies | 14 + manifest.xml | 422 + .../base/core/res/res/values/config.xml | 634 ++ .../packages/Keyguard/res/values/config.xml | 26 + .../SettingsProvider/res/values/defaults.xml | 24 + .../packages/SystemUI/res/values/config.xml | 30 + .../lineage/res/res/values/config.xml | 154 + .../apps/Settings/res/values/arrays.xml | 31 + .../apps/Settings/res/values/config.xml | 25 + .../services/Telephony/res/values/config.xml | 22 + proprietary-files.txt | 170 + rootdir/Android.mk | 88 + rootdir/etc/fstab.recovery | 21 + rootdir/etc/fstab.samsungexynos7870 | 21 + rootdir/etc/init.baseband.rc | 63 + rootdir/etc/init.rilchip.rc | 22 + rootdir/etc/init.rilcommon.rc | 20 + rootdir/etc/init.samsung.rc | 1892 +++++ rootdir/etc/init.samsungexynos7870.rc | 566 ++ rootdir/etc/init.samsungexynos7870.usb.rc | 302 + rootdir/etc/init.wifi.rc | 57 + rootdir/etc/twrp.fstab | 14 + rootdir/etc/ueventd.samsungexynos7870.rc | 268 + seccomp/mediacodec-seccomp.policy | 19 + seccomp/mediaextractor-seccomp.policy | 5 + sepolicy_minimal/file.te | 3 + sepolicy_minimal/file_contexts | 3 + setup-makefiles.sh | 48 + shims/Android.mk | 20 + shims/libexynoscamera/Android.mk | 27 + shims/libexynoscamera/CameraParameters.cpp | 50 + shims/libexynoscamera/CameraParameters.h | 52 + shims/libexynoscamera/GraphicBuffer.cpp | 20 + shims/libstagefright/Android.mk | 46 + shims/libstagefright/CameraSource.cpp | 97 + vendor_prop.mk | 77 + 71 files changed, 22665 insertions(+) create mode 100644 Android.mk create mode 100644 BoardConfigCommon.mk create mode 100644 compatibility_matrix.xml create mode 100644 config.fs create mode 100755 configs/audio/audio_effects.xml create mode 100755 configs/audio/audio_policy.conf create mode 100755 configs/audio/audio_policy_configuration.xml create mode 100644 configs/audio/mixer_gains.xml create mode 100644 configs/audio/mixer_paths_0.xml create mode 100644 configs/camera/external_camera_config.xml create mode 100644 configs/idc/AVRCP.idc create mode 100644 configs/idc/qwerty.idc create mode 100644 configs/idc/qwerty2.idc create mode 100644 configs/keylayout/gpio-keys.kl create mode 100644 configs/keylayout/sec_touchkey.kl create mode 100644 configs/keylayout/sec_touchscreen.kl create mode 100644 configs/media/media_codecs.xml create mode 100644 configs/media/media_codecs_performance.xml create mode 100644 configs/media/media_profiles_V1_0.xml create mode 100644 configs/permissions/com.samsung.permission.SSENSOR.xml create mode 100644 device-common.mk create mode 100644 extract-files.sh create mode 100644 hidl/Android.mk create mode 100644 include/hardware/audio_amplifier.h create mode 100644 include/hardware/gnss-base.h create mode 100644 include/hardware/gps.h create mode 100644 include/hardware/gralloc.h create mode 100644 include/samsung_audio.h create mode 100644 include/samsung_dtbh.h create mode 100644 include/telephony/ril.h create mode 100644 include/telephony/ril_cdma_sms.h create mode 100644 include/telephony/ril_commands_vendor.h create mode 100644 include/telephony/ril_msim.h create mode 100644 include/telephony/ril_nv_items.h create mode 100644 include/telephony/ril_unsol_commands_vendor.h create mode 100644 lineage.dependencies create mode 100644 manifest.xml create mode 100644 overlay/frameworks/base/core/res/res/values/config.xml create mode 100644 overlay/frameworks/base/packages/Keyguard/res/values/config.xml create mode 100644 overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml create mode 100644 overlay/frameworks/base/packages/SystemUI/res/values/config.xml create mode 100755 overlay/lineage-sdk/lineage/res/res/values/config.xml create mode 100755 overlay/packages/apps/Settings/res/values/arrays.xml create mode 100644 overlay/packages/apps/Settings/res/values/config.xml create mode 100644 overlay/packages/services/Telephony/res/values/config.xml create mode 100644 proprietary-files.txt create mode 100644 rootdir/Android.mk create mode 100644 rootdir/etc/fstab.recovery create mode 100644 rootdir/etc/fstab.samsungexynos7870 create mode 100644 rootdir/etc/init.baseband.rc create mode 100755 rootdir/etc/init.rilchip.rc create mode 100755 rootdir/etc/init.rilcommon.rc create mode 100644 rootdir/etc/init.samsung.rc create mode 100755 rootdir/etc/init.samsungexynos7870.rc create mode 100644 rootdir/etc/init.samsungexynos7870.usb.rc create mode 100644 rootdir/etc/init.wifi.rc create mode 100644 rootdir/etc/twrp.fstab create mode 100644 rootdir/etc/ueventd.samsungexynos7870.rc create mode 100644 seccomp/mediacodec-seccomp.policy create mode 100644 seccomp/mediaextractor-seccomp.policy create mode 100644 sepolicy_minimal/file.te create mode 100644 sepolicy_minimal/file_contexts create mode 100644 setup-makefiles.sh create mode 100644 shims/Android.mk create mode 100644 shims/libexynoscamera/Android.mk create mode 100644 shims/libexynoscamera/CameraParameters.cpp create mode 100644 shims/libexynoscamera/CameraParameters.h create mode 100644 shims/libexynoscamera/GraphicBuffer.cpp create mode 100644 shims/libstagefright/Android.mk create mode 100644 shims/libstagefright/CameraSource.cpp create mode 100644 vendor_prop.mk diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..57ba1ab --- /dev/null +++ b/Android.mk @@ -0,0 +1,24 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +ifneq ($(filter a3y17lte j5y17lte j7y17lte a6lte j6lte, $(TARGET_DEVICE)),) + +include $(call all-makefiles-under,$(LOCAL_PATH)) +include $(CLEAR_VARS) + +endif diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk new file mode 100644 index 0000000..9281c9d --- /dev/null +++ b/BoardConfigCommon.mk @@ -0,0 +1,188 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := device/samsung/universal7870-common + +# Include path +TARGET_SPECIFIC_HEADER_PATH := $(LOCAL_PATH)/include + +# Firmware +TARGET_NO_BOOTLOADER := true +TARGET_NO_RADIOIMAGE := true + +# Platform +BOARD_VENDOR := samsung +TARGET_BOOTLOADER_BOARD_NAME := universal7870 +TARGET_BOARD_PLATFORM := exynos5 +TARGET_SOC := exynos7870 + +# Architecture +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_ABI2 := +TARGET_CPU_VARIANT := cortex-a53 +TARGET_CPU_VARIANT_RUNTIME := cortex-a53 + +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv8-a +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := cortex-a53 +TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53 + +# Binder +TARGET_BOARD_SUFFIX := _64 +TARGET_USES_64_BIT_BINDER := true +BUILD_BROKEN_DUP_RULES := true +BUILD_BROKEN_PHONY_TARGETS := true + +# Extracted with libbootimg +BOARD_CUSTOM_BOOTIMG := true +BOARD_CUSTOM_BOOTIMG_MK := hardware/samsung/mkbootimg.mk +BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 +BOARD_KERNEL_BASE := 0x10000000 +BOARD_KERNEL_PAGESIZE := 2048 +BOARD_KERNEL_IMAGE_NAME := Image +BOARD_KERNEL_SEPARATED_DT := true +TARGET_CUSTOM_DTBTOOL := dtbhtoolExynos + +# Kernel +TARGET_KERNEL_ARCH := arm64 +TARGET_KERNEL_HEADER_ARCH := arm64 +TARGET_LINUX_KERNEL_VERSION := 3.18 + +# Kernel config +TARGET_KERNEL_SOURCE := kernel/samsung/exynos7870 + +# HIDL +DEVICE_MANIFEST_FILE := $(LOCAL_PATH)/manifest.xml +DEVICE_MATRIX_FILE := $(LOCAL_PATH)/compatibility_matrix.xml + +# Use these flags if the board has a ext4 partition larger than 2gb +BOARD_HAS_LARGE_FILESYSTEM := true +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +TARGET_FS_CONFIG_GEN := $(LOCAL_PATH)/config.fs + +# Partitions +BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432 +BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200 +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_RECOVERYIMAGE_PARTITION_SIZE := 39845888 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2871279104 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 54618209280 +BOARD_VENDORIMAGE_PARTITION_SIZE := 434596224 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_FLASH_BLOCK_SIZE := 4096 +TARGET_USERIMAGES_USE_EXT4 := true +TARGET_USERIMAGES_USE_F2FS := true +BOARD_ROOT_EXTRA_FOLDERS := efs cpefs + +# Vendor separation +TARGET_COPY_OUT_VENDOR := vendor + +# Audio +USE_XML_AUDIO_POLICY_CONF := 1 +AUDIOSERVER_MULTILIB := 32 + +# Backlight +BACKLIGHT_PATH := "/sys/class/backlight/panel/brightness" + +# Camera +BOARD_USE_SAMSUNG_CAMERAFORMAT_NV21 := true +TARGET_USES_MEDIA_EXTENSIONS := true +USE_DEVICE_SPECIFIC_CAMERA := true +BOARD_BACK_CAMERA_SENSOR := 0 +BOARD_FRONT_CAMERA_SENSOR := 1 + +# Crypto +TARGET_HW_DISK_ENCRYPTION := true + +# Device Tree +BOARD_USES_DT := true + +# Dexpreopt +ifeq ($(HOST_OS),linux) + ifneq ($(TARGET_BUILD_VARIANT),eng) + ifeq ($(WITH_DEXPREOPT),) + WITH_DEXPREOPT := true + WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false + endif + endif +endif + +# HWComposer +BOARD_HDMI_INCAPABLE := true +BOARD_USES_DECON_64BIT_ADDRESS := true +BOARD_USES_EXYNOS5_COMMON_GRALLOC := true +BOARD_USES_HWC_SERVICES := true +BOARD_USES_VPP := true +MAX_EGL_CACHE_KEY_SIZE := 12*1024 +MAX_EGL_CACHE_SIZE := 2048*1024 +MAX_VIRTUAL_DISPLAY_DIMENSION := 2048 +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 +TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS := 0x2000 +TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true +TARGET_USES_GRALLOC1 := true +TARGET_USES_HWC2 := true +TARGET_USES_ION := true +TARGET_USES_NEW_ION_API :=true +TARGET_USES_OVERLAY := true +USE_OPENGL_RENDERER := true + +# HALs +TARGET_AUDIOHAL_VARIANT := samsung +TARGET_POWERHAL_VARIANT := samsung + +# Libhwui +HWUI_COMPILE_FOR_PERF := true + +# Recovery +BOARD_HAS_DOWNLOAD_MODE := true +TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/rootdir/etc/fstab.recovery + +# Renderscript +OVERRIDE_RS_DRIVER := libRSDriverArm.so + +# RIL +BOARD_VENDOR := samsung +BOARD_MODEM_TYPE := tss310 +BOARD_PROVIDES_LIBRIL := true +ENABLE_VENDOR_RIL_SERVICE := true + +# Security patch level +VENDOR_SECURITY_PATCH := 2019-10-05 + +# Seccomp +BOARD_SECCOMP_POLICY := $(LOCAL_PATH)/seccomp + +# SELinux +BOARD_SEPOLICY_DIRS := $(LOCAL_PATH)/sepolicy_minimal +SELINUX_IGNORE_NEVERALLOWS := true + +# Treble +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true +PRODUCT_FULL_TREBLE_OVERRIDE := true +PRODUCT_VENDOR_MOVE_ENABLED := true +BOARD_VNDK_VERSION := current + +# Shims +TARGET_LD_SHIM_LIBS += \ + /vendor/lib/libexynoscamera.so|/vendor/lib/libexynoscamera_shim.so + +# Wifi +BOARD_HAVE_SAMSUNG_WIFI := true diff --git a/compatibility_matrix.xml b/compatibility_matrix.xml new file mode 100644 index 0000000..ffd387b --- /dev/null +++ b/compatibility_matrix.xml @@ -0,0 +1,58 @@ + + + android.frameworks.schedulerservice + 1.0 + + ISchedulingPolicyService + default + + + + android.frameworks.sensorservice + 1.0 + + ISensorManager + default + + + + android.hidl.allocator + 1.0 + + IAllocator + ashmem + + + + android.hidl.manager + 1.1 + + IServiceManager + default + + + + android.hidl.memory + 1.0 + + IMapper + ashmem + + + + android.hidl.token + 1.0 + + ITokenManager + default + + + + android.system.wifi.keystore + 1.0 + + IKeystore + default + + + diff --git a/config.fs b/config.fs new file mode 100644 index 0000000..a6fb3c8 --- /dev/null +++ b/config.fs @@ -0,0 +1,11 @@ +[cpefs/] +mode: 0771 +user: AID_SYSTEM +group: AID_RADIO +caps: 0 + +[efs/] +mode: 0771 +user: AID_SYSTEM +group: AID_RADIO +caps: 0 diff --git a/configs/audio/audio_effects.xml b/configs/audio/audio_effects.xml new file mode 100755 index 0000000..ebce9cf --- /dev/null +++ b/configs/audio/audio_effects.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/audio/audio_policy.conf b/configs/audio/audio_policy.conf new file mode 100755 index 0000000..339594d --- /dev/null +++ b/configs/audio/audio_policy.conf @@ -0,0 +1,122 @@ +global_configuration { + attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE + default_output_device AUDIO_DEVICE_OUT_SPEAKER + attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_PLAYBACK +} + +audio_hw_modules { + primary { + outputs { + primary { + sampling_rates 48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT + devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO + flags AUDIO_OUTPUT_FLAG_PRIMARY + } + deep_buffer { + sampling_rates 48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO + flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER + } + } + inputs { + primary { + sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 + channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_VOICE_UPLINK|AUDIO_CHANNEL_IN_VOICE_DNLINK + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_FM + } + } + } + a2dp { + outputs { + a2dp { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_ALL_A2DP + } + } + inputs { + a2dp { + sampling_rates 44100|48000 + channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP + } + } + } + usb { + outputs { + usb_accessory { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_USB_ACCESSORY + } + usb_device { + sampling_rates 44100|48000 + channel_masks dynamic + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET + } + } + inputs { + usb_device { + sampling_rates dynamic + channel_masks AUDIO_CHANNEL_IN_STEREO + formats dynamic + devices AUDIO_DEVICE_IN_USB_DEVICE + } + } + } + tms { + outputs { + tms { + sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_EXTERNAL_TMS + } + } + inputs { + tms { + sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000 + channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_EXTERNAL_TMS + } + } + } + r_submix { + outputs { + submix { + sampling_rates 48000|44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX + } + } + inputs { + submix { + sampling_rates 48000|44100 + channel_masks AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_REMOTE_SUBMIX + } + } + } + playback_record { + inputs { + playback_record { + sampling_rates 48000 + channel_masks AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_PLAYBACK + } + } + } +} diff --git a/configs/audio/audio_policy_configuration.xml b/configs/audio/audio_policy_configuration.xml new file mode 100755 index 0000000..d37896f --- /dev/null +++ b/configs/audio/audio_policy_configuration.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + Earpiece + Speaker + Built-In Mic + Built-In Back Mic + Voice Call Mic + + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/audio/mixer_gains.xml b/configs/audio/mixer_gains.xml new file mode 100644 index 0000000..1713e65 --- /dev/null +++ b/configs/audio/mixer_gains.xml @@ -0,0 +1,1867 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/audio/mixer_paths_0.xml b/configs/audio/mixer_paths_0.xml new file mode 100644 index 0000000..921b91f --- /dev/null +++ b/configs/audio/mixer_paths_0.xml @@ -0,0 +1,1638 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/camera/external_camera_config.xml b/configs/camera/external_camera_config.xml new file mode 100644 index 0000000..50adbaa --- /dev/null +++ b/configs/camera/external_camera_config.xml @@ -0,0 +1,58 @@ + + + + + 6 + 7 + 8 + 9 + 12 + 50 + 101 + 102 + 103 + 104 + 109 + 110 + 111 + 112 + 120 + 121 + 122 + 130 + 131 + 132 + 140 + 141 + 142 + 160 + 161 + 170 + 171 + 172 + 173 + 174 + 180 + 190 + 191 + 192 + 193 + 210 + 211 + 212 + 213 + 214 + 215 + 216 + 217 + 218 + 219 + 220 + 221 + 222 + 223 + 224 + 225 + + + diff --git a/configs/idc/AVRCP.idc b/configs/idc/AVRCP.idc new file mode 100644 index 0000000..610b7f9 --- /dev/null +++ b/configs/idc/AVRCP.idc @@ -0,0 +1,19 @@ +# Copyright (C) 2015 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# AVRCP +# + +device.internal = 1 diff --git a/configs/idc/qwerty.idc b/configs/idc/qwerty.idc new file mode 100644 index 0000000..375d785 --- /dev/null +++ b/configs/idc/qwerty.idc @@ -0,0 +1,28 @@ +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Emulator keyboard configuration file #1. +# + +touch.deviceType = touchScreen +touch.orientationAware = 1 + +keyboard.layout = qwerty +keyboard.characterMap = qwerty +keyboard.orientationAware = 1 +keyboard.builtIn = 1 + +cursor.mode = navigation +cursor.orientationAware = 1 diff --git a/configs/idc/qwerty2.idc b/configs/idc/qwerty2.idc new file mode 100644 index 0000000..369205e --- /dev/null +++ b/configs/idc/qwerty2.idc @@ -0,0 +1,28 @@ +# Copyright (C) 2010 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# Emulator keyboard configuration file #2. +# + +touch.deviceType = touchScreen +touch.orientationAware = 1 + +keyboard.layout = qwerty +keyboard.characterMap = qwerty2 +keyboard.orientationAware = 1 +keyboard.builtIn = 1 + +cursor.mode = navigation +cursor.orientationAware = 1 diff --git a/configs/keylayout/gpio-keys.kl b/configs/keylayout/gpio-keys.kl new file mode 100644 index 0000000..65a7ccf --- /dev/null +++ b/configs/keylayout/gpio-keys.kl @@ -0,0 +1,30 @@ +# Copyright (c) 2013, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + +key 114 VOLUME_DOWN +key 115 VOLUME_UP +key 116 POWER +key 172 HOME diff --git a/configs/keylayout/sec_touchkey.kl b/configs/keylayout/sec_touchkey.kl new file mode 100644 index 0000000..54a5268 --- /dev/null +++ b/configs/keylayout/sec_touchkey.kl @@ -0,0 +1,19 @@ +# +# Copyright (C) 2014 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +key 158 BACK +key 172 HOME +key 254 APP_SWITCH diff --git a/configs/keylayout/sec_touchscreen.kl b/configs/keylayout/sec_touchscreen.kl new file mode 100644 index 0000000..7bc9eb3 --- /dev/null +++ b/configs/keylayout/sec_touchscreen.kl @@ -0,0 +1,18 @@ +# +# Copyright (C) 2014 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +key 158 BACK +key 254 APP_SWITCH \ No newline at end of file diff --git a/configs/media/media_codecs.xml b/configs/media/media_codecs.xml new file mode 100644 index 0000000..f4f1f6d --- /dev/null +++ b/configs/media/media_codecs.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/media/media_codecs_performance.xml b/configs/media/media_codecs_performance.xml new file mode 100644 index 0000000..41c69b4 --- /dev/null +++ b/configs/media/media_codecs_performance.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/configs/media/media_profiles_V1_0.xml b/configs/media/media_profiles_V1_0.xml new file mode 100644 index 0000000..dc0f9c4 --- /dev/null +++ b/configs/media/media_profiles_V1_0.xml @@ -0,0 +1,637 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/configs/permissions/com.samsung.permission.SSENSOR.xml b/configs/permissions/com.samsung.permission.SSENSOR.xml new file mode 100644 index 0000000..768c8b7 --- /dev/null +++ b/configs/permissions/com.samsung.permission.SSENSOR.xml @@ -0,0 +1,16 @@ + + + + + + diff --git a/device-common.mk b/device-common.mk new file mode 100644 index 0000000..98885db --- /dev/null +++ b/device-common.mk @@ -0,0 +1,324 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := device/samsung/universal7870-common + +# Boot animation +TARGET_BOOTANIMATION_PRELOAD := true +TARGET_BOOTANIMATION_TEXTURE_CACHE := true +TARGET_SCREEN_HEIGHT := 1920 +TARGET_SCREEN_WIDTH := 1080 + +PRODUCT_ENFORCE_RRO_TARGETS := \ + framework-res + +# Permissions +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \ + frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \ + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \ + frameworks/native/data/etc/android.hardware.camera.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \ + frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \ + frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \ + frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \ + frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \ + frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \ + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \ + frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \ + frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \ + frameworks/native/data/etc/android.hardware.telephony.ims.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.ims.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute-0.xml \ + frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level-0.xml \ + frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version-1_1.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.hardware.wifi.passpoint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.passpoint.xml \ + frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \ + frameworks/native/data/etc/android.software.print.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.print.xml \ + frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \ + frameworks/native/data/etc/android.software.sip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.xml \ + frameworks/native/data/etc/com.android.nfc_extras.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.android.nfc_extras.xml \ + frameworks/native/data/etc/com.nxp.mifare.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.nxp.mifare.xml \ + frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml \ + $(LOCAL_PATH)/configs/permissions/com.samsung.permission.SSENSOR.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.samsung.permission.SSENSOR.xml + +# AdvancedDisplay (MDNIE) +PRODUCT_PACKAGES += \ + AdvancedDisplay + +# Audio +PRODUCT_PACKAGES += \ + android.hardware.audio@2.0-impl \ + android.hardware.audio@2.0-service \ + android.hardware.audio@5.0-impl \ + android.hardware.audio.common@5.0 \ + android.hardware.audio.common@5.0-util \ + android.hardware.audio.effect@2.0-impl \ + android.hardware.audio.effect@5.0 \ + android.hardware.audio.effect@5.0-impl \ + android.hardware.soundtrigger@2.1-impl \ + audio.a2dp.default \ + audio.usb.default \ + audio.primary.universal7870_32 \ + audio.r_submix.default \ + libtinycompress + +# Audio configuration +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/audio/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \ + $(LOCAL_PATH)/configs/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \ + $(LOCAL_PATH)/configs/audio/audio_effects.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.xml \ + $(LOCAL_PATH)/configs/audio/mixer_gains.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_gains.xml \ + $(LOCAL_PATH)/configs/audio/mixer_paths_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_0.xml \ + frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml + +# Camera +PRODUCT_PACKAGES += \ + android.hardware.camera.provider@2.4-impl \ + android.hardware.camera.provider@2.4-service \ + libion_exynos \ + Snap + +# Camera configurations +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/camera/external_camera_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/external_camera_config.xml + +# Cas +PRODUCT_PACKAGES += \ + android.hardware.cas@1.1-service + +# Configstore +PRODUCT_PACKAGES += \ + android.hardware.configstore@1.1-service + +# Display +PRODUCT_PACKAGES += \ + android.hardware.graphics.allocator@2.0-impl \ + android.hardware.graphics.allocator@2.0-service \ + android.hardware.graphics.composer@2.1-impl \ + android.hardware.graphics.composer@2.1-service \ + android.hardware.graphics.mapper@2.0-impl \ + android.hardware.memtrack@1.0-impl \ + android.hardware.memtrack@1.0-service \ + android.hardware.renderscript@1.0-impl \ + gralloc.default \ + gralloc.exynos5 \ + hwcomposer.exynos5 \ + memtrack.exynos5 \ + libhwc2on1adapter \ + libtinyxml + +# DRM +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0 \ + android.hardware.drm@1.1 \ + libfwdlockengine \ + libdrmclearkeyplugin \ + android.hardware.drm@1.0-service \ + android.hardware.drm@1.1-service.clearkey \ + android.hardware.drm@1.0-impl + +# Ebtables +PRODUCT_PACKAGES += \ + ebtables \ + ethertypes \ + libebtc + +# Flat device tree for boot image +PRODUCT_HOST_PACKAGES += \ + dtbhtoolExynos + +# Gatekeeper +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-impl + +# Healthd +PRODUCT_PACKAGES += \ + android.hardware.health@2.0-impl \ + android.hardware.health@2.0-service \ + chargeonlymode + +# HIDL +PRODUCT_PACKAGES += \ + android.hidl.base@1.0 \ + android.hidl.base@1.0_system \ + android.hidl.manager@1.0 \ + android.hidl.manager@1.0_system + +# Keylayout +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/keylayout/gpio-keys.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/gpio-keys.kl \ + $(LOCAL_PATH)/configs/keylayout/sec_touchkey.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sec_touchkey.kl \ + $(LOCAL_PATH)/configs/keylayout/sec_touchscreen.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sec_touchscreen.kl + +# Keymaster +PRODUCT_PACKAGES += \ + android.hardware.keymaster@3.0-impl \ + android.hardware.keymaster@3.0-service + +# Lights +PRODUCT_PACKAGES += \ + android.hardware.light@2.0-service.samsung + +# LiveDisplay +PRODUCT_PACKAGES += \ + vendor.lineage.livedisplay@2.0-service.samsung-exynos + +# IPv6 +PRODUCT_PACKAGES += \ + ebtables \ + ethertypes \ + libebtc + +# Media +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ + $(LOCAL_PATH)/configs/media/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \ + $(LOCAL_PATH)/configs/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video_le.xml + +# Net +PRODUCT_PACKAGES += \ + android.system.net.netd@1.0 \ + libandroid_net \ + netutils-wrapper-1.0 + +# Offmode charger +PRODUCT_PACKAGES += \ + charger_res_images + +# Overlays +DEVICE_PACKAGE_OVERLAYS += \ + $(LOCAL_PATH)/overlay + +# Power +PRODUCT_PACKAGES += \ + android.hardware.power@1.0-impl \ + android.hardware.power@1.0-service \ + power.universal7870 + +# Radio +PRODUCT_PACKAGES += \ + android.hardware.radio@1.4 \ + android.hardware.radio.config@1.1 \ + android.hardware.radio.deprecated@1.0 \ + libxml2 \ + libprotobuf-cpp-full \ + rild \ + libril \ + libsecril-client \ + libsecril-client-sap \ + libreference-ril + +# Ramdisk +PRODUCT_PACKAGES += \ + fstab.samsungexynos7870 \ + init.baseband.rc \ + init.rilchip.rc \ + init.rilcommon.rc \ + init.samsung.rc \ + init.samsungexynos7870.rc \ + init.samsungexynos7870.usb.rc \ + init.wifi.rc \ + init.wifi_device.rc \ + ueventd.samsungexynos7870.rc + +# Samsung Doze +PRODUCT_PACKAGES += \ + SamsungDoze + +# Seccomp_policy +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/seccomp/mediacodec-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \ + $(LOCAL_PATH)/seccomp/mediaextractor-seccomp.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaextractor.policy + +# Sensors +PRODUCT_PACKAGES += \ + android.hardware.sensors@1.0-impl + +# TextClassifier +PRODUCT_PACKAGES += \ + textclassifier.bundle1 + +# Touchscreen +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/idc/AVRCP.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/AVRCP.idc \ + $(LOCAL_PATH)/configs/idc/qwerty.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/qwerty.idc \ + $(LOCAL_PATH)/configs/idc/qwerty2.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/qwerty2.idc + +# Thermal +PRODUCT_PACKAGES += \ + android.hardware.thermal@1.0-impl \ + android.hardware.thermal@1.0-service + +# Touch features +PRODUCT_PACKAGES += \ + vendor.lineage.touch@1.0-service.samsung + +# Trust HAL +PRODUCT_PACKAGES += \ + vendor.lineage.trust@1.0-service + +# Shims +PRODUCT_PACKAGES += \ + libexynoscamera_shim + # libstagefright_shim + +# USB +PRODUCT_PACKAGES += \ + android.hardware.usb@1.0-service.basic + +# Vibrator +PRODUCT_PACKAGES += \ + android.hardware.vibrator@1.0-impl \ + android.hardware.vibrator@1.0-service + +# Vendor security patch level +PRODUCT_PROPERTY_OVERRIDES += \ + ro.build.vendor_security_patch=2019-11-01 + +# VNDK +PRODUCT_PACKAGES += \ + libgui_vendor + +# WiFi Display +PRODUCT_PACKAGES += \ + libnl + +# Properties +-include $(LOCAL_PATH)/vendor_prop.mk + +# call the proprietary setup +$(call inherit-product, vendor/samsung/universal7870-common/universal7870-common-vendor.mk) diff --git a/extract-files.sh b/extract-files.sh new file mode 100644 index 0000000..a308c53 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# +# Copyright (C) 2017-2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e + +VENDOR=samsung +DEVICE_COMMON=universal7870-common + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}"/../../.. + +HELPER="${AOSP_ROOT}/vendor/aosp/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +SECTION= +KANG= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +# Initialize the helper +setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${AOSP_ROOT}" true "${CLEAN_VENDOR}" + +extract "$MY_DIR"/proprietary-files.txt "$SRC" + +"${MY_DIR}/setup-makefiles.sh" diff --git a/hidl/Android.mk b/hidl/Android.mk new file mode 100644 index 0000000..d24c802 --- /dev/null +++ b/hidl/Android.mk @@ -0,0 +1,47 @@ +# +# Copyright (C) 2017 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := libhidltransport +LOCAL_MODULE := android.hidl.base@1.0 +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_VENDOR_MODULE := true +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := libhidltransport +LOCAL_MODULE := android.hidl.manager@1.0 +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_VENDOR_MODULE := true +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := libhidltransport +LOCAL_MODULE := android.hidl.base@1.0_system +LOCAL_INSTALLED_MODULE_STEM := android.hidl.base@1.0.so +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +include $(BUILD_SHARED_LIBRARY) + +include $(CLEAR_VARS) +LOCAL_SHARED_LIBRARIES := libhidltransport +LOCAL_MODULE := android.hidl.manager@1.0_system +LOCAL_INSTALLED_MODULE_STEM := android.hidl.manager@1.0.so +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +include $(BUILD_SHARED_LIBRARY) + diff --git a/include/hardware/audio_amplifier.h b/include/hardware/audio_amplifier.h new file mode 100644 index 0000000..26e58a1 --- /dev/null +++ b/include/hardware/audio_amplifier.h @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2015, The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CM_AUDIO_AMPLIFIER_INTERFACE_H +#define CM_AUDIO_AMPLIFIER_INTERFACE_H + +#include +#include +#include + +#include +#include + +#include + +__BEGIN_DECLS + +#define AMPLIFIER_HARDWARE_MODULE_ID "audio_amplifier" + +#define AMPLIFIER_HARDWARE_INTERFACE "audio_amplifier_hw_if" + +#define AMPLIFIER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) + +#define AMPLIFIER_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define AMPLIFIER_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) +#define AMPLIFIER_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) +#define AMPLIFIER_DEVICE_API_VERSION_CURRENT AMPLIFIER_DEVICE_API_VERSION_2_1 + +struct str_parms; + +typedef struct amplifier_device { + /** + * Common methods of the amplifier device. This *must* be the first member + * of amplifier_device as users of this structure will cast a hw_device_t + * to amplifier_device pointer in contexts where it's known + * the hw_device_t references a amplifier_device. + */ + struct hw_device_t common; + + /** + * Notify amplifier device of current input devices + * + * This function should handle only input devices. + */ + int (*set_input_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of current output devices + * + * This function should handle only output devices. + */ + int (*set_output_devices)(struct amplifier_device *device, uint32_t devices); + + /** + * Notify amplifier device of output device enable/disable + * + * This function should handle only output devices. + */ + int (*enable_output_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device of input device enable/disable + * + * This function should handle only input devices. + */ + int (*enable_input_devices)(struct amplifier_device *device, + uint32_t devices, bool enable); + + /** + * Notify amplifier device about current audio mode + */ + int (*set_mode)(struct amplifier_device *device, audio_mode_t mode); + + /** + * Notify amplifier device that an output stream has started + */ + int (*output_stream_start)(struct amplifier_device *device, + struct audio_stream_out *stream, bool offload); + + /** + * Notify amplifier device that an input stream has started + */ + int (*input_stream_start)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * Notify amplifier device that an output stream has stopped + */ + int (*output_stream_standby)(struct amplifier_device *device, + struct audio_stream_out *stream); + + /** + * Notify amplifier device that an input stream has stopped + */ + int (*input_stream_standby)(struct amplifier_device *device, + struct audio_stream_in *stream); + + /** + * set/get audio device parameters. + */ + int (*set_parameters)(struct amplifier_device *device, + struct str_parms *parms); + + /** + * set/get output stream parameters. + */ + int (*out_set_parameters)(struct amplifier_device *device, + struct str_parms *parms); + + /** + * set/get input stream parameters. + */ + int (*in_set_parameters)(struct amplifier_device *device, + struct str_parms *parms); +} amplifier_device_t; + +typedef struct amplifier_module { + /** + * Common methods of the amplifier module. This *must* be the first member + * of amplifier_module as users of this structure will cast a hw_module_t + * to amplifier_module pointer in contexts where it's known + * the hw_module_t references a amplifier_module. + */ + struct hw_module_t common; +} amplifier_module_t; + +/** convenience API for opening and closing a supported device */ + +static inline int amplifier_device_open(const struct hw_module_t *module, + struct amplifier_device **device) +{ + return module->methods->open(module, AMPLIFIER_HARDWARE_INTERFACE, + (struct hw_device_t **) device); +} + +static inline int amplifier_device_close(struct amplifier_device *device) +{ + return device->common.close(&device->common); +} + +__END_DECLS + +#endif // CM_AUDIO_AMPLIFIER_INTERFACE_H diff --git a/include/hardware/gnss-base.h b/include/hardware/gnss-base.h new file mode 100644 index 0000000..e56020d --- /dev/null +++ b/include/hardware/gnss-base.h @@ -0,0 +1,275 @@ +// This file is autogenerated by hidl-gen. Do not edit manually. +// Source: android.hardware.gnss@1.0 +// Root: android.hardware:hardware/interfaces + +#ifndef HIDL_GENERATED_ANDROID_HARDWARE_GNSS_V1_0_EXPORTED_CONSTANTS_H_ +#define HIDL_GENERATED_ANDROID_HARDWARE_GNSS_V1_0_EXPORTED_CONSTANTS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + GNSS_MAX_SVS_COUNT = 64u, // 64 +}; + +enum { + GNSS_CONSTELLATION_UNKNOWN = 0, + GNSS_CONSTELLATION_GPS = 1, + GNSS_CONSTELLATION_SBAS = 2, + GNSS_CONSTELLATION_GLONASS = 3, + GNSS_CONSTELLATION_QZSS = 4, + GNSS_CONSTELLATION_BEIDOU = 5, + GNSS_CONSTELLATION_GALILEO = 6, +}; + +enum { + GPS_LOCATION_HAS_LAT_LONG = 1, // 0x0001 + GPS_LOCATION_HAS_ALTITUDE = 2, // 0x0002 + GPS_LOCATION_HAS_SPEED = 4, // 0x0004 + GPS_LOCATION_HAS_BEARING = 8, // 0x0008 + GPS_LOCATION_HAS_HORIZONTAL_ACCURACY = 16, // 0x0010 + GPS_LOCATION_HAS_VERTICAL_ACCURACY = 32, // 0x0020 + GPS_LOCATION_HAS_SPEED_ACCURACY = 64, // 0x0040 + GPS_LOCATION_HAS_BEARING_ACCURACY = 128, // 0x0080 +}; + +enum { + APN_IP_INVALID = 0, + APN_IP_IPV4 = 1, + APN_IP_IPV6 = 2, + APN_IP_IPV4V6 = 3, +}; + +enum { + AGPS_TYPE_SUPL = 1, + AGPS_TYPE_C2K = 2, +}; + +enum { + GNSS_REQUEST_AGNSS_DATA_CONN = 1, + GNSS_RELEASE_AGNSS_DATA_CONN = 2, + GNSS_AGNSS_DATA_CONNECTED = 3, + GNSS_AGNSS_DATA_CONN_DONE = 4, + GNSS_AGNSS_DATA_CONN_FAILED = 5, +}; + +enum { + AGPS_SETID_TYPE_NONE = 0, + AGPS_SETID_TYPE_IMSI = 1, + AGPS_SETID_TYPE_MSISDM = 2, +}; + +enum { + AGPS_RIL_NETWORK_TYPE_MOBILE = 0, + AGPS_RIL_NETWORK_TYPE_WIFI = 1, + AGPS_RIL_NETWORK_TYPE_MMS = 2, + AGPS_RIL_NETWORK_TYPE_SUPL = 3, + AGPS_RIL_NETWORK_TYPE_DUN = 4, + AGPS_RIL_NETWORK_TYPE_HIPRI = 5, + AGPS_RIL_NETWORK_TYPE_WIMAX = 6, +}; + +enum { + AGPS_REF_LOCATION_TYPE_GSM_CELLID = 1, + AGPS_REF_LOCATION_TYPE_UMTS_CELLID = 2, + AGPS_REF_LOCATION_TYPE_LTE_CELLID = 4, +}; + +enum { + AGPS_RIL_REQUEST_SETID_IMSI = 1u, // (1 << 0L) + AGPS_RIL_REQUEST_SETID_MSISDN = 2u, // (1 << 1L) +}; + +enum { + GPS_POSITION_MODE_STANDALONE = 0, + GPS_POSITION_MODE_MS_BASED = 1, + GPS_POSITION_MODE_MS_ASSISTED = 2, +}; + +enum { + GPS_POSITION_RECURRENCE_PERIODIC = 0u, // 0 + GPS_POSITION_RECURRENCE_SINGLE = 1u, // 1 +}; + +enum { + GPS_DELETE_EPHEMERIS = 1, // 0x0001 + GPS_DELETE_ALMANAC = 2, // 0x0002 + GPS_DELETE_POSITION = 4, // 0x0004 + GPS_DELETE_TIME = 8, // 0x0008 + GPS_DELETE_IONO = 16, // 0x0010 + GPS_DELETE_UTC = 32, // 0x0020 + GPS_DELETE_HEALTH = 64, // 0x0040 + GPS_DELETE_SVDIR = 128, // 0x0080 + GPS_DELETE_SVSTEER = 256, // 0x0100 + GPS_DELETE_SADATA = 512, // 0x0200 + GPS_DELETE_RTI = 1024, // 0x0400 + GPS_DELETE_CELLDB_INFO = 32768, // 0x8000 + GPS_DELETE_ALL = 65535, // 0xFFFF +}; + +enum { + FLP_BATCH_WAKEUP_ON_FIFO_FULL = 1, // 0x01 +}; + +enum { + GPS_CAPABILITY_SCHEDULING = 1u, // (1 << 0) + GPS_CAPABILITY_MSB = 2u, // (1 << 1) + GPS_CAPABILITY_MSA = 4u, // (1 << 2) + GPS_CAPABILITY_SINGLE_SHOT = 8u, // (1 << 3) + GPS_CAPABILITY_ON_DEMAND_TIME = 16u, // (1 << 4) + GPS_CAPABILITY_GEOFENCING = 32u, // (1 << 5) + GPS_CAPABILITY_MEASUREMENTS = 64u, // (1 << 6) + GPS_CAPABILITY_NAV_MESSAGES = 128u, // (1 << 7) +}; + +enum { + GPS_STATUS_NONE = 0, + GPS_STATUS_SESSION_BEGIN = 1, + GPS_STATUS_SESSION_END = 2, + GPS_STATUS_ENGINE_ON = 3, + GPS_STATUS_ENGINE_OFF = 4, +}; + +enum { + GNSS_SV_FLAGS_NONE = 0, + GNSS_SV_FLAGS_HAS_EPHEMERIS_DATA = 1, // (1 << 0) + GNSS_SV_FLAGS_HAS_ALMANAC_DATA = 2, // (1 << 1) + GNSS_SV_FLAGS_USED_IN_FIX = 4, // (1 << 2) + GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY = 8, // (1 << 3) +}; + +enum { + GPS_GEOFENCE_ENTERED = 1, // (1 << 0L) + GPS_GEOFENCE_EXITED = 2, // (1 << 1L) + GPS_GEOFENCE_UNCERTAIN = 4, // (1 << 2L) +}; + +enum { + GPS_GEOFENCE_UNAVAILABLE = 1, // (1 << 0L) + GPS_GEOFENCE_AVAILABLE = 2, // (1 << 1L) +}; + +enum { + GPS_GEOFENCE_OPERATION_SUCCESS = 0, + GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES = -100, // (-100) + GPS_GEOFENCE_ERROR_ID_EXISTS = -101, // (-101) + GPS_GEOFENCE_ERROR_ID_UNKNOWN = -102, // (-102) + GPS_GEOFENCE_ERROR_INVALID_TRANSITION = -103, // (-103) + GPS_GEOFENCE_ERROR_GENERIC = -149, // (-149) +}; + +enum { + GPS_MEASUREMENT_SUCCESS = 0, + GPS_MEASUREMENT_ERROR_ALREADY_INIT = -100, // (-100) + GPS_MEASUREMENT_ERROR_GENERIC = -101, // (-101) +}; + +enum { + GNSS_CLOCK_HAS_LEAP_SECOND = 1, // (1 << 0) + GNSS_CLOCK_HAS_TIME_UNCERTAINTY = 2, // (1 << 1) + GNSS_CLOCK_HAS_FULL_BIAS = 4, // (1 << 2) + GNSS_CLOCK_HAS_BIAS = 8, // (1 << 3) + GNSS_CLOCK_HAS_BIAS_UNCERTAINTY = 16, // (1 << 4) + GNSS_CLOCK_HAS_DRIFT = 32, // (1 << 5) + GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY = 64, // (1 << 6) +}; + +enum { + GNSS_MEASUREMENT_HAS_SNR = 1u, // (1 << 0) + GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY = 512u, // (1 << 9) + GNSS_MEASUREMENT_HAS_CARRIER_CYCLES = 1024u, // (1 << 10) + GNSS_MEASUREMENT_HAS_CARRIER_PHASE = 2048u, // (1 << 11) + GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY = 4096u, // (1 << 12) + GNSS_MEASUREMENT_HAS_AUTOMATIC_GAIN_CONTROL = 8192u, // (1 << 13) +}; + +enum { + GNSS_MULTIPATH_INDICATOR_UNKNOWN = 0, + GNSS_MULTIPATH_INDICATOR_PRESENT = 1, + GNSS_MULTIPATH_INDICATIOR_NOT_PRESENT = 2, +}; + +enum { + GNSS_MEASUREMENT_STATE_UNKNOWN = 0u, // 0 + GNSS_MEASUREMENT_STATE_CODE_LOCK = 1u, // (1 << 0) + GNSS_MEASUREMENT_STATE_BIT_SYNC = 2u, // (1 << 1) + GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC = 4u, // (1 << 2) + GNSS_MEASUREMENT_STATE_TOW_DECODED = 8u, // (1 << 3) + GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS = 16u, // (1 << 4) + GNSS_MEASUREMENT_STATE_SYMBOL_SYNC = 32u, // (1 << 5) + GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC = 64u, // (1 << 6) + GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED = 128u, // (1 << 7) + GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC = 256u, // (1 << 8) + GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC = 512u, // (1 << 9) + GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK = 1024u, // (1 << 10) + GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK = 2048u, // (1 << 11) + GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC = 4096u, // (1 << 12) + GNSS_MEASUREMENT_STATE_SBAS_SYNC = 8192u, // (1 << 13) + GNSS_MEASUREMENT_STATE_TOW_KNOWN = 16384u, // (1 << 14) + GNSS_MEASUREMENT_STATE_GLO_TOD_KNOWN = 32768u, // (1 << 15) +}; + +enum { + GNSS_ADR_STATE_UNKNOWN = 0, + GNSS_ADR_STATE_VALID = 1, // (1 << 0) + GNSS_ADR_STATE_RESET = 2, // (1 << 1) + GNSS_ADR_STATE_CYCLE_SLIP = 4, // (1 << 2) +}; + +enum { + GPS_NAVIGATION_MESSAGE_SUCCESS = 0, + GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT = -100, // (-100) + GPS_NAVIGATION_MESSAGE_ERROR_GENERIC = -101, // (-101) +}; + +enum { + GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN = 0, + GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L1CA = 257, // 0x0101 + GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L2CNAV = 258, // 0x0102 + GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L5CNAV = 259, // 0x0103 + GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_CNAV2 = 260, // 0x0104 + GNSS_NAVIGATION_MESSAGE_TYPE_GLO_L1CA = 769, // 0x0301 + GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D1 = 1281, // 0x0501 + GNSS_NAVIGATION_MESSAGE_TYPE_BDS_D2 = 1282, // 0x0502 + GNSS_NAVIGATION_MESSAGE_TYPE_GAL_I = 1537, // 0x0601 + GNSS_NAVIGATION_MESSAGE_TYPE_GAL_F = 1538, // 0x0602 +}; + +typedef enum { + NAV_MESSAGE_STATUS_PARITY_PASSED = 1, // (1 << 0) + NAV_MESSAGE_STATUS_PARITY_REBUILT = 2, // (1 << 1) + NAV_MESSAGE_STATUS_UNKNOWN = 0, +} navigation_message_status; + +enum { + GPS_NI_TYPE_VOICE = 1, + GPS_NI_TYPE_UMTS_SUPL = 2, + GPS_NI_TYPE_UMTS_CTRL_PLANE = 3, +}; + +enum { + GPS_NI_NEED_NOTIFY = 1u, // 0x0001 + GPS_NI_NEED_VERIFY = 2u, // 0x0002 + GPS_NI_PRIVACY_OVERRIDE = 4u, // 0x0004 +}; + +enum { + GPS_NI_RESPONSE_ACCEPT = 1, + GPS_NI_RESPONSE_DENY = 2, + GPS_NI_RESPONSE_NORESP = 3, +}; + +enum { + GPS_ENC_NONE = 0, + GPS_ENC_SUPL_GSM_DEFAULT = 1, + GPS_ENC_SUPL_UTF8 = 2, + GPS_ENC_SUPL_UCS2 = 3, + GPS_ENC_UNKNOWN = -1, // (-1) +}; + +#ifdef __cplusplus +} +#endif + +#endif // HIDL_GENERATED_ANDROID_HARDWARE_GNSS_V1_0_EXPORTED_CONSTANTS_H_ diff --git a/include/hardware/gps.h b/include/hardware/gps.h new file mode 100644 index 0000000..49ca308 --- /dev/null +++ b/include/hardware/gps.h @@ -0,0 +1,2006 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_HARDWARE_GPS_H +#define ANDROID_INCLUDE_HARDWARE_GPS_H + +#include +#include +#include +#include +#include +#include + +#include + +#include "gnss-base.h" + +__BEGIN_DECLS + +/* + * Enums defined in HIDL in hardware/interfaces are auto-generated and present + * in gnss-base.h. + */ + +/* for compatibility */ + +/** Maximum number of SVs for gps_sv_status_callback(). */ +#define GNSS_MAX_SVS GNSS_MAX_SVS_COUNT +/** Maximum number of Measurements in gnss_measurement_callback(). */ +#define GNSS_MAX_MEASUREMENT GNSS_MAX_SVS_COUNT + +#define GPS_REQUEST_AGPS_DATA_CONN GNSS_REQUEST_AGNSS_DATA_CONN +#define GPS_RELEASE_AGPS_DATA_CONN GNSS_RELEASE_AGNSS_DATA_CONN +#define GPS_AGPS_DATA_CONNECTED GNSS_AGNSS_DATA_CONNECTED +#define GPS_AGPS_DATA_CONN_DONE GNSS_AGNSS_DATA_CONN_DONE +#define GPS_AGPS_DATA_CONN_FAILED GNSS_AGNSS_DATA_CONN_FAILED +#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS AGPS_RIL_NETWORK_TYPE_MMS +#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL AGPS_RIL_NETWORK_TYPE_SUPL +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN AGPS_RIL_NETWORK_TYPE_DUN +#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI AGPS_RIL_NETWORK_TYPE_HIPRI +#define AGPS_RIL_NETWORK_TTYPE_WIMAX AGPS_RIL_NETWORK_TYPE_WIMAX +#define GNSS_MULTIPATH_INDICATOR_NOT_PRESENT GNSS_MULTIPATH_INDICATIOR_NOT_PRESENT +#define AGPS_SETID_TYPE_MSISDN AGPS_SETID_TYPE_MSISDM +#define GPS_MEASUREMENT_OPERATION_SUCCESS GPS_MEASUREMENT_SUCCESS +#define GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS GPS_NAVIGATION_MESSAGE_SUCCESS +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L1CA GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L1CA +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L2CNAV GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L2CNAV +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_L5CNAV GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_L5CNAV +#define GNSS_NAVIGATION_MESSAGE_TYPE_GPS_CNAV2 GNSS_NAVIGATION_MESSAGE_TYPE_GNSS_CNAV2 +#define GPS_LOCATION_HAS_ACCURACY GPS_LOCATION_HAS_HORIZONTAL_ACCURACY + +/** + * The id of this module + */ +#define GPS_HARDWARE_MODULE_ID "gps" + + +/** Milliseconds since January 1, 1970 */ +typedef int64_t GpsUtcTime; + +/** Maximum number of SVs for gps_sv_status_callback(). */ +#define GPS_MAX_SVS 32 + +/** Maximum number of Measurements in gps_measurement_callback(). */ +#define GPS_MAX_MEASUREMENT 32 + +/** Requested operational mode for GPS operation. */ +typedef uint32_t GpsPositionMode; + +/** Requested recurrence mode for GPS operation. */ +typedef uint32_t GpsPositionRecurrence; + +/** GPS status event values. */ +typedef uint16_t GpsStatusValue; + +/** Flags to indicate which values are valid in a GpsLocation. */ +typedef uint16_t GpsLocationFlags; + +/** + * Flags used to specify which aiding data to delete when calling + * delete_aiding_data(). + */ +typedef uint16_t GpsAidingData; + +/** AGPS type */ +typedef uint16_t AGpsType; + +typedef uint16_t AGpsSetIDType; + +typedef uint16_t ApnIpType; + +/** + * String length constants + */ +#define GPS_NI_SHORT_STRING_MAXLEN 256 +#define GPS_NI_LONG_STRING_MAXLEN 2048 + +/** + * GpsNiType constants + */ +typedef uint32_t GpsNiType; + +/** + * GpsNiNotifyFlags constants + */ +typedef uint32_t GpsNiNotifyFlags; + +/** + * GPS NI responses, used to define the response in + * NI structures + */ +typedef int GpsUserResponseType; + +/** + * NI data encoding scheme + */ +typedef int GpsNiEncodingType; + +/** AGPS status event values. */ +typedef uint16_t AGpsStatusValue; + +typedef uint16_t AGpsRefLocationType; + +/* Deprecated, to be removed in the next Android release. */ +#define AGPS_REG_LOCATION_TYPE_MAC 3 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t GpsClockFlags; +#define GPS_CLOCK_HAS_LEAP_SECOND (1<<0) +#define GPS_CLOCK_HAS_TIME_UNCERTAINTY (1<<1) +#define GPS_CLOCK_HAS_FULL_BIAS (1<<2) +#define GPS_CLOCK_HAS_BIAS (1<<3) +#define GPS_CLOCK_HAS_BIAS_UNCERTAINTY (1<<4) +#define GPS_CLOCK_HAS_DRIFT (1<<5) +#define GPS_CLOCK_HAS_DRIFT_UNCERTAINTY (1<<6) + +/** + * Flags to indicate what fields in GnssClock are valid. + */ +typedef uint16_t GnssClockFlags; + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t GpsClockType; +#define GPS_CLOCK_TYPE_UNKNOWN 0 +#define GPS_CLOCK_TYPE_LOCAL_HW_TIME 1 +#define GPS_CLOCK_TYPE_GPS_TIME 2 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint32_t GpsMeasurementFlags; +#define GPS_MEASUREMENT_HAS_SNR (1<<0) +#define GPS_MEASUREMENT_HAS_ELEVATION (1<<1) +#define GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY (1<<2) +#define GPS_MEASUREMENT_HAS_AZIMUTH (1<<3) +#define GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY (1<<4) +#define GPS_MEASUREMENT_HAS_PSEUDORANGE (1<<5) +#define GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY (1<<6) +#define GPS_MEASUREMENT_HAS_CODE_PHASE (1<<7) +#define GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY (1<<8) +#define GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY (1<<9) +#define GPS_MEASUREMENT_HAS_CARRIER_CYCLES (1<<10) +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE (1<<11) +#define GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY (1<<12) +#define GPS_MEASUREMENT_HAS_BIT_NUMBER (1<<13) +#define GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT (1<<14) +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT (1<<15) +#define GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY (1<<16) +#define GPS_MEASUREMENT_HAS_USED_IN_FIX (1<<17) +#define GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE (1<<18) + +/** + * Flags to indicate what fields in GnssMeasurement are valid. + */ +typedef uint32_t GnssMeasurementFlags; + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t GpsLossOfLock; +#define GPS_LOSS_OF_LOCK_UNKNOWN 0 +#define GPS_LOSS_OF_LOCK_OK 1 +#define GPS_LOSS_OF_LOCK_CYCLE_SLIP 2 + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. Use GnssMultipathIndicator instead. + */ +typedef uint8_t GpsMultipathIndicator; +#define GPS_MULTIPATH_INDICATOR_UNKNOWN 0 +#define GPS_MULTIPATH_INDICATOR_DETECTED 1 +#define GPS_MULTIPATH_INDICATOR_NOT_USED 2 + +/** + * Enumeration of available values for the GNSS Measurement's multipath + * indicator. + */ +typedef uint8_t GnssMultipathIndicator; + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t GpsMeasurementState; +#define GPS_MEASUREMENT_STATE_UNKNOWN 0 +#define GPS_MEASUREMENT_STATE_CODE_LOCK (1<<0) +#define GPS_MEASUREMENT_STATE_BIT_SYNC (1<<1) +#define GPS_MEASUREMENT_STATE_SUBFRAME_SYNC (1<<2) +#define GPS_MEASUREMENT_STATE_TOW_DECODED (1<<3) +#define GPS_MEASUREMENT_STATE_MSEC_AMBIGUOUS (1<<4) + +/** + * Flags indicating the GNSS measurement state. + * + * The expected behavior here is for GPS HAL to set all the flags that applies. + * For example, if the state for a satellite is only C/A code locked and bit + * synchronized, and there is still millisecond ambiguity, the state should be + * set as: + * + * GNSS_MEASUREMENT_STATE_CODE_LOCK | GNSS_MEASUREMENT_STATE_BIT_SYNC | + * GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS + * + * If GNSS is still searching for a satellite, the corresponding state should be + * set to GNSS_MEASUREMENT_STATE_UNKNOWN(0). + */ +typedef uint32_t GnssMeasurementState; + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint16_t GpsAccumulatedDeltaRangeState; +#define GPS_ADR_STATE_UNKNOWN 0 +#define GPS_ADR_STATE_VALID (1<<0) +#define GPS_ADR_STATE_RESET (1<<1) +#define GPS_ADR_STATE_CYCLE_SLIP (1<<2) + +/** + * Flags indicating the Accumulated Delta Range's states. + */ +typedef uint16_t GnssAccumulatedDeltaRangeState; + +/* The following typedef together with its constants below are deprecated, and + * will be removed in the next release. */ +typedef uint8_t GpsNavigationMessageType; +#define GPS_NAVIGATION_MESSAGE_TYPE_UNKNOWN 0 +#define GPS_NAVIGATION_MESSAGE_TYPE_L1CA 1 +#define GPS_NAVIGATION_MESSAGE_TYPE_L2CNAV 2 +#define GPS_NAVIGATION_MESSAGE_TYPE_L5CNAV 3 +#define GPS_NAVIGATION_MESSAGE_TYPE_CNAV2 4 + +/** + * Enumeration of available values to indicate the GNSS Navigation message + * types. + * + * For convenience, first byte is the GnssConstellationType on which that signal + * is typically transmitted + */ +typedef int16_t GnssNavigationMessageType; + +/** + * Status of Navigation Message + * When a message is received properly without any parity error in its navigation words, the + * status should be set to NAV_MESSAGE_STATUS_PARITY_PASSED. But if a message is received + * with words that failed parity check, but GPS is able to correct those words, the status + * should be set to NAV_MESSAGE_STATUS_PARITY_REBUILT. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ +typedef uint16_t NavigationMessageStatus; + +/* This constant is deprecated, and will be removed in the next release. */ +#define NAV_MESSAGE_STATUS_UNKONW 0 + +/** + * Flags that indicate information about the satellite + */ +typedef uint8_t GnssSvFlags; + +/** + * Constellation type of GnssSvInfo + */ +typedef uint8_t GnssConstellationType; + +/** + * Name for the GPS XTRA interface. + */ +#define GPS_XTRA_INTERFACE "gps-xtra" + +/** + * Name for the GPS DEBUG interface. + */ +#define GPS_DEBUG_INTERFACE "gps-debug" + +/** + * Name for the AGPS interface. + */ +#define AGPS_INTERFACE "agps" + +/** + * Name of the Supl Certificate interface. + */ +#define SUPL_CERTIFICATE_INTERFACE "supl-certificate" + +/** + * Name for NI interface + */ +#define GPS_NI_INTERFACE "gps-ni" + +/** + * Name for the AGPS-RIL interface. + */ +#define AGPS_RIL_INTERFACE "agps_ril" + +/** + * Name for the GPS_Geofencing interface. + */ +#define GPS_GEOFENCING_INTERFACE "gps_geofencing" + +/** + * Name of the GPS Measurements interface. + */ +#define GPS_MEASUREMENT_INTERFACE "gps_measurement" + +/** + * Name of the GPS navigation message interface. + */ +#define GPS_NAVIGATION_MESSAGE_INTERFACE "gps_navigation_message" + +/** + * Name of the GNSS/GPS configuration interface. + */ +#define GNSS_CONFIGURATION_INTERFACE "gnss_configuration" + +/** Represents a location. */ +typedef struct { + /** set to sizeof(GpsLocation) */ + size_t size; + /** Contains GpsLocationFlags bits. */ + uint16_t flags; + /** Represents latitude in degrees. */ + double latitude; + /** Represents longitude in degrees. */ + double longitude; + /** + * Represents altitude in meters above the WGS 84 reference ellipsoid. + */ + double altitude; + /** Represents speed in meters per second. */ + float speed; + /** Represents heading in degrees. */ + float bearing; + /** Represents expected accuracy in meters. */ + float accuracy; + /** Timestamp for the location fix. */ + GpsUtcTime timestamp; +} GpsLocation; + +/** Represents the status. */ +typedef struct { + /** set to sizeof(GpsStatus) */ + size_t size; + GpsStatusValue status; +} GpsStatus; + +/** + * Legacy struct to represents SV information. + * Deprecated, to be removed in the next Android release. + * Use GnssSvInfo instead. + */ +typedef struct { + /** set to sizeof(GpsSvInfo) */ + size_t size; + /** Pseudo-random number for the SV. */ + int prn; + /** Signal to noise ratio. */ + float snr; + /** Elevation of SV in degrees. */ + float elevation; + /** Azimuth of SV in degrees. */ + float azimuth; + /** SAMSUNG */ + uint64_t samsung; +} GpsSvInfo; + +typedef struct { + /** set to sizeof(GnssSvInfo) */ + size_t size; + + /** + * Pseudo-random number for the SV, or FCN/OSN number for Glonass. The + * distinction is made by looking at constellation field. Values should be + * in the range of: + * + * - GPS: 1-32 + * - SBAS: 120-151, 183-192 + * - GLONASS: 1-24, the orbital slot number (OSN), if known. Or, if not: + * 93-106, the frequency channel number (FCN) (-7 to +6) offset by + 100 + * i.e. report an FCN of -7 as 93, FCN of 0 as 100, and FCN of +6 as 106. + * - QZSS: 193-200 + * - Galileo: 1-36 + * - Beidou: 1-37 + */ + int16_t svid; + + /** + * Defines the constellation of the given SV. Value should be one of those + * GNSS_CONSTELLATION_* constants + */ + GnssConstellationType constellation; + + /** + * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna port. + * + * This is a mandatory value. + */ + float c_n0_dbhz; + + /** Elevation of SV in degrees. */ + float elevation; + + /** Azimuth of SV in degrees. */ + float azimuth; + + /** + * Contains additional data about the given SV. Value should be one of those + * GNSS_SV_FLAGS_* constants + */ + GnssSvFlags flags; + +} GnssSvInfo; + +/** + * Legacy struct to represents SV status. + * Deprecated, to be removed in the next Android release. + * Use GnssSvStatus instead. + */ +typedef struct { + /** set to sizeof(GpsSvStatus) */ + size_t size; + int num_svs; + GpsSvInfo sv_list[GPS_MAX_SVS]; + uint32_t ephemeris_mask; + uint32_t almanac_mask; + uint32_t used_in_fix_mask; +} GpsSvStatus; + +/** + * Represents SV status. + */ +typedef struct { + /** set to sizeof(GnssSvStatus) */ + size_t size; + + /** Number of GPS SVs currently visible, refers to the SVs stored in sv_list */ + int num_svs; + /** + * Pointer to an array of SVs information for all GNSS constellations, + * except GPS, which is reported using sv_list + */ + GnssSvInfo gnss_sv_list[GNSS_MAX_SVS]; + +} GnssSvStatus; + +/* CellID for 2G, 3G and LTE, used in AGPS. */ +typedef struct { + AGpsRefLocationType type; + /** Mobile Country Code. */ + uint16_t mcc; + /** Mobile Network Code .*/ + uint16_t mnc; + /** Location Area Code in 2G, 3G and LTE. In 3G lac is discarded. In LTE, + * lac is populated with tac, to ensure that we don't break old clients that + * might rely in the old (wrong) behavior. + */ + uint16_t lac; + /** Cell id in 2G. Utran Cell id in 3G. Cell Global Id EUTRA in LTE. */ + uint32_t cid; + /** Tracking Area Code in LTE. */ + uint16_t tac; + /** Physical Cell id in LTE (not used in 2G and 3G) */ + uint16_t pcid; +} AGpsRefLocationCellID; + +typedef struct { + uint8_t mac[6]; +} AGpsRefLocationMac; + +/** Represents ref locations */ +typedef struct { + AGpsRefLocationType type; + union { + AGpsRefLocationCellID cellID; + AGpsRefLocationMac mac; + } u; +} AGpsRefLocation; + +/** + * Callback with location information. Can only be called from a thread created + * by create_thread_cb. + */ +typedef void (* gps_location_callback)(GpsLocation* location); + +/** + * Callback with status information. Can only be called from a thread created by + * create_thread_cb. + */ +typedef void (* gps_status_callback)(GpsStatus* status); + +/** + * Legacy callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + * + * This callback is deprecated, and will be removed in the next release. Use + * gnss_sv_status_callback() instead. + */ +typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); + +/** + * Callback with SV status information. + * Can only be called from a thread created by create_thread_cb. + */ +typedef void (* gnss_sv_status_callback)(GnssSvStatus* sv_info); + +/** + * Callback for reporting NMEA sentences. Can only be called from a thread + * created by create_thread_cb. + */ +typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); + +/** + * Callback to inform framework of the GPS engine's capabilities. Capability + * parameter is a bit field of GPS_CAPABILITY_* flags. + */ +typedef void (* gps_set_capabilities)(uint32_t capabilities); + +/** + * Callback utility for acquiring the GPS wakelock. This can be used to prevent + * the CPU from suspending while handling GPS events. + */ +typedef void (* gps_acquire_wakelock)(); + +/** Callback utility for releasing the GPS wakelock. */ +typedef void (* gps_release_wakelock)(); + +/** Callback for requesting NTP time */ +typedef void (* gps_request_utc_time)(); + +/** + * Callback for creating a thread that can call into the Java framework code. + * This must be used to create any threads that report events up to the + * framework. + */ +typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); + +/** + * Provides information about how new the underlying GPS/GNSS hardware and + * software is. + * + * This information will be available for Android Test Applications. If a GPS + * HAL does not provide this information, it will be considered "2015 or + * earlier". + * + * If a GPS HAL does provide this information, then newer years will need to + * meet newer CTS standards. E.g. if the date are 2016 or above, then N+ level + * GpsMeasurement support will be verified. + */ +typedef struct { + /** Set to sizeof(GnssSystemInfo) */ + size_t size; + /* year in which the last update was made to the underlying hardware/firmware + * used to capture GNSS signals, e.g. 2016 */ + uint16_t year_of_hw; +} GnssSystemInfo; + +/** + * Callback to inform framework of the engine's hardware version information. + */ +typedef void (*gnss_set_system_info)(const GnssSystemInfo* info); + +/** New GPS callback structure. */ +typedef struct { + /** set to sizeof(GpsCallbacks) */ + size_t size; + gps_location_callback location_cb; + gps_status_callback status_cb; + gps_sv_status_callback sv_status_cb; + gps_nmea_callback nmea_cb; + gps_set_capabilities set_capabilities_cb; + gps_acquire_wakelock acquire_wakelock_cb; + gps_release_wakelock release_wakelock_cb; + gps_create_thread create_thread_cb; + gps_request_utc_time request_utc_time_cb; + + gnss_set_system_info set_system_info_cb; + gnss_sv_status_callback gnss_sv_status_cb; +} GpsCallbacks; + +/** Represents the standard GPS interface. */ +typedef struct { + /** set to sizeof(GpsInterface) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsCallbacks* callbacks ); + + /** Starts navigating. */ + int (*start)( void ); + + /** Stops navigating. */ + int (*stop)( void ); + + /** Closes the interface. */ + void (*cleanup)( void ); + + /** Injects the current time. */ + int (*inject_time)(GpsUtcTime time, int64_t timeReference, + int uncertainty); + + /** + * Injects current location from another location provider (typically cell + * ID). Latitude and longitude are measured in degrees expected accuracy is + * measured in meters + */ + int (*inject_location)(double latitude, double longitude, float accuracy); + + /** + * Specifies that the next call to start will not use the + * information defined in the flags. GPS_DELETE_ALL is passed for + * a cold start. + */ + void (*delete_aiding_data)(GpsAidingData flags); + + /** + * min_interval represents the time between fixes in milliseconds. + * preferred_accuracy represents the requested fix accuracy in meters. + * preferred_time represents the requested time to first fix in milliseconds. + * + * 'mode' parameter should be one of GPS_POSITION_MODE_MS_BASED + * or GPS_POSITION_MODE_STANDALONE. + * It is allowed by the platform (and it is recommended) to fallback to + * GPS_POSITION_MODE_MS_BASED if GPS_POSITION_MODE_MS_ASSISTED is passed in, and + * GPS_POSITION_MODE_MS_BASED is supported. + */ + int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, + uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); + + /** Get a pointer to extension information. */ + const void* (*get_extension)(const char* name); +} GpsInterface; + +/** + * Callback to request the client to download XTRA data. The client should + * download XTRA data and inject it by calling inject_xtra_data(). Can only be + * called from a thread created by create_thread_cb. + */ +typedef void (* gps_xtra_download_request)(); + +/** Callback structure for the XTRA interface. */ +typedef struct { + gps_xtra_download_request download_request_cb; + gps_create_thread create_thread_cb; +} GpsXtraCallbacks; + +/** Extended interface for XTRA support. */ +typedef struct { + /** set to sizeof(GpsXtraInterface) */ + size_t size; + /** + * Opens the XTRA interface and provides the callback routines + * to the implementation of this interface. + */ + int (*init)( GpsXtraCallbacks* callbacks ); + /** Injects XTRA data into the GPS. */ + int (*inject_xtra_data)( char* data, int length ); +} GpsXtraInterface; + +/** Extended interface for DEBUG support. */ +typedef struct { + /** set to sizeof(GpsDebugInterface) */ + size_t size; + + /** + * This function should return any information that the native + * implementation wishes to include in a bugreport. + */ + size_t (*get_internal_state)(char* buffer, size_t bufferSize); +} GpsDebugInterface; + +/* + * Represents the status of AGPS augmented to support IPv4 and IPv6. + */ +typedef struct { + /** set to sizeof(AGpsStatus) */ + size_t size; + + AGpsType type; + AGpsStatusValue status; + + /** + * Must be set to a valid IPv4 address if the field 'addr' contains an IPv4 + * address, or set to INADDR_NONE otherwise. + */ + uint32_t ipaddr; + + /** + * Must contain the IPv4 (AF_INET) or IPv6 (AF_INET6) address to report. + * Any other value of addr.ss_family will be rejected. + */ + struct sockaddr_storage addr; +} AGpsStatus; + +/** + * Callback with AGPS status information. Can only be called from a thread + * created by create_thread_cb. + */ +typedef void (* agps_status_callback)(AGpsStatus* status); + +/** Callback structure for the AGPS interface. */ +typedef struct { + agps_status_callback status_cb; + gps_create_thread create_thread_cb; +} AGpsCallbacks; + +/** + * Extended interface for AGPS support, it is augmented to enable to pass + * extra APN data. + */ +typedef struct { + /** set to sizeof(AGpsInterface) */ + size_t size; + + /** + * Opens the AGPS interface and provides the callback routines to the + * implementation of this interface. + */ + void (*init)(AGpsCallbacks* callbacks); + /** + * Deprecated. + * If the HAL supports AGpsInterface_v2 this API will not be used, see + * data_conn_open_with_apn_ip_type for more information. + */ + int (*data_conn_open)(const char* apn); + /** + * Notifies that the AGPS data connection has been closed. + */ + int (*data_conn_closed)(); + /** + * Notifies that a data connection is not available for AGPS. + */ + int (*data_conn_failed)(); + /** + * Sets the hostname and port for the AGPS server. + */ + int (*set_server)(AGpsType type, const char* hostname, int port); + + /** + * Notifies that a data connection is available and sets the name of the + * APN, and its IP type, to be used for SUPL connections. + */ + int (*data_conn_open_with_apn_ip_type)( + const char* apn, + ApnIpType apnIpType); +} AGpsInterface; + +/** Error codes associated with certificate operations */ +#define AGPS_CERTIFICATE_OPERATION_SUCCESS 0 +#define AGPS_CERTIFICATE_ERROR_GENERIC -100 +#define AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES -101 + +/** A data structure that represents an X.509 certificate using DER encoding */ +typedef struct { + size_t length; + u_char* data; +} DerEncodedCertificate; + +/** + * A type definition for SHA1 Fingerprints used to identify X.509 Certificates + * The Fingerprint is a digest of the DER Certificate that uniquely identifies it. + */ +typedef struct { + u_char data[20]; +} Sha1CertificateFingerprint; + +/** AGPS Interface to handle SUPL certificate operations */ +typedef struct { + /** set to sizeof(SuplCertificateInterface) */ + size_t size; + + /** + * Installs a set of Certificates used for SUPL connections to the AGPS server. + * If needed the HAL should find out internally any certificates that need to be removed to + * accommodate the certificates to install. + * The certificates installed represent a full set of valid certificates needed to connect to + * AGPS SUPL servers. + * The list of certificates is required, and all must be available at the same time, when trying + * to establish a connection with the AGPS Server. + * + * Parameters: + * certificates - A pointer to an array of DER encoded certificates that are need to be + * installed in the HAL. + * length - The number of certificates to install. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully + * AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES if the HAL cannot store the number of + * certificates attempted to be installed, the state of the certificates stored should + * remain the same as before on this error case. + * + * IMPORTANT: + * If needed the HAL should find out internally the set of certificates that need to be + * removed to accommodate the certificates to install. + */ + int (*install_certificates) ( const DerEncodedCertificate* certificates, size_t length ); + + /** + * Notifies the HAL that a list of certificates used for SUPL connections are revoked. It is + * expected that the given set of certificates is removed from the internal store of the HAL. + * + * Parameters: + * fingerprints - A pointer to an array of SHA1 Fingerprints to identify the set of + * certificates to revoke. + * length - The number of fingerprints provided. + * Returns: + * AGPS_CERTIFICATE_OPERATION_SUCCESS if the operation is completed successfully. + * + * IMPORTANT: + * If any of the certificates provided (through its fingerprint) is not known by the HAL, + * it should be ignored and continue revoking/deleting the rest of them. + */ + int (*revoke_certificates) ( const Sha1CertificateFingerprint* fingerprints, size_t length ); +} SuplCertificateInterface; + +/** Represents an NI request */ +typedef struct { + /** set to sizeof(GpsNiNotification) */ + size_t size; + + /** + * An ID generated by HAL to associate NI notifications and UI + * responses + */ + int notification_id; + + /** + * An NI type used to distinguish different categories of NI + * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... + */ + GpsNiType ni_type; + + /** + * Notification/verification options, combinations of GpsNiNotifyFlags constants + */ + GpsNiNotifyFlags notify_flags; + + /** + * Timeout period to wait for user response. + * Set to 0 for no time out limit. + */ + int timeout; + + /** + * Default response when time out. + */ + GpsUserResponseType default_response; + + /** + * Requestor ID + */ + char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; + + /** + * Notification message. It can also be used to store client_id in some cases + */ + char text[GPS_NI_LONG_STRING_MAXLEN]; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType requestor_id_encoding; + + /** + * Client name decoding scheme + */ + GpsNiEncodingType text_encoding; + + /** + * A pointer to extra data. Format: + * key_1 = value_1 + * key_2 = value_2 + */ + char extras[GPS_NI_LONG_STRING_MAXLEN]; + +} GpsNiNotification; + +/** + * Callback with NI notification. Can only be called from a thread created by + * create_thread_cb. + */ +typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); + +/** GPS NI callback structure. */ +typedef struct +{ + /** + * Sends the notification request from HAL to GPSLocationProvider. + */ + gps_ni_notify_callback notify_cb; + gps_create_thread create_thread_cb; +} GpsNiCallbacks; + +/** + * Extended interface for Network-initiated (NI) support. + */ +typedef struct +{ + /** set to sizeof(GpsNiInterface) */ + size_t size; + + /** Registers the callbacks for HAL to use. */ + void (*init) (GpsNiCallbacks *callbacks); + + /** Sends a response to HAL. */ + void (*respond) (int notif_id, GpsUserResponseType user_response); +} GpsNiInterface; + +struct gps_device_t { + struct hw_device_t common; + + /** + * Set the provided lights to the provided values. + * + * Returns: 0 on succes, error code on failure. + */ + const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); +}; + +#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) +#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) + +typedef void (*agps_ril_request_set_id)(uint32_t flags); +typedef void (*agps_ril_request_ref_loc)(uint32_t flags); + +typedef struct { + agps_ril_request_set_id request_setid; + agps_ril_request_ref_loc request_refloc; + gps_create_thread create_thread_cb; +} AGpsRilCallbacks; + +/** Extended interface for AGPS_RIL support. */ +typedef struct { + /** set to sizeof(AGpsRilInterface) */ + size_t size; + /** + * Opens the AGPS interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( AGpsRilCallbacks* callbacks ); + + /** + * Sets the reference location. + */ + void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); + /** + * Sets the set ID. + */ + void (*set_set_id) (AGpsSetIDType type, const char* setid); + + /** + * Send network initiated message. + */ + void (*ni_message) (uint8_t *msg, size_t len); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); + + /** + * Notify GPS of network status changes. + * These parameters match values in the android.net.NetworkInfo class. + */ + void (*update_network_availability) (int avaiable, const char* apn); +} AGpsRilInterface; + +/** + * GPS Geofence. + * There are 3 states associated with a Geofence: Inside, Outside, Unknown. + * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. + * + * An example state diagram with confidence level: 95% and Unknown time limit + * set as 30 secs is shown below. (confidence level and Unknown time limit are + * explained latter) + * ____________________________ + * | Unknown (30 secs) | + * """""""""""""""""""""""""""" + * ^ | | ^ + * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN + * | v v | + * ________ EXITED _________ + * | Inside | -----------> | Outside | + * | | <----------- | | + * """""""" ENTERED """"""""" + * + * Inside state: We are 95% confident that the user is inside the geofence. + * Outside state: We are 95% confident that the user is outside the geofence + * Unknown state: Rest of the time. + * + * The Unknown state is better explained with an example: + * + * __________ + * | c| + * | ___ | _______ + * | |a| | | b | + * | """ | """"""" + * | | + * """""""""" + * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy + * circle reported by the GPS subsystem. Now with regard to "b", the system is + * confident that the user is outside. But with regard to "a" is not confident + * whether it is inside or outside the geofence. If the accuracy remains the + * same for a sufficient period of time, the UNCERTAIN transition would be + * triggered with the state set to Unknown. If the accuracy improves later, an + * appropriate transition should be triggered. This "sufficient period of time" + * is defined by the parameter in the add_geofence_area API. + * In other words, Unknown state can be interpreted as a state in which the + * GPS subsystem isn't confident enough that the user is either inside or + * outside the Geofence. It moves to Unknown state only after the expiry of the + * timeout. + * + * The geofence callback needs to be triggered for the ENTERED and EXITED + * transitions, when the GPS system is confident that the user has entered + * (Inside state) or exited (Outside state) the Geofence. An implementation + * which uses a value of 95% as the confidence is recommended. The callback + * should be triggered only for the transitions requested by the + * add_geofence_area call. + * + * Even though the diagram and explanation talks about states and transitions, + * the callee is only interested in the transistions. The states are mentioned + * here for illustrative purposes. + * + * Startup Scenario: When the device boots up, if an application adds geofences, + * and then we get an accurate GPS location fix, it needs to trigger the + * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. + * By default, all the Geofences will be in the Unknown state. + * + * When the GPS system is unavailable, gps_geofence_status_callback should be + * called to inform the upper layers of the same. Similarly, when it becomes + * available the callback should be called. This is a global state while the + * UNKNOWN transition described above is per geofence. + * + * An important aspect to note is that users of this API (framework), will use + * other subsystems like wifi, sensors, cell to handle Unknown case and + * hopefully provide a definitive state transition to the third party + * application. GPS Geofence will just be a signal indicating what the GPS + * subsystem knows about the Geofence. + * + */ + +/** + * The callback associated with the geofence. + * Parameters: + * geofence_id - The id associated with the add_geofence_area. + * location - The current GPS location. + * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, + * GPS_GEOFENCE_UNCERTAIN. + * timestamp - Timestamp when the transition was detected. + * + * The callback should only be called when the caller is interested in that + * particular transition. For instance, if the caller is interested only in + * ENTERED transition, then the callback should NOT be called with the EXITED + * transition. + * + * IMPORTANT: If a transition is triggered resulting in this callback, the GPS + * subsystem will wake up the application processor, if its in suspend state. + */ +typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location, + int32_t transition, GpsUtcTime timestamp); + +/** + * The callback associated with the availability of the GPS system for geofencing + * monitoring. If the GPS system determines that it cannot monitor geofences + * because of lack of reliability or unavailability of the GPS signals, it will + * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter. + * + * Parameters: + * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. + * last_location - Last known location. + */ +typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location); + +/** + * The callback associated with the add_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. + * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an + * invalid transition + * GPS_GEOFENCE_ERROR_GENERIC - for other errors. + */ +typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the remove_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); + + +/** + * The callback associated with the pause_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - + * when monitor_transitions is invalid + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); + +/** + * The callback associated with the resume_geofence call. + * + * Parameter: + * geofence_id - Id of the geofence. + * status - GPS_GEOFENCE_OPERATION_SUCCESS + * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id + * GPS_GEOFENCE_ERROR_GENERIC for others. + */ +typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); + +typedef struct { + gps_geofence_transition_callback geofence_transition_callback; + gps_geofence_status_callback geofence_status_callback; + gps_geofence_add_callback geofence_add_callback; + gps_geofence_remove_callback geofence_remove_callback; + gps_geofence_pause_callback geofence_pause_callback; + gps_geofence_resume_callback geofence_resume_callback; + gps_create_thread create_thread_cb; +} GpsGeofenceCallbacks; + +/** Extended interface for GPS_Geofencing support */ +typedef struct { + /** set to sizeof(GpsGeofencingInterface) */ + size_t size; + + /** + * Opens the geofence interface and provides the callback routines + * to the implementation of this interface. + */ + void (*init)( GpsGeofenceCallbacks* callbacks ); + + /** + * Add a geofence area. This api currently supports circular geofences. + * Parameters: + * geofence_id - The id for the geofence. If a geofence with this id + * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) + * should be returned. + * latitude, longtitude, radius_meters - The lat, long and radius + * (in meters) for the geofence + * last_transition - The current state of the geofence. For example, if + * the system already knows that the user is inside the geofence, + * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it + * will be GPS_GEOFENCE_UNCERTAIN. + * monitor_transition - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * notification_responsiveness_ms - Defines the best-effort description + * of how soon should the callback be called when the transition + * associated with the Geofence is triggered. For instance, if set + * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback + * should be called 1000 milliseconds within entering the geofence. + * This parameter is defined in milliseconds. + * NOTE: This is not to be confused with the rate that the GPS is + * polled at. It is acceptable to dynamically vary the rate of + * sampling the GPS for power-saving reasons; thus the rate of + * sampling may be faster or slower than this. + * unknown_timer_ms - The time limit after which the UNCERTAIN transition + * should be triggered. This parameter is defined in milliseconds. + * See above for a detailed explanation. + */ + void (*add_geofence_area) (int32_t geofence_id, double latitude, double longitude, + double radius_meters, int last_transition, int monitor_transitions, + int notification_responsiveness_ms, int unknown_timer_ms); + + /** + * Pause monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + */ + void (*pause_geofence) (int32_t geofence_id); + + /** + * Resume monitoring a particular geofence. + * Parameters: + * geofence_id - The id for the geofence. + * monitor_transitions - Which transitions to monitor. Bitwise OR of + * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and + * GPS_GEOFENCE_UNCERTAIN. + * This supersedes the value associated provided in the + * add_geofence_area call. + */ + void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); + + /** + * Remove a geofence area. After the function returns, no notifications + * should be sent. + * Parameter: + * geofence_id - The id for the geofence. + */ + void (*remove_geofence_area) (int32_t geofence_id); +} GpsGeofencingInterface; + +/** + * Legacy struct to represent an estimate of the GPS clock time. + * Deprecated, to be removed in the next Android release. + * Use GnssClock instead. + */ +typedef struct { + /** set to sizeof(GpsClock) */ + size_t size; + GpsClockFlags flags; + int16_t leap_second; + GpsClockType type; + int64_t time_ns; + double time_uncertainty_ns; + int64_t full_bias_ns; + double bias_ns; + double bias_uncertainty_ns; + double drift_nsps; + double drift_uncertainty_nsps; +} GpsClock; + +/** + * Represents an estimate of the GPS clock time. + */ +typedef struct { + /** set to sizeof(GnssClock) */ + size_t size; + + /** + * A set of flags indicating the validity of the fields in this data + * structure. + */ + GnssClockFlags flags; + + /** + * Leap second data. + * The sign of the value is defined by the following equation: + * utc_time_ns = time_ns - (full_bias_ns + bias_ns) - leap_second * + * 1,000,000,000 + * + * If the data is available 'flags' must contain GNSS_CLOCK_HAS_LEAP_SECOND. + */ + int16_t leap_second; + + /** + * The GNSS receiver internal clock value. This is the local hardware clock + * value. + * + * For local hardware clock, this value is expected to be monotonically + * increasing while the hardware clock remains power on. (For the case of a + * HW clock that is not continuously on, see the + * hw_clock_discontinuity_count field). The receiver's estimate of GPS time + * can be derived by substracting the sum of full_bias_ns and bias_ns (when + * available) from this value. + * + * This GPS time is expected to be the best estimate of current GPS time + * that GNSS receiver can achieve. + * + * Sub-nanosecond accuracy can be provided by means of the 'bias_ns' field. + * The value contains the 'time uncertainty' in it. + * + * This field is mandatory. + */ + int64_t time_ns; + + /** + * 1-Sigma uncertainty associated with the clock's time in nanoseconds. + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available, 'flags' must contain + * GNSS_CLOCK_HAS_TIME_UNCERTAINTY. This value is effectively zero (it is + * the reference local clock, by which all other times and time + * uncertainties are measured.) (And thus this field can be not provided, + * per GNSS_CLOCK_HAS_TIME_UNCERTAINTY flag, or provided & set to 0.) + */ + double time_uncertainty_ns; + + /** + * The difference between hardware clock ('time' field) inside GPS receiver + * and the true GPS time since 0000Z, January 6, 1980, in nanoseconds. + * + * The sign of the value is defined by the following equation: + * local estimate of GPS time = time_ns - (full_bias_ns + bias_ns) + * + * This value is mandatory if the receiver has estimated GPS time. If the + * computed time is for a non-GPS constellation, the time offset of that + * constellation to GPS has to be applied to fill this value. The error + * estimate for the sum of this and the bias_ns is the bias_uncertainty_ns, + * and the caller is responsible for using this uncertainty (it can be very + * large before the GPS time has been solved for.) If the data is available + * 'flags' must contain GNSS_CLOCK_HAS_FULL_BIAS. + */ + int64_t full_bias_ns; + + /** + * Sub-nanosecond bias. + * The error estimate for the sum of this and the full_bias_ns is the + * bias_uncertainty_ns + * + * If the data is available 'flags' must contain GNSS_CLOCK_HAS_BIAS. If GPS + * has computed a position fix. This value is mandatory if the receiver has + * estimated GPS time. + */ + double bias_ns; + + /** + * 1-Sigma uncertainty associated with the local estimate of GPS time (clock + * bias) in nanoseconds. The uncertainty is represented as an absolute + * (single sided) value. + * + * If the data is available 'flags' must contain + * GNSS_CLOCK_HAS_BIAS_UNCERTAINTY. This value is mandatory if the receiver + * has estimated GPS time. + */ + double bias_uncertainty_ns; + + /** + * The clock's drift in nanoseconds (per second). + * + * A positive value means that the frequency is higher than the nominal + * frequency, and that the (full_bias_ns + bias_ns) is growing more positive + * over time. + * + * The value contains the 'drift uncertainty' in it. + * If the data is available 'flags' must contain GNSS_CLOCK_HAS_DRIFT. + * + * This value is mandatory if the receiver has estimated GNSS time + */ + double drift_nsps; + + /** + * 1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). + * The uncertainty is represented as an absolute (single sided) value. + * + * If the data is available 'flags' must contain + * GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY. If GPS has computed a position fix this + * field is mandatory and must be populated. + */ + double drift_uncertainty_nsps; + + /** + * When there are any discontinuities in the HW clock, this field is + * mandatory. + * + * A "discontinuity" is meant to cover the case of a switch from one source + * of clock to another. A single free-running crystal oscillator (XO) + * should generally not have any discontinuities, and this can be set and + * left at 0. + * + * If, however, the time_ns value (HW clock) is derived from a composite of + * sources, that is not as smooth as a typical XO, or is otherwise stopped & + * restarted, then this value shall be incremented each time a discontinuity + * occurs. (E.g. this value may start at zero at device boot-up and + * increment each time there is a change in clock continuity. In the + * unlikely event that this value reaches full scale, rollover (not + * clamping) is required, such that this value continues to change, during + * subsequent discontinuity events.) + * + * While this number stays the same, between GnssClock reports, it can be + * safely assumed that the time_ns value has been running continuously, e.g. + * derived from a single, high quality clock (XO like, or better, that's + * typically used during continuous GNSS signal sampling.) + * + * It is expected, esp. during periods where there are few GNSS signals + * available, that the HW clock be discontinuity-free as long as possible, + * as this avoids the need to use (waste) a GNSS measurement to fully + * re-solve for the GPS clock bias and drift, when using the accompanying + * measurements, from consecutive GnssData reports. + */ + uint32_t hw_clock_discontinuity_count; + +} GnssClock; + +/** + * Legacy struct to represent a GPS Measurement, it contains raw and computed + * information. + * Deprecated, to be removed in the next Android release. + * Use GnssMeasurement instead. + */ +typedef struct { + /** set to sizeof(GpsMeasurement) */ + size_t size; + GpsMeasurementFlags flags; + int8_t prn; + double time_offset_ns; + GpsMeasurementState state; + int64_t received_gps_tow_ns; + int64_t received_gps_tow_uncertainty_ns; + double c_n0_dbhz; + double pseudorange_rate_mps; + double pseudorange_rate_uncertainty_mps; + GpsAccumulatedDeltaRangeState accumulated_delta_range_state; + double accumulated_delta_range_m; + double accumulated_delta_range_uncertainty_m; + double pseudorange_m; + double pseudorange_uncertainty_m; + double code_phase_chips; + double code_phase_uncertainty_chips; + float carrier_frequency_hz; + int64_t carrier_cycles; + double carrier_phase; + double carrier_phase_uncertainty; + GpsLossOfLock loss_of_lock; + int32_t bit_number; + int16_t time_from_last_bit_ms; + double doppler_shift_hz; + double doppler_shift_uncertainty_hz; + GpsMultipathIndicator multipath_indicator; + double snr_db; + double elevation_deg; + double elevation_uncertainty_deg; + double azimuth_deg; + double azimuth_uncertainty_deg; + bool used_in_fix; +} GpsMeasurement; + +/** + * Represents a GNSS Measurement, it contains raw and computed information. + * + * Independence - All signal measurement information (e.g. sv_time, + * pseudorange_rate, multipath_indicator) reported in this struct should be + * based on GNSS signal measurements only. You may not synthesize measurements + * by calculating or reporting expected measurements based on known or estimated + * position, velocity, or time. + */ +typedef struct { + /** set to sizeof(GpsMeasurement) */ + size_t size; + + /** A set of flags indicating the validity of the fields in this data structure. */ + GnssMeasurementFlags flags; + + /** + * Satellite vehicle ID number, as defined in GnssSvInfo::svid + * This is a mandatory value. + */ + int16_t svid; + + /** + * Defines the constellation of the given SV. Value should be one of those + * GNSS_CONSTELLATION_* constants + */ + GnssConstellationType constellation; + + /** + * Time offset at which the measurement was taken in nanoseconds. + * The reference receiver's time is specified by GpsData::clock::time_ns and should be + * interpreted in the same way as indicated by GpsClock::type. + * + * The sign of time_offset_ns is given by the following equation: + * measurement time = GpsClock::time_ns + time_offset_ns + * + * It provides an individual time-stamp for the measurement, and allows sub-nanosecond accuracy. + * This is a mandatory value. + */ + double time_offset_ns; + + /** + * Per satellite sync state. It represents the current sync state for the associated satellite. + * Based on the sync state, the 'received GPS tow' field should be interpreted accordingly. + * + * This is a mandatory value. + */ + GnssMeasurementState state; + + /** + * The received GNSS Time-of-Week at the measurement time, in nanoseconds. + * Ensure that this field is independent (see comment at top of + * GnssMeasurement struct.) + * + * For GPS & QZSS, this is: + * Received GPS Time-of-Week at the measurement time, in nanoseconds. + * The value is relative to the beginning of the current GPS week. + * + * Given the highest sync state that can be achieved, per each satellite, valid range + * for this field can be: + * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync : [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe sync : [ 0 6s ] : GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * TOW decoded : [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * Note well: if there is any ambiguity in integer millisecond, + * GNSS_MEASUREMENT_STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field. + * + * This value must be populated if 'state' != GNSS_MEASUREMENT_STATE_UNKNOWN. + * + * For Glonass, this is: + * Received Glonass time of day, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock : [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Symbol sync : [ 0 10ms ] : GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set + * Bit sync : [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * String sync : [ 0 2s ] : GNSS_MEASUREMENT_STATE_GLO_STRING_SYNC is set + * Time of day : [ 0 1day ] : GNSS_MEASUREMENT_STATE_GLO_TOD_DECODED is set + * + * For Beidou, this is: + * Received Beidou time of week, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, valid range for + * this field can be: + * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock: [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Bit sync (D2): [ 0 2ms ] : GNSS_MEASUREMENT_STATE_BDS_D2_BIT_SYNC is set + * Bit sync (D1): [ 0 20ms ] : GNSS_MEASUREMENT_STATE_BIT_SYNC is set + * Subframe (D2): [ 0 0.6s ] : GNSS_MEASUREMENT_STATE_BDS_D2_SUBFRAME_SYNC is set + * Subframe (D1): [ 0 6s ] : GNSS_MEASUREMENT_STATE_SUBFRAME_SYNC is set + * Time of week : [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * For Galileo, this is: + * Received Galileo time of week, at the measurement time in nanoseconds. + * + * E1BC code lock : [ 0 4ms ] : GNSS_MEASUREMENT_STATE_GAL_E1BC_CODE_LOCK is set + * E1C 2nd code lock: [ 0 100ms ] : + * GNSS_MEASUREMENT_STATE_GAL_E1C_2ND_CODE_LOCK is set + * + * E1B page : [ 0 2s ] : GNSS_MEASUREMENT_STATE_GAL_E1B_PAGE_SYNC is set + * Time of week: [ 0 1week ] : GNSS_MEASUREMENT_STATE_TOW_DECODED is set + * + * For SBAS, this is: + * Received SBAS time, at the measurement time in nanoseconds. + * + * Given the highest sync state that can be achieved, per each satellite, + * valid range for this field can be: + * Searching : [ 0 ] : GNSS_MEASUREMENT_STATE_UNKNOWN + * C/A code lock: [ 0 1ms ] : GNSS_MEASUREMENT_STATE_CODE_LOCK is set + * Symbol sync : [ 0 2ms ] : GNSS_MEASUREMENT_STATE_SYMBOL_SYNC is set + * Message : [ 0 1s ] : GNSS_MEASUREMENT_STATE_SBAS_SYNC is set + */ + int64_t received_sv_time_in_ns; + + /** + * 1-Sigma uncertainty of the Received GPS Time-of-Week in nanoseconds. + * + * This value must be populated if 'state' != GPS_MEASUREMENT_STATE_UNKNOWN. + */ + int64_t received_sv_time_uncertainty_in_ns; + + /** + * Carrier-to-noise density in dB-Hz, typically in the range [0, 63]. + * It contains the measured C/N0 value for the signal at the antenna port. + * + * This is a mandatory value. + */ + double c_n0_dbhz; + + /** + * Pseudorange rate at the timestamp in m/s. The correction of a given + * Pseudorange Rate value includes corrections for receiver and satellite + * clock frequency errors. Ensure that this field is independent (see + * comment at top of GnssMeasurement struct.) + * + * It is mandatory to provide the 'uncorrected' 'pseudorange rate', and provide GpsClock's + * 'drift' field as well (When providing the uncorrected pseudorange rate, do not apply the + * corrections described above.) + * + * The value includes the 'pseudorange rate uncertainty' in it. + * A positive 'uncorrected' value indicates that the SV is moving away from the receiver. + * + * The sign of the 'uncorrected' 'pseudorange rate' and its relation to the sign of 'doppler + * shift' is given by the equation: + * pseudorange rate = -k * doppler shift (where k is a constant) + * + * This should be the most accurate pseudorange rate available, based on + * fresh signal measurements from this channel. + * + * It is mandatory that this value be provided at typical carrier phase PRR + * quality (few cm/sec per second of uncertainty, or better) - when signals + * are sufficiently strong & stable, e.g. signals from a GPS simulator at >= + * 35 dB-Hz. + */ + double pseudorange_rate_mps; + + /** + * 1-Sigma uncertainty of the pseudorange_rate_mps. + * The uncertainty is represented as an absolute (single sided) value. + * + * This is a mandatory value. + */ + double pseudorange_rate_uncertainty_mps; + + /** + * Accumulated delta range's state. It indicates whether ADR is reset or there is a cycle slip + * (indicating loss of lock). + * + * This is a mandatory value. + */ + GnssAccumulatedDeltaRangeState accumulated_delta_range_state; + + /** + * Accumulated delta range since the last channel reset in meters. + * A positive value indicates that the SV is moving away from the receiver. + * + * The sign of the 'accumulated delta range' and its relation to the sign of 'carrier phase' + * is given by the equation: + * accumulated delta range = -k * carrier phase (where k is a constant) + * + * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + * However, it is expected that the data is only accurate when: + * 'accumulated delta range state' == GPS_ADR_STATE_VALID. + */ + double accumulated_delta_range_m; + + /** + * 1-Sigma uncertainty of the accumulated delta range in meters. + * This value must be populated if 'accumulated delta range state' != GPS_ADR_STATE_UNKNOWN. + */ + double accumulated_delta_range_uncertainty_m; + + /** + * Carrier frequency at which codes and messages are modulated, it can be L1 or L2. + * If the field is not set, the carrier frequency is assumed to be L1. + * + * If the data is available, 'flags' must contain + * GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY. + */ + float carrier_frequency_hz; + + /** + * The number of full carrier cycles between the satellite and the receiver. + * The reference frequency is given by the field 'carrier_frequency_hz'. + * Indications of possible cycle slips and resets in the accumulation of + * this value can be inferred from the accumulated_delta_range_state flags. + * + * If the data is available, 'flags' must contain + * GNSS_MEASUREMENT_HAS_CARRIER_CYCLES. + */ + int64_t carrier_cycles; + + /** + * The RF phase detected by the receiver, in the range [0.0, 1.0]. + * This is usually the fractional part of the complete carrier phase measurement. + * + * The reference frequency is given by the field 'carrier_frequency_hz'. + * The value contains the 'carrier-phase uncertainty' in it. + * + * If the data is available, 'flags' must contain + * GNSS_MEASUREMENT_HAS_CARRIER_PHASE. + */ + double carrier_phase; + + /** + * 1-Sigma uncertainty of the carrier-phase. + * If the data is available, 'flags' must contain + * GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY. + */ + double carrier_phase_uncertainty; + + /** + * An enumeration that indicates the 'multipath' state of the event. + * + * The multipath Indicator is intended to report the presence of overlapping + * signals that manifest as distorted correlation peaks. + * + * - if there is a distorted correlation peak shape, report that multipath + * is GNSS_MULTIPATH_INDICATOR_PRESENT. + * - if there is not a distorted correlation peak shape, report + * GNSS_MULTIPATH_INDICATOR_NOT_PRESENT + * - if signals are too weak to discern this information, report + * GNSS_MULTIPATH_INDICATOR_UNKNOWN + * + * Example: when doing the standardized overlapping Multipath Performance + * test (3GPP TS 34.171) the Multipath indicator should report + * GNSS_MULTIPATH_INDICATOR_PRESENT for those signals that are tracked, and + * contain multipath, and GNSS_MULTIPATH_INDICATOR_NOT_PRESENT for those + * signals that are tracked and do not contain multipath. + */ + GnssMultipathIndicator multipath_indicator; + + /** + * Signal-to-noise ratio at correlator output in dB. + * If the data is available, 'flags' must contain GNSS_MEASUREMENT_HAS_SNR. + * This is the power ratio of the "correlation peak height above the + * observed noise floor" to "the noise RMS". + */ + double snr_db; +} GnssMeasurement; + +/** + * Legacy struct to represents a reading of GPS measurements. + * Deprecated, to be removed in the next Android release. + * Use GnssData instead. + */ +typedef struct { + /** set to sizeof(GpsData) */ + size_t size; + size_t measurement_count; + GpsMeasurement measurements[GPS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + GpsClock clock; +} GpsData; + +/** + * Represents a reading of GNSS measurements. For devices where GnssSystemInfo's + * year_of_hw is set to 2016+, it is mandatory that these be provided, on + * request, when the GNSS receiver is searching/tracking signals. + * + * - Reporting of GPS constellation measurements is mandatory. + * - Reporting of all tracked constellations are encouraged. + */ +typedef struct { + /** set to sizeof(GnssData) */ + size_t size; + + /** Number of measurements. */ + size_t measurement_count; + + /** The array of measurements. */ + GnssMeasurement measurements[GNSS_MAX_MEASUREMENT]; + + /** The GPS clock time reading. */ + GnssClock clock; +} GnssData; + +/** + * The legacy callback for to report measurements from the HAL. + * + * This callback is deprecated, and will be removed in the next release. Use + * gnss_measurement_callback() instead. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*gps_measurement_callback) (GpsData* data); + +/** + * The callback for to report measurements from the HAL. + * + * Parameters: + * data - A data structure containing the measurements. + */ +typedef void (*gnss_measurement_callback) (GnssData* data); + +typedef struct { + /** set to sizeof(GpsMeasurementCallbacks) */ + size_t size; + gps_measurement_callback measurement_callback; + gnss_measurement_callback gnss_measurement_callback; +} GpsMeasurementCallbacks; + +/** + * Extended interface for GPS Measurements support. + */ +typedef struct { + /** Set to sizeof(GpsMeasurementInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates at its own phase. + * + * Status: + * GPS_MEASUREMENT_OPERATION_SUCCESS + * GPS_MEASUREMENT_ERROR_ALREADY_INIT - if a callback has already been registered without a + * corresponding call to 'close' + * GPS_MEASUREMENT_ERROR_GENERIC - if any other error occurred, it is expected that the HAL + * will not generate any updates upon returning this error code. + */ + int (*init) (GpsMeasurementCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsMeasurementInterface; + +/** + * Legacy struct to represents a GPS navigation message (or a fragment of it). + * Deprecated, to be removed in the next Android release. + * Use GnssNavigationMessage instead. + */ +typedef struct { + /** set to sizeof(GpsNavigationMessage) */ + size_t size; + int8_t prn; + GpsNavigationMessageType type; + NavigationMessageStatus status; + int16_t message_id; + int16_t submessage_id; + size_t data_length; + uint8_t* data; +} GpsNavigationMessage; + +/** Represents a GPS navigation message (or a fragment of it). */ +typedef struct { + /** set to sizeof(GnssNavigationMessage) */ + size_t size; + + /** + * Satellite vehicle ID number, as defined in GnssSvInfo::svid + * This is a mandatory value. + */ + int16_t svid; + + /** + * The type of message contained in the structure. + * This is a mandatory value. + */ + GnssNavigationMessageType type; + + /** + * The status of the received navigation message. + * No need to send any navigation message that contains words with parity error and cannot be + * corrected. + */ + NavigationMessageStatus status; + + /** + * Message identifier. It provides an index so the complete Navigation + * Message can be assembled. + * + * - For GPS L1 C/A subframe 4 and 5, this value corresponds to the 'frame + * id' of the navigation message, in the range of 1-25 (Subframe 1, 2, 3 + * does not contain a 'frame id' and this value can be set to -1.) + * + * - For Glonass L1 C/A, this refers to the frame ID, in the range of 1-5. + * + * - For BeiDou D1, this refers to the frame number in the range of 1-24 + * + * - For Beidou D2, this refers to the frame number, in the range of 1-120 + * + * - For Galileo F/NAV nominal frame structure, this refers to the subframe + * number, in the range of 1-12 + * + * - For Galileo I/NAV nominal frame structure, this refers to the subframe + * number in the range of 1-24 + */ + int16_t message_id; + + /** + * Sub-message identifier. If required by the message 'type', this value + * contains a sub-index within the current message (or frame) that is being + * transmitted. + * + * - For GPS L1 C/A, BeiDou D1 & BeiDou D2, the submessage id corresponds to + * the subframe number of the navigation message, in the range of 1-5. + * + * - For Glonass L1 C/A, this refers to the String number, in the range from + * 1-15 + * + * - For Galileo F/NAV, this refers to the page type in the range 1-6 + * + * - For Galileo I/NAV, this refers to the word type in the range 1-10+ + */ + int16_t submessage_id; + + /** + * The length of the data (in bytes) contained in the current message. + * If this value is different from zero, 'data' must point to an array of the same size. + * e.g. for L1 C/A the size of the sub-frame will be 40 bytes (10 words, 30 bits/word). + * + * This is a mandatory value. + */ + size_t data_length; + + /** + * The data of the reported GPS message. The bytes (or words) specified + * using big endian format (MSB first). + * + * - For GPS L1 C/A, Beidou D1 & Beidou D2, each subframe contains 10 30-bit + * words. Each word (30 bits) should be fit into the last 30 bits in a + * 4-byte word (skip B31 and B32), with MSB first, for a total of 40 + * bytes, covering a time period of 6, 6, and 0.6 seconds, respectively. + * + * - For Glonass L1 C/A, each string contains 85 data bits, including the + * checksum. These bits should be fit into 11 bytes, with MSB first (skip + * B86-B88), covering a time period of 2 seconds. + * + * - For Galileo F/NAV, each word consists of 238-bit (sync & tail symbols + * excluded). Each word should be fit into 30-bytes, with MSB first (skip + * B239, B240), covering a time period of 10 seconds. + * + * - For Galileo I/NAV, each page contains 2 page parts, even and odd, with + * a total of 2x114 = 228 bits, (sync & tail excluded) that should be fit + * into 29 bytes, with MSB first (skip B229-B232). + */ + uint8_t* data; + +} GnssNavigationMessage; + +/** + * The legacy callback to report an available fragment of a GPS navigation + * messages from the HAL. + * + * This callback is deprecated, and will be removed in the next release. Use + * gnss_navigation_message_callback() instead. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gps_navigation_message_callback) (GpsNavigationMessage* message); + +/** + * The callback to report an available fragment of a GPS navigation messages from the HAL. + * + * Parameters: + * message - The GPS navigation submessage/subframe representation. + */ +typedef void (*gnss_navigation_message_callback) (GnssNavigationMessage* message); + +typedef struct { + /** set to sizeof(GpsNavigationMessageCallbacks) */ + size_t size; + gps_navigation_message_callback navigation_message_callback; + gnss_navigation_message_callback gnss_navigation_message_callback; +} GpsNavigationMessageCallbacks; + +/** + * Extended interface for GPS navigation message reporting support. + */ +typedef struct { + /** Set to sizeof(GpsNavigationMessageInterface) */ + size_t size; + + /** + * Initializes the interface and registers the callback routines with the HAL. + * After a successful call to 'init' the HAL must begin to provide updates as they become + * available. + * + * Status: + * GPS_NAVIGATION_MESSAGE_OPERATION_SUCCESS + * GPS_NAVIGATION_MESSAGE_ERROR_ALREADY_INIT - if a callback has already been registered + * without a corresponding call to 'close'. + * GPS_NAVIGATION_MESSAGE_ERROR_GENERIC - if any other error occurred, it is expected that + * the HAL will not generate any updates upon returning this error code. + */ + int (*init) (GpsNavigationMessageCallbacks* callbacks); + + /** + * Stops updates from the HAL, and unregisters the callback routines. + * After a call to stop, the previously registered callbacks must be considered invalid by the + * HAL. + * If stop is invoked without a previous 'init', this function should perform no work. + */ + void (*close) (); + +} GpsNavigationMessageInterface; + +/** + * Interface for passing GNSS configuration contents from platform to HAL. + */ +typedef struct { + /** Set to sizeof(GnssConfigurationInterface) */ + size_t size; + + /** + * Deliver GNSS configuration contents to HAL. + * Parameters: + * config_data - a pointer to a char array which holds what usually is expected from + file(/etc/gps.conf), i.e., a sequence of UTF8 strings separated by '\n'. + * length - total number of UTF8 characters in configuraiton data. + * + * IMPORTANT: + * GPS HAL should expect this function can be called multiple times. And it may be + * called even when GpsLocationProvider is already constructed and enabled. GPS HAL + * should maintain the existing requests for various callback regardless the change + * in configuration data. + */ + void (*configuration_update) (const char* config_data, int32_t length); +} GnssConfigurationInterface; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ + diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h new file mode 100644 index 0000000..ad79e42 --- /dev/null +++ b/include/hardware/gralloc.h @@ -0,0 +1,437 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_GRALLOC_INTERFACE_H +#define ANDROID_GRALLOC_INTERFACE_H + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +__BEGIN_DECLS + +/** + * Module versioning information for the Gralloc hardware module, based on + * gralloc_module_t.common.module_api_version. + * + * Version History: + * + * GRALLOC_MODULE_API_VERSION_0_1: + * Initial Gralloc hardware module API. + * + * GRALLOC_MODULE_API_VERSION_0_2: + * Add support for flexible YCbCr format with (*lock_ycbcr)() method. + * + * GRALLOC_MODULE_API_VERSION_0_3: + * Add support for fence passing to/from lock/unlock. + */ + +#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) +#define GRALLOC_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3) + +#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) + +/** + * The id of this module + */ +#define GRALLOC_HARDWARE_MODULE_ID "gralloc" + +/** + * Name of the graphics device to open + */ + +#define GRALLOC_HARDWARE_GPU0 "gpu0" + +enum { + /* buffer is never read in software */ + GRALLOC_USAGE_SW_READ_NEVER = 0x00000000U, + /* buffer is rarely read in software */ + GRALLOC_USAGE_SW_READ_RARELY = 0x00000002U, + /* buffer is often read in software */ + GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003U, + /* added for VR single buffer only */ +#ifdef USES_VR_FRONT_BUFFER + GRALLOC_USAGE_VR_SINGLE_BUFFER_USAGE= 0x00000004U, +#endif + + /* mask for the software read values */ + GRALLOC_USAGE_SW_READ_MASK = 0x0000000FU, + + /* buffer is never written in software */ + GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000U, + /* buffer is rarely written in software */ + GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020U, + /* buffer is often written in software */ + GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030U, + /* mask for the software write values */ + GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0U, + + /* buffer will be used as an OpenGL ES texture */ + GRALLOC_USAGE_HW_TEXTURE = 0x00000100U, + /* buffer will be used as an OpenGL ES render target */ + GRALLOC_USAGE_HW_RENDER = 0x00000200U, + /* buffer will be used by the 2D hardware blitter */ + GRALLOC_USAGE_HW_2D = 0x00000400U, + /* buffer will be used by the HWComposer HAL module */ + GRALLOC_USAGE_HW_COMPOSER = 0x00000800U, + /* buffer will be used with the framebuffer device */ + GRALLOC_USAGE_HW_FB = 0x00001000U, + + /* buffer should be displayed full-screen on an external display when + * possible */ + GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000U, + + /* Must have a hardware-protected path to external display sink for + * this buffer. If a hardware-protected path is not available, then + * either don't composite only this buffer (preferred) to the + * external sink, or (less desirable) do not route the entire + * composition to the external sink. */ + GRALLOC_USAGE_PROTECTED = 0x00004000U, + + /* buffer may be used as a cursor */ + GRALLOC_USAGE_CURSOR = 0x00008000U, + + /* buffer will be used with the HW video encoder */ + GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000U, + /* buffer will be written by the HW camera pipeline */ + GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000U, + /* buffer will be read by the HW camera pipeline */ + GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000U, + /* buffer will be used as part of zero-shutter-lag queue */ + GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000U, + /* mask for the camera access values */ + GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000U, + /* mask for the software usage bit-mask */ + GRALLOC_USAGE_HW_MASK = 0x00071F00U, + + /* buffer will be used as a RenderScript Allocation */ + GRALLOC_USAGE_RENDERSCRIPT = 0x00100000U, + + /* Set by the consumer to indicate to the producer that they may attach a + * buffer that they did not detach from the BufferQueue. Will be filtered + * out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to + * handle this flag. */ + GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00200000U, + + /* Mask of all flags which could be passed to a gralloc module for buffer + * allocation. Any flags not in this mask do not need to be handled by + * gralloc modules. */ + GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS), + + /* implementation-specific private usage flags */ + GRALLOC_USAGE_PRIVATE_0 = 0x10000000U, + GRALLOC_USAGE_PRIVATE_1 = 0x20000000U, + GRALLOC_USAGE_PRIVATE_2 = 0x40000000U, + GRALLOC_USAGE_PRIVATE_3 = 0x80000000U, + GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U, + + GRALLOC_USAGE_INTERNAL_ONLY = 0x10000000U, + GRALLOC_USAGE_EXTERNAL_FLEXIBLE = 0x20000000U, + GRALLOC_USAGE_EXTERNAL_BLOCK = 0x40000000U, + GRALLOC_USAGE_EXTERNAL_ONLY = 0x80000000U, + GRALLOC_USAGE_EXTERNAL_VIRTUALFB = 0x00400000U, + GRALLOC_USAGE_PROTECTED_DPB = 0x00800000U, + /* buffer will be used by the HW IPs when sysmmu is off */ + GRALLOC_USAGE_PHYSICALLY_LINEAR = 0x01000000U, + GRALLOC_USAGE_PRIVATE_NONSECURE = 0x02000000U, + GRALLOC_USAGE_CAMERA_RESERVED = 0x04000000U, + GRALLOC_USAGE_NOZEROED = 0x08000000U, + GRALLOC_USAGE_VIDEO_EXT = 0x10000000U, + GRALLOC_USAGE_GPU_BUFFER = 0x00800000U, +}; + +/*****************************************************************************/ + +/** + * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM + * and the fields of this data structure must begin with hw_module_t + * followed by module specific information. + */ +typedef struct gralloc_module_t { + struct hw_module_t common; + + /* + * (*registerBuffer)() must be called before a buffer_handle_t that has not + * been created with (*alloc_device_t::alloc)() can be used. + * + * This is intended to be used with buffer_handle_t's that have been + * received in this process through IPC. + * + * This function checks that the handle is indeed a valid one and prepares + * it for use with (*lock)() and (*unlock)(). + * + * It is not necessary to call (*registerBuffer)() on a handle created + * with (*alloc_device_t::alloc)(). + * + * returns an error if this buffer_handle_t is not valid. + */ + int (*registerBuffer)(struct gralloc_module_t const* module, + buffer_handle_t handle); + + /* + * (*unregisterBuffer)() is called once this handle is no longer needed in + * this process. After this call, it is an error to call (*lock)(), + * (*unlock)(), or (*registerBuffer)(). + * + * This function doesn't close or free the handle itself; this is done + * by other means, usually through libcutils's native_handle_close() and + * native_handle_free(). + * + * It is an error to call (*unregisterBuffer)() on a buffer that wasn't + * explicitly registered first. + */ + int (*unregisterBuffer)(struct gralloc_module_t const* module, + buffer_handle_t handle); + + /* + * The (*lock)() method is called before a buffer is accessed for the + * specified usage. This call may block, for instance if the h/w needs + * to finish rendering or if CPU caches need to be synchronized. + * + * The caller promises to modify only pixels in the area specified + * by (l,t,w,h). + * + * The content of the buffer outside of the specified area is NOT modified + * by this call. + * + * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address + * of the buffer in virtual memory. + * + * Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail + * and return -EINVAL. These buffers must be locked with (*lock_ycbcr)() + * instead. + * + * THREADING CONSIDERATIONS: + * + * It is legal for several different threads to lock a buffer from + * read access, none of the threads are blocked. + * + * However, locking a buffer simultaneously for write or read/write is + * undefined, but: + * - shall not result in termination of the process + * - shall not block the caller + * It is acceptable to return an error or to leave the buffer's content + * into an indeterminate state. + * + * If the buffer was created with a usage mask incompatible with the + * requested usage flags here, -EINVAL is returned. + * + */ + + int (*lock)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + void** vaddr); + + + /* + * The (*unlock)() method must be called after all changes to the buffer + * are completed. + */ + + int (*unlock)(struct gralloc_module_t const* module, + buffer_handle_t handle); + + /* reserved for future use */ + int (*perform)(struct gralloc_module_t const* module, + int operation, ... ); + + /* + * The (*lock_ycbcr)() method is like the (*lock)() method, with the + * difference that it fills a struct ycbcr with a description of the buffer + * layout, and zeroes out the reserved fields. + * + * If the buffer format is not compatible with a flexible YUV format (e.g. + * the buffer layout cannot be represented with the ycbcr struct), it + * will return -EINVAL. + * + * This method must work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888 + * if supported by the device, as well as with any other format that is + * requested by the multimedia codecs when they are configured with a + * flexible-YUV-compatible color-format with android native buffers. + * + * Note that this method may also be called on buffers of other formats, + * including non-YUV formats. + * + * Added in GRALLOC_MODULE_API_VERSION_0_2. + */ + + int (*lock_ycbcr)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + struct android_ycbcr *ycbcr); + + /* + * The (*lockAsync)() method is like the (*lock)() method except + * that the buffer's sync fence object is passed into the lock + * call instead of requiring the caller to wait for completion. + * + * The gralloc implementation takes ownership of the fenceFd and + * is responsible for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*lockAsync)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + void** vaddr, int fenceFd); + + /* + * The (*unlockAsync)() method is like the (*unlock)() method + * except that a buffer sync fence object is returned from the + * lock call, representing the completion of any pending work + * performed by the gralloc implementation. + * + * The caller takes ownership of the fenceFd and is responsible + * for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*unlockAsync)(struct gralloc_module_t const* module, + buffer_handle_t handle, int* fenceFd); + + /* + * The (*lockAsync_ycbcr)() method is like the (*lock_ycbcr)() + * method except that the buffer's sync fence object is passed + * into the lock call instead of requiring the caller to wait for + * completion. + * + * The gralloc implementation takes ownership of the fenceFd and + * is responsible for closing it when no longer needed. + * + * Added in GRALLOC_MODULE_API_VERSION_0_3. + */ + int (*lockAsync_ycbcr)(struct gralloc_module_t const* module, + buffer_handle_t handle, int usage, + int l, int t, int w, int h, + struct android_ycbcr *ycbcr, int fenceFd); + + /* reserved for future use */ + void* reserved_proc[3]; +} gralloc_module_t; + +/*****************************************************************************/ + +/** + * Every device data structure must begin with hw_device_t + * followed by module specific public methods and attributes. + */ + +typedef struct alloc_device_t { + struct hw_device_t common; + + /* + * (*alloc)() Allocates a buffer in graphic memory with the requested + * parameters and returns a buffer_handle_t and the stride in pixels to + * allow the implementation to satisfy hardware constraints on the width + * of a pixmap (eg: it may have to be multiple of 8 pixels). + * The CALLER TAKES OWNERSHIP of the buffer_handle_t. + * + * If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be + * 0, since the actual strides are available from the android_ycbcr + * structure. + * + * Returns 0 on success or -errno on error. + */ + + int (*alloc)(struct alloc_device_t* dev, + int w, int h, int format, int usage, + buffer_handle_t* handle, int* stride); + + /* + * (*free)() Frees a previously allocated buffer. + * Behavior is undefined if the buffer is still mapped in any process, + * but shall not result in termination of the program or security breaches + * (allowing a process to get access to another process' buffers). + * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes + * invalid after the call. + * + * Returns 0 on success or -errno on error. + */ + int (*free)(struct alloc_device_t* dev, + buffer_handle_t handle); + + /* This hook is OPTIONAL. + * + * If non NULL it will be caused by SurfaceFlinger on dumpsys + */ + void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); + + void* reserved_proc[7]; +} alloc_device_t; + + +/** convenience API for opening and closing a supported device */ + +static inline int gralloc_open(const struct hw_module_t* module, + struct alloc_device_t** device) { + return module->methods->open(module, +#ifdef __cplusplus + GRALLOC_HARDWARE_GPU0, reinterpret_cast(device)); +#else + GRALLOC_HARDWARE_GPU0, TO_HW_DEVICE_T_OPEN(device)); +#endif +} + +static inline int gralloc_close(struct alloc_device_t* device) { + return device->common.close(&device->common); +} + +/** + * map_usage_to_memtrack should be called after allocating a gralloc buffer. + * + * @param usage - it is the flag used when alloc function is called. + * + * This function maps the gralloc usage flags to appropriate memtrack bucket. + * GrallocHAL implementers and users should make an additional ION_IOCTL_TAG + * call using the memtrack tag returned by this function. This will help the + * in-kernel memtack to categorize the memory allocated by different processes + * according to their usage. + * + */ +static inline const char* map_usage_to_memtrack(uint32_t usage) { + usage &= GRALLOC_USAGE_ALLOC_MASK; + + if ((usage & GRALLOC_USAGE_HW_CAMERA_WRITE) != 0) { + return "camera"; + } else if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) != 0 || + (usage & GRALLOC_USAGE_EXTERNAL_DISP) != 0) { + return "video"; + } else if ((usage & GRALLOC_USAGE_HW_RENDER) != 0 || + (usage & GRALLOC_USAGE_HW_TEXTURE) != 0) { + return "gl"; + } else if ((usage & GRALLOC_USAGE_HW_CAMERA_READ) != 0) { + return "camera"; + } else if ((usage & GRALLOC_USAGE_SW_READ_MASK) != 0 || + (usage & GRALLOC_USAGE_SW_WRITE_MASK) != 0) { + return "cpu"; + } + return "graphics"; +} + +__END_DECLS + +#endif // ANDROID_GRALLOC_INTERFACE_H diff --git a/include/samsung_audio.h b/include/samsung_audio.h new file mode 100644 index 0000000..afb0d97 --- /dev/null +++ b/include/samsung_audio.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2017 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#ifndef SAMSUNG_AUDIO_H +#define SAMSUNG_AUDIO_H + +#define MIXER_CARD 0 +#define SOUND_CARD 0 + +/* Playback */ +#define SOUND_DEEP_BUFFER_DEVICE 1 +#define SOUND_PLAYBACK_DEVICE 0 +#define SOUND_PLAYBACK_SCO_DEVICE 3 + +/* Capture */ +#define SOUND_CAPTURE_DEVICE 0 +#define SOUND_CAPTURE_SCO_DEVICE 3 + +/* Voice calls */ +#define SOUND_PLAYBACK_VOICE_DEVICE 2 +#define SOUND_CAPTURE_VOICE_DEVICE 2 + +/* Wideband AMR callback */ +#ifndef RIL_UNSOL_SNDMGR_WB_AMR_REPORT +#ifdef RIL_UNSOL_WB_AMR_STATE +#define RIL_UNSOL_SNDMGR_WB_AMR_REPORT RIL_UNSOL_WB_AMR_STATE +#else +#define RIL_UNSOL_SNDMGR_WB_AMR_REPORT 0 +#endif +#endif + +/* Unusupported +#define SOUND_CAPTURE_LOOPBACK_AEC_DEVICE 1 +#define SOUND_CAPTURE_HOTWORD_DEVICE 0 +*/ + +/* + * If the device has stereo speakers and the speakers are arranged on + * different sides of the device you can activate this feature by + * setting it to 1. + */ +#define SWAP_SPEAKER_ON_SCREEN_ROTATION 0 + +/* + * You can that this to 1 if your kernel supports irq affinity for + * fast mode. See /proc/asound/irq_affinity + */ +#define SUPPORTS_IRQ_AFFINITY 0 + +/* + * The Wolfson/Cirruslogic chips need to shutdown the DAPM route completely + * to be able to load a new firmware. Some of these chips need a delay after + * shutodown to full poweroff the DSPs. + * + * A good value to start with is 10ms: + * + * #define DSP_POWEROFF_DELAY 10 * 1000 + */ +/* #define DSP_POWEROFF_DELAY 0 */ + +/* + * Some device variants (often T-Mobile) have a separate voice processing IC + * (Audience EarSmart xxx). + * This hooks into the voice call session and enables, configures and disables + * this extra firmware so RX/TX streams can be routed by the driver. + */ +/* #define AUDIENCE_EARSMART_IC */ + +#endif // SAMSUNG_AUDIO_H diff --git a/include/samsung_dtbh.h b/include/samsung_dtbh.h new file mode 100644 index 0000000..8f72e06 --- /dev/null +++ b/include/samsung_dtbh.h @@ -0,0 +1,46 @@ +/* tools/mkbootimg/samsung_dtbh.h +** +** Copyright 2017, The LineageOS Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +#ifndef _SAMSUNG_DTBH_H_ +#define _SAMSUNG_DTBH_H_ + +#define DTBH_MAGIC "DTBH" +#define DTBH_VERSION 2 +#define DTBH_PLATFORM "android" +#define DTBH_SUBTYPE "samsung" + /* Hardcoded entry */ +#define DTBH_PLATFORM_CODE 0x000050a6 +#define DTBH_SUBTYPE_CODE 0x217584da + +/* DTBH_MAGIC + DTBH_VERSION + DTB counts */ +#define DT_HEADER_PHYS_SIZE 12 + +/* model = "Samsung Galaxy Tab A LTE rev01 board based on Exynos7870"; + * model_info-chip = <7870>; + * model_info-platform = "android"; + * model_info-subtype = "samsung"; + * model_info-hw_rev = <2>; + * model_info-hw_rev_end = <3>; + * compatible = "samsung, Galaxy Tab A LTE 01", "samsung,exynos7870"; +*/ + +/* + * keep the eight uint32_t entries first in this struct so we can memcpy them to the file + */ +#define DT_ENTRY_PHYS_SIZE (sizeof(uint32_t) * 8) + +#endif // _SAMSUNG_DTBH_H_ diff --git a/include/telephony/ril.h b/include/telephony/ril.h new file mode 100644 index 0000000..dff9650 --- /dev/null +++ b/include/telephony/ril.h @@ -0,0 +1,7481 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_RIL_H +#define ANDROID_RIL_H 1 + +#include +#include +#include +#include +#include + +#ifndef FEATURE_UNIT_TEST +#include +#endif /* !FEATURE_UNIT_TEST */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SIM_COUNT +#if defined(ANDROID_SIM_COUNT_2) +#define SIM_COUNT 2 +#elif defined(ANDROID_SIM_COUNT_3) +#define SIM_COUNT 3 +#elif defined(ANDROID_SIM_COUNT_4) +#define SIM_COUNT 4 +#else +#define SIM_COUNT 1 +#endif + +#ifndef ANDROID_MULTI_SIM +#define SIM_COUNT 1 +#endif +#endif + +/* + * RIL version. + * Value of RIL_VERSION should not be changed in future. Here onwards, + * when a new change is supposed to be introduced which could involve new + * schemes added like Wakelocks, data structures added/updated, etc, we would + * just document RIL version associated with that change below. When OEM updates its + * RIL with those changes, they would return that new RIL version during RIL_REGISTER. + * We should make use of the returned version by vendor to identify appropriate scheme + * or data structure version to use. + * + * Documentation of RIL version and associated changes + * RIL_VERSION = 12 : This version corresponds to updated data structures namely + * RIL_Data_Call_Response_v11, RIL_SIM_IO_v6, RIL_CardStatus_v6, + * RIL_SimRefreshResponse_v7, RIL_CDMA_CallWaiting_v6, + * RIL_LTE_SignalStrength_v8, RIL_SignalStrength_v10, RIL_CellIdentityGsm_v12 + * RIL_CellIdentityWcdma_v12, RIL_CellIdentityLte_v12,RIL_CellInfoGsm_v12, + * RIL_CellInfoWcdma_v12, RIL_CellInfoLte_v12, RIL_CellInfo_v12. + * + * RIL_VERSION = 13 : This version includes new wakelock semantics and as the first + * strongly versioned version it enforces structure use. + * + * RIL_VERSION = 14 : New data structures are added, namely RIL_CarrierMatchType, + * RIL_Carrier, RIL_CarrierRestrictions and RIL_PCO_Data. + * New commands added: RIL_REQUEST_SET_CARRIER_RESTRICTIONS, + * RIL_REQUEST_SET_CARRIER_RESTRICTIONS and RIL_UNSOL_PCO_DATA. + * + * RIL_VERSION = 15 : New commands added: + * RIL_UNSOL_MODEM_RESTART, + * RIL_REQUEST_SEND_DEVICE_STATE, + * RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER, + * RIL_REQUEST_SET_SIM_CARD_POWER, + * RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION, + * RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION + * The new parameters for RIL_REQUEST_SETUP_DATA_CALL, + * Updated data structures: RIL_DataProfileInfo_v15, RIL_InitialAttachApn_v15 + * New data structure RIL_DataRegistrationStateResponse, + * RIL_VoiceRegistrationStateResponse same is + * used in RIL_REQUEST_DATA_REGISTRATION_STATE and + * RIL_REQUEST_VOICE_REGISTRATION_STATE respectively. + * New data structure RIL_OpenChannelParams. + * RIL_REQUEST_START_NETWORK_SCAN + * RIL_REQUEST_STOP_NETWORK_SCAN + * RIL_UNSOL_NETWORK_SCAN_RESULT + */ +#define RIL_VERSION 12 +#define LAST_IMPRECISE_RIL_VERSION 12 // Better self-documented name +#define RIL_VERSION_MIN 6 /* Minimum RIL_VERSION supported */ + +#define CDMA_ALPHA_INFO_BUFFER_LENGTH 64 +#define CDMA_NUMBER_INFO_BUFFER_LENGTH 81 + +#define MAX_RILDS 3 +#define MAX_SERVICE_NAME_LENGTH 6 +#define MAX_CLIENT_ID_LENGTH 2 +#define MAX_DEBUG_SOCKET_NAME_LENGTH 12 +#define MAX_QEMU_PIPE_NAME_LENGTH 11 +#define MAX_UUID_LENGTH 64 +#define MAX_BANDS 8 +#define MAX_CHANNELS 32 +#define MAX_RADIO_ACCESS_NETWORKS 8 + + +typedef void * RIL_Token; + +typedef enum { + RIL_SOCKET_1, +#if (SIM_COUNT >= 2) + RIL_SOCKET_2, +#if (SIM_COUNT >= 3) + RIL_SOCKET_3, +#endif +#if (SIM_COUNT >= 4) + RIL_SOCKET_4, +#endif +#endif + RIL_SOCKET_NUM +} RIL_SOCKET_ID; + + +typedef enum { + RIL_E_SUCCESS = 0, + RIL_E_RADIO_NOT_AVAILABLE = 1, /* If radio did not start or is resetting */ + RIL_E_GENERIC_FAILURE = 2, + RIL_E_PASSWORD_INCORRECT = 3, /* for PIN/PIN2 methods only! */ + RIL_E_SIM_PIN2 = 4, /* Operation requires SIM PIN2 to be entered */ + RIL_E_SIM_PUK2 = 5, /* Operation requires SIM PIN2 to be entered */ + RIL_E_REQUEST_NOT_SUPPORTED = 6, + RIL_E_CANCELLED = 7, + RIL_E_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8, /* data ops are not allowed during voice + call on a Class C GPRS device */ + RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9, /* data ops are not allowed before device + registers in network */ + RIL_E_SMS_SEND_FAIL_RETRY = 10, /* fail to send sms and need retry */ + RIL_E_SIM_ABSENT = 11, /* fail to set the location where CDMA subscription + shall be retrieved because of SIM or RUIM + card absent */ + RIL_E_SUBSCRIPTION_NOT_AVAILABLE = 12, /* fail to find CDMA subscription from specified + location */ + RIL_E_MODE_NOT_SUPPORTED = 13, /* HW does not support preferred network type */ + RIL_E_FDN_CHECK_FAILURE = 14, /* command failed because recipient is not on FDN list */ + RIL_E_ILLEGAL_SIM_OR_ME = 15, /* network selection failed due to + illegal SIM or ME */ + RIL_E_MISSING_RESOURCE = 16, /* no logical channel available */ + RIL_E_NO_SUCH_ELEMENT = 17, /* application not found on SIM */ + RIL_E_DIAL_MODIFIED_TO_USSD = 18, /* DIAL request modified to USSD */ + RIL_E_DIAL_MODIFIED_TO_SS = 19, /* DIAL request modified to SS */ + RIL_E_DIAL_MODIFIED_TO_DIAL = 20, /* DIAL request modified to DIAL with different + data */ + RIL_E_USSD_MODIFIED_TO_DIAL = 21, /* USSD request modified to DIAL */ + RIL_E_USSD_MODIFIED_TO_SS = 22, /* USSD request modified to SS */ + RIL_E_USSD_MODIFIED_TO_USSD = 23, /* USSD request modified to different USSD + request */ + RIL_E_SS_MODIFIED_TO_DIAL = 24, /* SS request modified to DIAL */ + RIL_E_SS_MODIFIED_TO_USSD = 25, /* SS request modified to USSD */ + RIL_E_SUBSCRIPTION_NOT_SUPPORTED = 26, /* Subscription not supported by RIL */ + RIL_E_SS_MODIFIED_TO_SS = 27, /* SS request modified to different SS request */ + RIL_E_LCE_NOT_SUPPORTED = 36, /* LCE service not supported(36 in RILConstants.java) */ + RIL_E_NO_MEMORY = 37, /* Not sufficient memory to process the request */ + RIL_E_INTERNAL_ERR = 38, /* Modem hit unexpected error scenario while handling + this request */ + RIL_E_SYSTEM_ERR = 39, /* Hit platform or system error */ + RIL_E_MODEM_ERR = 40, /* Vendor RIL got unexpected or incorrect response + from modem for this request */ + RIL_E_INVALID_STATE = 41, /* Unexpected request for the current state */ + RIL_E_NO_RESOURCES = 42, /* Not sufficient resource to process the request */ + RIL_E_SIM_ERR = 43, /* Received error from SIM card */ + RIL_E_INVALID_ARGUMENTS = 44, /* Received invalid arguments in request */ + RIL_E_INVALID_SIM_STATE = 45, /* Can not process the request in current SIM state */ + RIL_E_INVALID_MODEM_STATE = 46, /* Can not process the request in current Modem state */ + RIL_E_INVALID_CALL_ID = 47, /* Received invalid call id in request */ + RIL_E_NO_SMS_TO_ACK = 48, /* ACK received when there is no SMS to ack */ + RIL_E_NETWORK_ERR = 49, /* Received error from network */ + RIL_E_REQUEST_RATE_LIMITED = 50, /* Operation denied due to overly-frequent requests */ + RIL_E_SIM_BUSY = 51, /* SIM is busy */ + RIL_E_SIM_FULL = 52, /* The target EF is full */ + RIL_E_NETWORK_REJECT = 53, /* Request is rejected by network */ + RIL_E_OPERATION_NOT_ALLOWED = 54, /* Not allowed the request now */ + RIL_E_EMPTY_RECORD = 55, /* The request record is empty */ + RIL_E_INVALID_SMS_FORMAT = 56, /* Invalid sms format */ + RIL_E_ENCODING_ERR = 57, /* Message not encoded properly */ + RIL_E_INVALID_SMSC_ADDRESS = 58, /* SMSC address specified is invalid */ + RIL_E_NO_SUCH_ENTRY = 59, /* No such entry present to perform the request */ + RIL_E_NETWORK_NOT_READY = 60, /* Network is not ready to perform the request */ + RIL_E_NOT_PROVISIONED = 61, /* Device doesnot have this value provisioned */ + RIL_E_NO_SUBSCRIPTION = 62, /* Device doesnot have subscription */ + RIL_E_NO_NETWORK_FOUND = 63, /* Network cannot be found */ + RIL_E_DEVICE_IN_USE = 64, /* Operation cannot be performed because the device + is currently in use */ + RIL_E_ABORTED = 65, /* Operation aborted */ + RIL_E_INVALID_RESPONSE = 66, /* Invalid response sent by vendor code */ + // OEM specific error codes. To be used by OEM when they don't want to reveal + // specific error codes which would be replaced by Generic failure. + RIL_E_OEM_ERROR_1 = 501, + RIL_E_OEM_ERROR_2 = 502, + RIL_E_OEM_ERROR_3 = 503, + RIL_E_OEM_ERROR_4 = 504, + RIL_E_OEM_ERROR_5 = 505, + RIL_E_OEM_ERROR_6 = 506, + RIL_E_OEM_ERROR_7 = 507, + RIL_E_OEM_ERROR_8 = 508, + RIL_E_OEM_ERROR_9 = 509, + RIL_E_OEM_ERROR_10 = 510, + RIL_E_OEM_ERROR_11 = 511, + RIL_E_OEM_ERROR_12 = 512, + RIL_E_OEM_ERROR_13 = 513, + RIL_E_OEM_ERROR_14 = 514, + RIL_E_OEM_ERROR_15 = 515, + RIL_E_OEM_ERROR_16 = 516, + RIL_E_OEM_ERROR_17 = 517, + RIL_E_OEM_ERROR_18 = 518, + RIL_E_OEM_ERROR_19 = 519, + RIL_E_OEM_ERROR_20 = 520, + RIL_E_OEM_ERROR_21 = 521, + RIL_E_OEM_ERROR_22 = 522, + RIL_E_OEM_ERROR_23 = 523, + RIL_E_OEM_ERROR_24 = 524, + RIL_E_OEM_ERROR_25 = 525 +} RIL_Errno; + +typedef enum { + RIL_CALL_ACTIVE = 0, + RIL_CALL_HOLDING = 1, + RIL_CALL_DIALING = 2, /* MO call only */ + RIL_CALL_ALERTING = 3, /* MO call only */ + RIL_CALL_INCOMING = 4, /* MT call only */ + RIL_CALL_WAITING = 5 /* MT call only */ +} RIL_CallState; + +typedef enum { + RADIO_STATE_OFF = 0, /* Radio explictly powered off (eg CFUN=0) */ + RADIO_STATE_UNAVAILABLE = 1, /* Radio unavailable (eg, resetting or not booted) */ + /* States 2-9 below are deprecated. Just leaving them here for backward compatibility. */ + RADIO_STATE_SIM_NOT_READY = 2, /* Radio is on, but the SIM interface is not ready */ + RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3, /* SIM PIN locked, PUK required, network + personalization locked, or SIM absent */ + RADIO_STATE_SIM_READY = 4, /* Radio is on and SIM interface is available */ + RADIO_STATE_RUIM_NOT_READY = 5, /* Radio is on, but the RUIM interface is not ready */ + RADIO_STATE_RUIM_READY = 6, /* Radio is on and the RUIM interface is available */ + RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7, /* RUIM PIN locked, PUK required, network + personalization locked, or RUIM absent */ + RADIO_STATE_NV_NOT_READY = 8, /* Radio is on, but the NV interface is not available */ + RADIO_STATE_NV_READY = 9, /* Radio is on and the NV interface is available */ + RADIO_STATE_ON = 10 /* Radio is on */ +} RIL_RadioState; + +typedef enum { + RADIO_TECH_UNKNOWN = 0, + RADIO_TECH_GPRS = 1, + RADIO_TECH_EDGE = 2, + RADIO_TECH_UMTS = 3, + RADIO_TECH_IS95A = 4, + RADIO_TECH_IS95B = 5, + RADIO_TECH_1xRTT = 6, + RADIO_TECH_EVDO_0 = 7, + RADIO_TECH_EVDO_A = 8, + RADIO_TECH_HSDPA = 9, + RADIO_TECH_HSUPA = 10, + RADIO_TECH_HSPA = 11, + RADIO_TECH_EVDO_B = 12, + RADIO_TECH_EHRPD = 13, + RADIO_TECH_LTE = 14, + RADIO_TECH_HSPAP = 15, // HSPA+ + RADIO_TECH_GSM = 16, // Only supports voice + RADIO_TECH_TD_SCDMA = 17, + RADIO_TECH_IWLAN = 18, + RADIO_TECH_LTE_CA = 19 +} RIL_RadioTechnology; + +typedef enum { + RAF_UNKNOWN = (1 << RADIO_TECH_UNKNOWN), + RAF_GPRS = (1 << RADIO_TECH_GPRS), + RAF_EDGE = (1 << RADIO_TECH_EDGE), + RAF_UMTS = (1 << RADIO_TECH_UMTS), + RAF_IS95A = (1 << RADIO_TECH_IS95A), + RAF_IS95B = (1 << RADIO_TECH_IS95B), + RAF_1xRTT = (1 << RADIO_TECH_1xRTT), + RAF_EVDO_0 = (1 << RADIO_TECH_EVDO_0), + RAF_EVDO_A = (1 << RADIO_TECH_EVDO_A), + RAF_HSDPA = (1 << RADIO_TECH_HSDPA), + RAF_HSUPA = (1 << RADIO_TECH_HSUPA), + RAF_HSPA = (1 << RADIO_TECH_HSPA), + RAF_EVDO_B = (1 << RADIO_TECH_EVDO_B), + RAF_EHRPD = (1 << RADIO_TECH_EHRPD), + RAF_LTE = (1 << RADIO_TECH_LTE), + RAF_HSPAP = (1 << RADIO_TECH_HSPAP), + RAF_GSM = (1 << RADIO_TECH_GSM), + RAF_TD_SCDMA = (1 << RADIO_TECH_TD_SCDMA), + RAF_LTE_CA = (1 << RADIO_TECH_LTE_CA) +} RIL_RadioAccessFamily; + +typedef enum { + BAND_MODE_UNSPECIFIED = 0, //"unspecified" (selected by baseband automatically) + BAND_MODE_EURO = 1, //"EURO band" (GSM-900 / DCS-1800 / WCDMA-IMT-2000) + BAND_MODE_USA = 2, //"US band" (GSM-850 / PCS-1900 / WCDMA-850 / WCDMA-PCS-1900) + BAND_MODE_JPN = 3, //"JPN band" (WCDMA-800 / WCDMA-IMT-2000) + BAND_MODE_AUS = 4, //"AUS band" (GSM-900 / DCS-1800 / WCDMA-850 / WCDMA-IMT-2000) + BAND_MODE_AUS_2 = 5, //"AUS band 2" (GSM-900 / DCS-1800 / WCDMA-850) + BAND_MODE_CELL_800 = 6, //"Cellular" (800-MHz Band) + BAND_MODE_PCS = 7, //"PCS" (1900-MHz Band) + BAND_MODE_JTACS = 8, //"Band Class 3" (JTACS Band) + BAND_MODE_KOREA_PCS = 9, //"Band Class 4" (Korean PCS Band) + BAND_MODE_5_450M = 10, //"Band Class 5" (450-MHz Band) + BAND_MODE_IMT2000 = 11, //"Band Class 6" (2-GMHz IMT2000 Band) + BAND_MODE_7_700M_2 = 12, //"Band Class 7" (Upper 700-MHz Band) + BAND_MODE_8_1800M = 13, //"Band Class 8" (1800-MHz Band) + BAND_MODE_9_900M = 14, //"Band Class 9" (900-MHz Band) + BAND_MODE_10_800M_2 = 15, //"Band Class 10" (Secondary 800-MHz Band) + BAND_MODE_EURO_PAMR_400M = 16, //"Band Class 11" (400-MHz European PAMR Band) + BAND_MODE_AWS = 17, //"Band Class 15" (AWS Band) + BAND_MODE_USA_2500M = 18 //"Band Class 16" (US 2.5-GHz Band) +} RIL_RadioBandMode; + +typedef enum { + RC_PHASE_CONFIGURED = 0, // LM is configured is initial value and value after FINISH completes + RC_PHASE_START = 1, // START is sent before Apply and indicates that an APPLY will be + // forthcoming with these same parameters + RC_PHASE_APPLY = 2, // APPLY is sent after all LM's receive START and returned + // RIL_RadioCapability.status = 0, if any START's fail no + // APPLY will be sent + RC_PHASE_UNSOL_RSP = 3, // UNSOL_RSP is sent with RIL_UNSOL_RADIO_CAPABILITY + RC_PHASE_FINISH = 4 // FINISH is sent after all commands have completed. If an error + // occurs in any previous command the RIL_RadioAccessesFamily and + // logicalModemUuid fields will be the prior configuration thus + // restoring the configuration to the previous value. An error + // returned by this command will generally be ignored or may + // cause that logical modem to be removed from service. +} RadioCapabilityPhase; + +typedef enum { + RC_STATUS_NONE = 0, // This parameter has no meaning with RC_PHASE_START, + // RC_PHASE_APPLY + RC_STATUS_SUCCESS = 1, // Tell modem the action transaction of set radio + // capability was success with RC_PHASE_FINISH + RC_STATUS_FAIL = 2, // Tell modem the action transaction of set radio + // capability is fail with RC_PHASE_FINISH. +} RadioCapabilityStatus; + +#define RIL_RADIO_CAPABILITY_VERSION 1 +typedef struct { + int version; // Version of structure, RIL_RADIO_CAPABILITY_VERSION + int session; // Unique session value defined by framework returned in all "responses/unsol" + int phase; // CONFIGURED, START, APPLY, FINISH + int rat; // RIL_RadioAccessFamily for the radio + char logicalModemUuid[MAX_UUID_LENGTH]; // A UUID typically "com.xxxx.lmX where X is the logical modem. + int status; // Return status and an input parameter for RC_PHASE_FINISH +} RIL_RadioCapability; + +// Do we want to split Data from Voice and the use +// RIL_RadioTechnology for get/setPreferredVoice/Data ? +typedef enum { + PREF_NET_TYPE_GSM_WCDMA = 0, /* GSM/WCDMA (WCDMA preferred) */ + PREF_NET_TYPE_GSM_ONLY = 1, /* GSM only */ + PREF_NET_TYPE_WCDMA = 2, /* WCDMA */ + PREF_NET_TYPE_GSM_WCDMA_AUTO = 3, /* GSM/WCDMA (auto mode, according to PRL) */ + PREF_NET_TYPE_CDMA_EVDO_AUTO = 4, /* CDMA and EvDo (auto mode, according to PRL) */ + PREF_NET_TYPE_CDMA_ONLY = 5, /* CDMA only */ + PREF_NET_TYPE_EVDO_ONLY = 6, /* EvDo only */ + PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7, /* GSM/WCDMA, CDMA, and EvDo (auto mode, according to PRL) */ + PREF_NET_TYPE_LTE_CDMA_EVDO = 8, /* LTE, CDMA and EvDo */ + PREF_NET_TYPE_LTE_GSM_WCDMA = 9, /* LTE, GSM/WCDMA */ + PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10, /* LTE, CDMA, EvDo, GSM/WCDMA */ + PREF_NET_TYPE_LTE_ONLY = 11, /* LTE only */ + PREF_NET_TYPE_LTE_WCDMA = 12, /* LTE/WCDMA */ + PREF_NET_TYPE_TD_SCDMA_ONLY = 13, /* TD-SCDMA only */ + PREF_NET_TYPE_TD_SCDMA_WCDMA = 14, /* TD-SCDMA and WCDMA */ + PREF_NET_TYPE_TD_SCDMA_LTE = 15, /* TD-SCDMA and LTE */ + PREF_NET_TYPE_TD_SCDMA_GSM = 16, /* TD-SCDMA and GSM */ + PREF_NET_TYPE_TD_SCDMA_GSM_LTE = 17, /* TD-SCDMA,GSM and LTE */ + PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA = 18, /* TD-SCDMA, GSM/WCDMA */ + PREF_NET_TYPE_TD_SCDMA_WCDMA_LTE = 19, /* TD-SCDMA, WCDMA and LTE */ + PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_LTE = 20, /* TD-SCDMA, GSM/WCDMA and LTE */ + PREF_NET_TYPE_TD_SCDMA_GSM_WCDMA_CDMA_EVDO_AUTO = 21, /* TD-SCDMA, GSM/WCDMA, CDMA and EvDo */ + PREF_NET_TYPE_TD_SCDMA_LTE_CDMA_EVDO_GSM_WCDMA = 22 /* TD-SCDMA, LTE, CDMA, EvDo GSM/WCDMA */ +} RIL_PreferredNetworkType; + +/* Source for cdma subscription */ +typedef enum { + CDMA_SUBSCRIPTION_SOURCE_RUIM_SIM = 0, + CDMA_SUBSCRIPTION_SOURCE_NV = 1 +} RIL_CdmaSubscriptionSource; + +/* User-to-User signaling Info activation types derived from 3GPP 23.087 v8.0 */ +typedef enum { + RIL_UUS_TYPE1_IMPLICIT = 0, + RIL_UUS_TYPE1_REQUIRED = 1, + RIL_UUS_TYPE1_NOT_REQUIRED = 2, + RIL_UUS_TYPE2_REQUIRED = 3, + RIL_UUS_TYPE2_NOT_REQUIRED = 4, + RIL_UUS_TYPE3_REQUIRED = 5, + RIL_UUS_TYPE3_NOT_REQUIRED = 6 +} RIL_UUS_Type; + +/* User-to-User Signaling Information data coding schemes. Possible values for + * Octet 3 (Protocol Discriminator field) in the UUIE. The values have been + * specified in section 10.5.4.25 of 3GPP TS 24.008 */ +typedef enum { + RIL_UUS_DCS_USP = 0, /* User specified protocol */ + RIL_UUS_DCS_OSIHLP = 1, /* OSI higher layer protocol */ + RIL_UUS_DCS_X244 = 2, /* X.244 */ + RIL_UUS_DCS_RMCF = 3, /* Reserved for system mangement + convergence function */ + RIL_UUS_DCS_IA5c = 4 /* IA5 characters */ +} RIL_UUS_DCS; + +/* User-to-User Signaling Information defined in 3GPP 23.087 v8.0 + * This data is passed in RIL_ExtensionRecord and rec contains this + * structure when type is RIL_UUS_INFO_EXT_REC */ +typedef struct { + RIL_UUS_Type uusType; /* UUS Type */ + RIL_UUS_DCS uusDcs; /* UUS Data Coding Scheme */ + int uusLength; /* Length of UUS Data */ + char * uusData; /* UUS Data */ +} RIL_UUS_Info; + +/* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5 */ +typedef struct { + char isPresent; /* non-zero if signal information record is present */ + char signalType; /* as defined 3.7.5.5-1 */ + char alertPitch; /* as defined 3.7.5.5-2 */ + char signal; /* as defined 3.7.5.5-3, 3.7.5.5-4 or 3.7.5.5-5 */ +} RIL_CDMA_SignalInfoRecord; + +typedef struct { + RIL_CallState state; + int index; /* Connection Index for use with, eg, AT+CHLD */ + int toa; /* type of address, eg 145 = intl */ + char isMpty; /* nonzero if is mpty call */ + char isMT; /* nonzero if call is mobile terminated */ + char als; /* ALS line indicator if available + (0 = line 1) */ + char isVoice; /* nonzero if this is is a voice call */ + char isVoicePrivacy; /* nonzero if CDMA voice privacy mode is active */ + char * number; /* Remote party number */ + int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ + char * name; /* Remote party name */ + int namePresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown 3=Payphone */ + RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */ +} RIL_Call; + +/* Deprecated, use RIL_Data_Call_Response_v6 */ +typedef struct { + int cid; /* Context ID, uniquely identifies this call */ + int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ + char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. + For example, "IP", "IPV6", "IPV4V6", or "PPP". */ + char * apn; /* ignored */ + char * address; /* An address, e.g., "192.0.1.3" or "2001:db8::1". */ +} RIL_Data_Call_Response_v4; + +/* + * Returned by RIL_REQUEST_SETUP_DATA_CALL, RIL_REQUEST_DATA_CALL_LIST + * and RIL_UNSOL_DATA_CALL_LIST_CHANGED, on error status != 0. + */ +typedef struct { + int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */ + int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry + back-off timer value RIL wants to override the one + pre-configured in FW. + The unit is miliseconds. + The value < 0 means no value is suggested. + The value 0 means retry should be done ASAP. + The value of INT_MAX(0x7fffffff) means no retry. */ + int cid; /* Context ID, uniquely identifies this call */ + int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ + char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. + For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is + PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported + such as "IP" or "IPV6" */ + char * ifname; /* The network interface name */ + char * addresses; /* A space-delimited list of addresses with optional "/" prefix length, + e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". + May not be empty, typically 1 IPv4 or 1 IPv6 or + one of each. If the prefix length is absent the addresses + are assumed to be point to point with IPv4 having a prefix + length of 32 and IPv6 128. */ + char * dnses; /* A space-delimited list of DNS server addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty. */ + char * gateways; /* A space-delimited list of default gateway addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty in which case the addresses represent point + to point connections. */ +} RIL_Data_Call_Response_v6; + +typedef struct { + int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */ + int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry + back-off timer value RIL wants to override the one + pre-configured in FW. + The unit is miliseconds. + The value < 0 means no value is suggested. + The value 0 means retry should be done ASAP. + The value of INT_MAX(0x7fffffff) means no retry. */ + int cid; /* Context ID, uniquely identifies this call */ + int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ + char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. + For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is + PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported + such as "IP" or "IPV6" */ + char * ifname; /* The network interface name */ + char * addresses; /* A space-delimited list of addresses with optional "/" prefix length, + e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". + May not be empty, typically 1 IPv4 or 1 IPv6 or + one of each. If the prefix length is absent the addresses + are assumed to be point to point with IPv4 having a prefix + length of 32 and IPv6 128. */ + char * dnses; /* A space-delimited list of DNS server addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty. */ + char * gateways; /* A space-delimited list of default gateway addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty in which case the addresses represent point + to point connections. */ + char * pcscf; /* the Proxy Call State Control Function address + via PCO(Protocol Configuration Option) for IMS client. */ +} RIL_Data_Call_Response_v9; + +typedef struct { + int status; /* A RIL_DataCallFailCause, 0 which is PDP_FAIL_NONE if no error */ + int suggestedRetryTime; /* If status != 0, this fields indicates the suggested retry + back-off timer value RIL wants to override the one + pre-configured in FW. + The unit is miliseconds. + The value < 0 means no value is suggested. + The value 0 means retry should be done ASAP. + The value of INT_MAX(0x7fffffff) means no retry. */ + int cid; /* Context ID, uniquely identifies this call */ + int active; /* 0=inactive, 1=active/physical link down, 2=active/physical link up */ + char * type; /* One of the PDP_type values in TS 27.007 section 10.1.1. + For example, "IP", "IPV6", "IPV4V6", or "PPP". If status is + PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED this is the type supported + such as "IP" or "IPV6" */ + char * ifname; /* The network interface name */ + char * addresses; /* A space-delimited list of addresses with optional "/" prefix length, + e.g., "192.0.1.3" or "192.0.1.11/16 2001:db8::1/64". + May not be empty, typically 1 IPv4 or 1 IPv6 or + one of each. If the prefix length is absent the addresses + are assumed to be point to point with IPv4 having a prefix + length of 32 and IPv6 128. */ + char * dnses; /* A space-delimited list of DNS server addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty. */ + char * gateways; /* A space-delimited list of default gateway addresses, + e.g., "192.0.1.3" or "192.0.1.11 2001:db8::1". + May be empty in which case the addresses represent point + to point connections. */ + char * pcscf; /* the Proxy Call State Control Function address + via PCO(Protocol Configuration Option) for IMS client. */ + int mtu; /* MTU received from network + Value <= 0 means network has either not sent a value or + sent an invalid value */ +} RIL_Data_Call_Response_v11; + +typedef enum { + RADIO_TECH_3GPP = 1, /* 3GPP Technologies - GSM, WCDMA */ + RADIO_TECH_3GPP2 = 2 /* 3GPP2 Technologies - CDMA */ +} RIL_RadioTechnologyFamily; + +typedef struct { + RIL_RadioTechnologyFamily tech; + unsigned char retry; /* 0 == not retry, nonzero == retry */ + int messageRef; /* Valid field if retry is set to nonzero. + Contains messageRef from RIL_SMS_Response + corresponding to failed MO SMS. + */ + + union { + /* Valid field if tech is RADIO_TECH_3GPP2. See RIL_REQUEST_CDMA_SEND_SMS */ + RIL_CDMA_SMS_Message* cdmaMessage; + + /* Valid field if tech is RADIO_TECH_3GPP. See RIL_REQUEST_SEND_SMS */ + char** gsmMessage; /* This is an array of pointers where pointers + are contiguous but elements pointed by those pointers + are not contiguous + */ + } message; +} RIL_IMS_SMS_Message; + +typedef struct { + int messageRef; /* TP-Message-Reference for GSM, + and BearerData MessageId for CDMA + (See 3GPP2 C.S0015-B, v2.0, table 4.5-1). */ + char *ackPDU; /* or NULL if n/a */ + int errorCode; /* See 3GPP 27.005, 3.2.5 for GSM/UMTS, + 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA, + -1 if unknown or not applicable*/ +} RIL_SMS_Response; + +/** Used by RIL_REQUEST_WRITE_SMS_TO_SIM */ +typedef struct { + int status; /* Status of message. See TS 27.005 3.1, "": */ + /* 0 = "REC UNREAD" */ + /* 1 = "REC READ" */ + /* 2 = "STO UNSENT" */ + /* 3 = "STO SENT" */ + char * pdu; /* PDU of message to write, as an ASCII hex string less the SMSC address, + the TP-layer length is "strlen(pdu)/2". */ + char * smsc; /* SMSC address in GSM BCD format prefixed by a length byte + (as expected by TS 27.005) or NULL for default SMSC */ +} RIL_SMS_WriteArgs; + +/** Used by RIL_REQUEST_DIAL */ +typedef struct { + char * address; + int clir; + /* (same as 'n' paremeter in TS 27.007 7.7 "+CLIR" + * clir == 0 on "use subscription default value" + * clir == 1 on "CLIR invocation" (restrict CLI presentation) + * clir == 2 on "CLIR suppression" (allow CLI presentation) + */ + RIL_UUS_Info * uusInfo; /* NULL or Pointer to User-User Signaling Information */ +} RIL_Dial; + +typedef struct { + int cla; /* OnePlus - For NFC e-wallet */ + int command; /* one of the commands listed for TS 27.007 +CRSM*/ + int fileid; /* EF id */ + char *path; /* "pathid" from TS 27.007 +CRSM command. + Path is in hex asciii format eg "7f205f70" + Path must always be provided. + */ + int p1; + int p2; + int p3; + char *data; /* May be NULL*/ + char *pin2; /* May be NULL*/ +} RIL_SIM_IO_v5; + +typedef struct { + int cla; /* OnePlus - For NFC e-wallet */ + int command; /* one of the commands listed for TS 27.007 +CRSM*/ + int fileid; /* EF id */ + char *path; /* "pathid" from TS 27.007 +CRSM command. + Path is in hex asciii format eg "7f205f70" + Path must always be provided. + */ + int p1; + int p2; + int p3; + char *data; /* May be NULL*/ + char *pin2; /* May be NULL*/ + char *aidPtr; /* AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. */ +} RIL_SIM_IO_v6; + +/* Used by RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL and + * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC. */ +typedef struct { + int sessionid; /* "sessionid" from TS 27.007 +CGLA command. Should be + ignored for +CSIM command. */ + + /* Following fields are used to derive the APDU ("command" and "length" + values in TS 27.007 +CSIM and +CGLA commands). */ + int cla; + int instruction; + int p1; + int p2; + int p3; /* A negative P3 implies a 4 byte APDU. */ + char *data; /* May be NULL. In hex string format. */ +} RIL_SIM_APDU; + +typedef struct { + int sw1; + int sw2; + char *simResponse; /* In hex string format ([a-fA-F0-9]*), except for SIM_AUTHENTICATION + response for which it is in Base64 format, see 3GPP TS 31.102 7.1.2 */ +} RIL_SIM_IO_Response; + +/* See also com.android.internal.telephony.gsm.CallForwardInfo */ + +typedef struct { + int status; /* + * For RIL_REQUEST_QUERY_CALL_FORWARD_STATUS + * status 1 = active, 0 = not active + * + * For RIL_REQUEST_SET_CALL_FORWARD: + * status is: + * 0 = disable + * 1 = enable + * 2 = interrogate + * 3 = registeration + * 4 = erasure + */ + + int reason; /* from TS 27.007 7.11 "reason" */ + int serviceClass;/* From 27.007 +CCFC/+CLCK "class" + See table for Android mapping from + MMI service code + 0 means user doesn't input class */ + int toa; /* "type" from TS 27.007 7.11 */ + char * number; /* "number" from TS 27.007 7.11. May be NULL */ + int timeSeconds; /* for CF no reply only */ + char * startTime; /* SEC addition */ + char * endTime; /* SEC addition */ +}RIL_CallForwardInfo; + +typedef struct { + char * cid; /* Combination of LAC and Cell Id in 32 bits in GSM. + * Upper 16 bits is LAC and lower 16 bits + * is CID (as described in TS 27.005) + * Primary Scrambling Code (as described in TS 25.331) + * in 9 bits in UMTS + * Valid values are hexadecimal 0x0000 - 0xffffffff. + */ + int rssi; /* Received RSSI in GSM, + * Level index of CPICH Received Signal Code Power in UMTS + */ +} RIL_NeighboringCell; + +typedef struct { + char lce_status; /* LCE service status: + * -1 = not supported; + * 0 = stopped; + * 1 = active. + */ + unsigned int actual_interval_ms; /* actual LCE reporting interval, + * meaningful only if LCEStatus = 1. + */ +} RIL_LceStatusInfo; + +typedef struct { + unsigned int last_hop_capacity_kbps; /* last-hop cellular capacity: kilobits/second. */ + unsigned char confidence_level; /* capacity estimate confidence: 0-100 */ + unsigned char lce_suspended; /* LCE report going to be suspended? (e.g., radio + * moves to inactive state or network type change) + * 1 = suspended; + * 0 = not suspended. + */ +} RIL_LceDataInfo; + +typedef enum { + RIL_MATCH_ALL = 0, /* Apply to all carriers with the same mcc/mnc */ + RIL_MATCH_SPN = 1, /* Use SPN and mcc/mnc to identify the carrier */ + RIL_MATCH_IMSI_PREFIX = 2, /* Use IMSI prefix and mcc/mnc to identify the carrier */ + RIL_MATCH_GID1 = 3, /* Use GID1 and mcc/mnc to identify the carrier */ + RIL_MATCH_GID2 = 4, /* Use GID2 and mcc/mnc to identify the carrier */ +} RIL_CarrierMatchType; + +typedef struct { + const char * mcc; + const char * mnc; + RIL_CarrierMatchType match_type; /* Specify match type for the carrier. + * If it’s RIL_MATCH_ALL, match_data is null; + * otherwise, match_data is the value for the match type. + */ + const char * match_data; +} RIL_Carrier; + +typedef struct { + int32_t len_allowed_carriers; /* length of array allowed_carriers */ + int32_t len_excluded_carriers; /* length of array excluded_carriers */ + RIL_Carrier * allowed_carriers; /* whitelist for allowed carriers */ + RIL_Carrier * excluded_carriers; /* blacklist for explicitly excluded carriers + * which match allowed_carriers. Eg. allowed_carriers match + * mcc/mnc, excluded_carriers has same mcc/mnc and gid1 + * is ABCD. It means except the carrier whose gid1 is ABCD, + * all carriers with the same mcc/mnc are allowed. + */ +} RIL_CarrierRestrictions; + +typedef struct { + char * mcc; /* MCC of the Carrier. */ + char * mnc ; /* MNC of the Carrier. */ + uint8_t * carrierKey; /* Public Key from the Carrier used to encrypt the + * IMSI/IMPI. + */ + int32_t carrierKeyLength; /* Length of the Public Key. */ + char * keyIdentifier; /* The keyIdentifier Attribute value pair that helps + * a server locate the private key to decrypt the + * permanent identity. + */ + int64_t expirationTime; /* Date-Time (in UTC) when the key will expire. */ + +} RIL_CarrierInfoForImsiEncryption; + +/* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */ +typedef enum { + CALL_FAIL_UNOBTAINABLE_NUMBER = 1, + CALL_FAIL_NO_ROUTE_TO_DESTINATION = 3, + CALL_FAIL_CHANNEL_UNACCEPTABLE = 6, + CALL_FAIL_OPERATOR_DETERMINED_BARRING = 8, + CALL_FAIL_NORMAL = 16, + CALL_FAIL_BUSY = 17, + CALL_FAIL_NO_USER_RESPONDING = 18, + CALL_FAIL_NO_ANSWER_FROM_USER = 19, + CALL_FAIL_CALL_REJECTED = 21, + CALL_FAIL_NUMBER_CHANGED = 22, + CALL_FAIL_PREEMPTION = 25, + CALL_FAIL_DESTINATION_OUT_OF_ORDER = 27, + CALL_FAIL_INVALID_NUMBER_FORMAT = 28, + CALL_FAIL_FACILITY_REJECTED = 29, + CALL_FAIL_RESP_TO_STATUS_ENQUIRY = 30, + CALL_FAIL_NORMAL_UNSPECIFIED = 31, + CALL_FAIL_CONGESTION = 34, + CALL_FAIL_NETWORK_OUT_OF_ORDER = 38, + CALL_FAIL_TEMPORARY_FAILURE = 41, + CALL_FAIL_SWITCHING_EQUIPMENT_CONGESTION = 42, + CALL_FAIL_ACCESS_INFORMATION_DISCARDED = 43, + CALL_FAIL_REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44, + CALL_FAIL_RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47, + CALL_FAIL_QOS_UNAVAILABLE = 49, + CALL_FAIL_REQUESTED_FACILITY_NOT_SUBSCRIBED = 50, + CALL_FAIL_INCOMING_CALLS_BARRED_WITHIN_CUG = 55, + CALL_FAIL_BEARER_CAPABILITY_NOT_AUTHORIZED = 57, + CALL_FAIL_BEARER_CAPABILITY_UNAVAILABLE = 58, + CALL_FAIL_SERVICE_OPTION_NOT_AVAILABLE = 63, + CALL_FAIL_BEARER_SERVICE_NOT_IMPLEMENTED = 65, + CALL_FAIL_ACM_LIMIT_EXCEEDED = 68, + CALL_FAIL_REQUESTED_FACILITY_NOT_IMPLEMENTED = 69, + CALL_FAIL_ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70, + CALL_FAIL_SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79, + CALL_FAIL_INVALID_TRANSACTION_IDENTIFIER = 81, + CALL_FAIL_USER_NOT_MEMBER_OF_CUG = 87, + CALL_FAIL_INCOMPATIBLE_DESTINATION = 88, + CALL_FAIL_INVALID_TRANSIT_NW_SELECTION = 91, + CALL_FAIL_SEMANTICALLY_INCORRECT_MESSAGE = 95, + CALL_FAIL_INVALID_MANDATORY_INFORMATION = 96, + CALL_FAIL_MESSAGE_TYPE_NON_IMPLEMENTED = 97, + CALL_FAIL_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98, + CALL_FAIL_INFORMATION_ELEMENT_NON_EXISTENT = 99, + CALL_FAIL_CONDITIONAL_IE_ERROR = 100, + CALL_FAIL_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101, + CALL_FAIL_RECOVERY_ON_TIMER_EXPIRED = 102, + CALL_FAIL_PROTOCOL_ERROR_UNSPECIFIED = 111, + CALL_FAIL_INTERWORKING_UNSPECIFIED = 127, + CALL_FAIL_CALL_BARRED = 240, + CALL_FAIL_FDN_BLOCKED = 241, + CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242, + CALL_FAIL_IMEI_NOT_ACCEPTED = 243, + CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244, /* STK Call Control */ + CALL_FAIL_DIAL_MODIFIED_TO_SS = 245, + CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246, + CALL_FAIL_RADIO_OFF = 247, /* Radio is OFF */ + CALL_FAIL_OUT_OF_SERVICE = 248, /* No cellular coverage */ + CALL_FAIL_NO_VALID_SIM = 249, /* No valid SIM is present */ + CALL_FAIL_RADIO_INTERNAL_ERROR = 250, /* Internal error at Modem */ + CALL_FAIL_NETWORK_RESP_TIMEOUT = 251, /* No response from network */ + CALL_FAIL_NETWORK_REJECT = 252, /* Explicit network reject */ + CALL_FAIL_RADIO_ACCESS_FAILURE = 253, /* RRC connection failure. Eg.RACH */ + CALL_FAIL_RADIO_LINK_FAILURE = 254, /* Radio Link Failure */ + CALL_FAIL_RADIO_LINK_LOST = 255, /* Radio link lost due to poor coverage */ + CALL_FAIL_RADIO_UPLINK_FAILURE = 256, /* Radio uplink failure */ + CALL_FAIL_RADIO_SETUP_FAILURE = 257, /* RRC connection setup failure */ + CALL_FAIL_RADIO_RELEASE_NORMAL = 258, /* RRC connection release, normal */ + CALL_FAIL_RADIO_RELEASE_ABNORMAL = 259, /* RRC connection release, abnormal */ + CALL_FAIL_ACCESS_CLASS_BLOCKED = 260, /* Access class barring */ + CALL_FAIL_NETWORK_DETACH = 261, /* Explicit network detach */ + CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE = 1000, + CALL_FAIL_CDMA_DROP = 1001, + CALL_FAIL_CDMA_INTERCEPT = 1002, + CALL_FAIL_CDMA_REORDER = 1003, + CALL_FAIL_CDMA_SO_REJECT = 1004, + CALL_FAIL_CDMA_RETRY_ORDER = 1005, + CALL_FAIL_CDMA_ACCESS_FAILURE = 1006, + CALL_FAIL_CDMA_PREEMPTED = 1007, + CALL_FAIL_CDMA_NOT_EMERGENCY = 1008, /* For non-emergency number dialed + during emergency callback mode */ + CALL_FAIL_CDMA_ACCESS_BLOCKED = 1009, /* CDMA network access probes blocked */ + + /* OEM specific error codes. Used to distinguish error from + * CALL_FAIL_ERROR_UNSPECIFIED and help assist debugging */ + CALL_FAIL_OEM_CAUSE_1 = 0xf001, + CALL_FAIL_OEM_CAUSE_2 = 0xf002, + CALL_FAIL_OEM_CAUSE_3 = 0xf003, + CALL_FAIL_OEM_CAUSE_4 = 0xf004, + CALL_FAIL_OEM_CAUSE_5 = 0xf005, + CALL_FAIL_OEM_CAUSE_6 = 0xf006, + CALL_FAIL_OEM_CAUSE_7 = 0xf007, + CALL_FAIL_OEM_CAUSE_8 = 0xf008, + CALL_FAIL_OEM_CAUSE_9 = 0xf009, + CALL_FAIL_OEM_CAUSE_10 = 0xf00a, + CALL_FAIL_OEM_CAUSE_11 = 0xf00b, + CALL_FAIL_OEM_CAUSE_12 = 0xf00c, + CALL_FAIL_OEM_CAUSE_13 = 0xf00d, + CALL_FAIL_OEM_CAUSE_14 = 0xf00e, + CALL_FAIL_OEM_CAUSE_15 = 0xf00f, + + CALL_FAIL_ERROR_UNSPECIFIED = 0xffff /* This error will be deprecated soon, + vendor code should make sure to map error + code to specific error */ +} RIL_LastCallFailCause; + +typedef struct { + RIL_LastCallFailCause cause_code; + char * vendor_cause; +} RIL_LastCallFailCauseInfo; + +/* See RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE */ +typedef enum { + PDP_FAIL_NONE = 0, /* No error, connection ok */ + + /* an integer cause code defined in TS 24.008 + section 6.1.3.1.3 or TS 24.301 Release 8+ Annex B. + If the implementation does not have access to the exact cause codes, + then it should return one of the following values, + as the UI layer needs to distinguish these + cases for error notification and potential retries. */ + PDP_FAIL_OPERATOR_BARRED = 0x08, /* no retry */ + PDP_FAIL_NAS_SIGNALLING = 0x0E, + PDP_FAIL_LLC_SNDCP = 0x19, + PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A, + PDP_FAIL_MISSING_UKNOWN_APN = 0x1B, /* no retry */ + PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C, /* no retry */ + PDP_FAIL_USER_AUTHENTICATION = 0x1D, /* no retry */ + PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E, /* no retry */ + PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F, + PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20, /* no retry */ + PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21, /* no retry */ + PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22, + PDP_FAIL_NSAPI_IN_USE = 0x23, /* no retry */ + PDP_FAIL_REGULAR_DEACTIVATION = 0x24, /* possibly restart radio, + based on framework config */ + PDP_FAIL_QOS_NOT_ACCEPTED = 0x25, + PDP_FAIL_NETWORK_FAILURE = 0x26, + PDP_FAIL_UMTS_REACTIVATION_REQ = 0x27, + PDP_FAIL_FEATURE_NOT_SUPP = 0x28, + PDP_FAIL_TFT_SEMANTIC_ERROR = 0x29, + PDP_FAIL_TFT_SYTAX_ERROR = 0x2A, + PDP_FAIL_UNKNOWN_PDP_CONTEXT = 0x2B, + PDP_FAIL_FILTER_SEMANTIC_ERROR = 0x2C, + PDP_FAIL_FILTER_SYTAX_ERROR = 0x2D, + PDP_FAIL_PDP_WITHOUT_ACTIVE_TFT = 0x2E, + PDP_FAIL_ONLY_IPV4_ALLOWED = 0x32, /* no retry */ + PDP_FAIL_ONLY_IPV6_ALLOWED = 0x33, /* no retry */ + PDP_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34, + PDP_FAIL_ESM_INFO_NOT_RECEIVED = 0x35, + PDP_FAIL_PDN_CONN_DOES_NOT_EXIST = 0x36, + PDP_FAIL_MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37, + PDP_FAIL_MAX_ACTIVE_PDP_CONTEXT_REACHED = 0x41, + PDP_FAIL_UNSUPPORTED_APN_IN_CURRENT_PLMN = 0x42, + PDP_FAIL_INVALID_TRANSACTION_ID = 0x51, + PDP_FAIL_MESSAGE_INCORRECT_SEMANTIC = 0x5F, + PDP_FAIL_INVALID_MANDATORY_INFO = 0x60, + PDP_FAIL_MESSAGE_TYPE_UNSUPPORTED = 0x61, + PDP_FAIL_MSG_TYPE_NONCOMPATIBLE_STATE = 0x62, + PDP_FAIL_UNKNOWN_INFO_ELEMENT = 0x63, + PDP_FAIL_CONDITIONAL_IE_ERROR = 0x64, + PDP_FAIL_MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 0x65, + PDP_FAIL_PROTOCOL_ERRORS = 0x6F, /* no retry */ + PDP_FAIL_APN_TYPE_CONFLICT = 0x70, + PDP_FAIL_INVALID_PCSCF_ADDR = 0x71, + PDP_FAIL_INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 0x72, + PDP_FAIL_EMM_ACCESS_BARRED = 0x73, + PDP_FAIL_EMERGENCY_IFACE_ONLY = 0x74, + PDP_FAIL_IFACE_MISMATCH = 0x75, + PDP_FAIL_COMPANION_IFACE_IN_USE = 0x76, + PDP_FAIL_IP_ADDRESS_MISMATCH = 0x77, + PDP_FAIL_IFACE_AND_POL_FAMILY_MISMATCH = 0x78, + PDP_FAIL_EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79, + PDP_FAIL_AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A, + + // OEM specific error codes. To be used by OEMs when they don't want to + // reveal error code which would be replaced by PDP_FAIL_ERROR_UNSPECIFIED + PDP_FAIL_OEM_DCFAILCAUSE_1 = 0x1001, + PDP_FAIL_OEM_DCFAILCAUSE_2 = 0x1002, + PDP_FAIL_OEM_DCFAILCAUSE_3 = 0x1003, + PDP_FAIL_OEM_DCFAILCAUSE_4 = 0x1004, + PDP_FAIL_OEM_DCFAILCAUSE_5 = 0x1005, + PDP_FAIL_OEM_DCFAILCAUSE_6 = 0x1006, + PDP_FAIL_OEM_DCFAILCAUSE_7 = 0x1007, + PDP_FAIL_OEM_DCFAILCAUSE_8 = 0x1008, + PDP_FAIL_OEM_DCFAILCAUSE_9 = 0x1009, + PDP_FAIL_OEM_DCFAILCAUSE_10 = 0x100A, + PDP_FAIL_OEM_DCFAILCAUSE_11 = 0x100B, + PDP_FAIL_OEM_DCFAILCAUSE_12 = 0x100C, + PDP_FAIL_OEM_DCFAILCAUSE_13 = 0x100D, + PDP_FAIL_OEM_DCFAILCAUSE_14 = 0x100E, + PDP_FAIL_OEM_DCFAILCAUSE_15 = 0x100F, + + /* Not mentioned in the specification */ + PDP_FAIL_VOICE_REGISTRATION_FAIL = -1, + PDP_FAIL_DATA_REGISTRATION_FAIL = -2, + + /* reasons for data call drop - network/modem disconnect */ + PDP_FAIL_SIGNAL_LOST = -3, + PDP_FAIL_PREF_RADIO_TECH_CHANGED = -4,/* preferred technology has changed, should retry + with parameters appropriate for new technology */ + PDP_FAIL_RADIO_POWER_OFF = -5, /* data call was disconnected because radio was resetting, + powered off - no retry */ + PDP_FAIL_TETHERED_CALL_ACTIVE = -6, /* data call was disconnected by modem because tethered + mode was up on same APN/data profile - no retry until + tethered call is off */ + + PDP_FAIL_ERROR_UNSPECIFIED = 0xffff, /* retry silently. Will be deprecated soon as + new error codes are added making this unnecessary */ +} RIL_DataCallFailCause; + +/* See RIL_REQUEST_SETUP_DATA_CALL */ +typedef enum { + RIL_DATA_PROFILE_DEFAULT = 0, + RIL_DATA_PROFILE_TETHERED = 1, + RIL_DATA_PROFILE_IMS = 2, + RIL_DATA_PROFILE_FOTA = 3, + RIL_DATA_PROFILE_CBS = 4, + RIL_DATA_PROFILE_OEM_BASE = 1000, /* Start of OEM-specific profiles */ + RIL_DATA_PROFILE_INVALID = 0xFFFFFFFF +} RIL_DataProfile; + +/* Used by RIL_UNSOL_SUPP_SVC_NOTIFICATION */ +typedef struct { + int notificationType; /* + * 0 = MO intermediate result code + * 1 = MT unsolicited result code + */ + int code; /* See 27.007 7.17 + "code1" for MO + "code2" for MT. */ + int index; /* CUG index. See 27.007 7.17. */ + int type; /* "type" from 27.007 7.17 (MT only). */ + char * number; /* "number" from 27.007 7.17 + (MT only, may be NULL). */ +} RIL_SuppSvcNotification; + +#define RIL_CARD_MAX_APPS 8 + +typedef enum { + RIL_CARDSTATE_ABSENT = 0, + RIL_CARDSTATE_PRESENT = 1, + RIL_CARDSTATE_ERROR = 2, + RIL_CARDSTATE_RESTRICTED = 3 /* card is present but not usable due to carrier restrictions.*/ +} RIL_CardState; + +typedef enum { + RIL_PERSOSUBSTATE_UNKNOWN = 0, /* initial state */ + RIL_PERSOSUBSTATE_IN_PROGRESS = 1, /* in between each lock transition */ + RIL_PERSOSUBSTATE_READY = 2, /* when either SIM or RUIM Perso is finished + since each app can only have 1 active perso + involved */ + RIL_PERSOSUBSTATE_SIM_NETWORK = 3, + RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4, + RIL_PERSOSUBSTATE_SIM_CORPORATE = 5, + RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6, + RIL_PERSOSUBSTATE_SIM_SIM = 7, + RIL_PERSOSUBSTATE_SIM_NETWORK_PUK = 8, /* The corresponding perso lock is blocked */ + RIL_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9, + RIL_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10, + RIL_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11, + RIL_PERSOSUBSTATE_SIM_SIM_PUK = 12, + RIL_PERSOSUBSTATE_RUIM_NETWORK1 = 13, + RIL_PERSOSUBSTATE_RUIM_NETWORK2 = 14, + RIL_PERSOSUBSTATE_RUIM_HRPD = 15, + RIL_PERSOSUBSTATE_RUIM_CORPORATE = 16, + RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17, + RIL_PERSOSUBSTATE_RUIM_RUIM = 18, + RIL_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19, /* The corresponding perso lock is blocked */ + RIL_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20, + RIL_PERSOSUBSTATE_RUIM_HRPD_PUK = 21, + RIL_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22, + RIL_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23, + RIL_PERSOSUBSTATE_RUIM_RUIM_PUK = 24 +} RIL_PersoSubstate; + +typedef enum { + RIL_APPSTATE_UNKNOWN = 0, + RIL_APPSTATE_DETECTED = 1, + RIL_APPSTATE_PIN = 2, /* If PIN1 or UPin is required */ + RIL_APPSTATE_PUK = 3, /* If PUK1 or Puk for UPin is required */ + RIL_APPSTATE_SUBSCRIPTION_PERSO = 4, /* perso_substate should be look at + when app_state is assigned to this value */ + RIL_APPSTATE_READY = 5 +} RIL_AppState; + +typedef enum { + RIL_PINSTATE_UNKNOWN = 0, + RIL_PINSTATE_ENABLED_NOT_VERIFIED = 1, + RIL_PINSTATE_ENABLED_VERIFIED = 2, + RIL_PINSTATE_DISABLED = 3, + RIL_PINSTATE_ENABLED_BLOCKED = 4, + RIL_PINSTATE_ENABLED_PERM_BLOCKED = 5 +} RIL_PinState; + +typedef enum { + RIL_APPTYPE_UNKNOWN = 0, + RIL_APPTYPE_SIM = 1, + RIL_APPTYPE_USIM = 2, + RIL_APPTYPE_RUIM = 3, + RIL_APPTYPE_CSIM = 4, + RIL_APPTYPE_ISIM = 5 +} RIL_AppType; + +/* + * Please note that registration state UNKNOWN is + * treated as "out of service" in the Android telephony. + * Registration state REG_DENIED must be returned if Location Update + * Reject (with cause 17 - Network Failure) is received + * repeatedly from the network, to facilitate + * "managed roaming" + */ +typedef enum { + RIL_NOT_REG_AND_NOT_SEARCHING = 0, // Not registered, MT is not currently searching + // a new operator to register + RIL_REG_HOME = 1, // Registered, home network + RIL_NOT_REG_AND_SEARCHING = 2, // Not registered, but MT is currently searching + // a new operator to register + RIL_REG_DENIED = 3, // Registration denied + RIL_UNKNOWN = 4, // Unknown + RIL_REG_ROAMING = 5, // Registered, roaming + RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_NOT_SEARCHING = 10, // Same as + // RIL_NOT_REG_AND_NOT_SEARCHING but indicates that + // emergency calls are enabled. + RIL_NOT_REG_AND_EMERGENCY_AVAILABLE_AND_SEARCHING = 12, // Same as RIL_NOT_REG_AND_SEARCHING + // but indicates that + // emergency calls are enabled. + RIL_REG_DENIED_AND_EMERGENCY_AVAILABLE = 13, // Same as REG_DENIED but indicates that + // emergency calls are enabled. + RIL_UNKNOWN_AND_EMERGENCY_AVAILABLE = 14, // Same as UNKNOWN but indicates that + // emergency calls are enabled. +} RIL_RegState; + +typedef struct +{ + RIL_AppType app_type; + RIL_AppState app_state; + RIL_PersoSubstate perso_substate; /* applicable only if app_state == + RIL_APPSTATE_SUBSCRIPTION_PERSO */ + char *aid_ptr; /* null terminated string, e.g., from 0xA0, 0x00 -> 0x41, + 0x30, 0x30, 0x30 */ + char *app_label_ptr; /* null terminated string */ + int pin1_replaced; /* applicable to USIM, CSIM & ISIM */ + RIL_PinState pin1; + RIL_PinState pin2; + int foo1; // pin1_num_retries + int foo2; // puk1_num_retries + int foo3; // pin2_num_retries + int foo4; // puk2_num_retries + int foo5; // perso_unblock_retries +} RIL_AppStatus; + +/* Deprecated, use RIL_CardStatus_v6 */ +typedef struct +{ + RIL_CardState card_state; + RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */ + int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ + int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ + int num_applications; /* value <= RIL_CARD_MAX_APPS */ + RIL_AppStatus applications[RIL_CARD_MAX_APPS]; +} RIL_CardStatus_v5; + +typedef struct +{ + RIL_CardState card_state; + RIL_PinState universal_pin_state; /* applicable to USIM and CSIM: RIL_PINSTATE_xxx */ + int gsm_umts_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ + int cdma_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ + int ims_subscription_app_index; /* value < RIL_CARD_MAX_APPS, -1 if none */ + int num_applications; /* value <= RIL_CARD_MAX_APPS */ + RIL_AppStatus applications[RIL_CARD_MAX_APPS]; +} RIL_CardStatus_v6; + +/** The result of a SIM refresh, returned in data[0] of RIL_UNSOL_SIM_REFRESH + * or as part of RIL_SimRefreshResponse_v7 + */ +typedef enum { + /* A file on SIM has been updated. data[1] contains the EFID. */ + SIM_FILE_UPDATE = 0, + /* SIM initialized. All files should be re-read. */ + SIM_INIT = 1, + /* SIM reset. SIM power required, SIM may be locked and all files should be re-read. */ + SIM_RESET = 2 +} RIL_SimRefreshResult; + +typedef struct { + RIL_SimRefreshResult result; + int ef_id; /* is the EFID of the updated file if the result is */ + /* SIM_FILE_UPDATE or 0 for any other result. */ + char * aid; /* is AID(application ID) of the card application */ + /* See ETSI 102.221 8.1 and 101.220 4 */ + /* For SIM_FILE_UPDATE result it can be set to AID of */ + /* application in which updated EF resides or it can be */ + /* NULL if EF is outside of an application. */ + /* For SIM_INIT result this field is set to AID of */ + /* application that caused REFRESH */ + /* For SIM_RESET result it is NULL. */ +} RIL_SimRefreshResponse_v7; + +/* Deprecated, use RIL_CDMA_CallWaiting_v6 */ +typedef struct { + char * number; /* Remote party number */ + int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */ + char * name; /* Remote party name */ + RIL_CDMA_SignalInfoRecord signalInfoRecord; +} RIL_CDMA_CallWaiting_v5; + +typedef struct { + char * number; /* Remote party number */ + int numberPresentation; /* 0=Allowed, 1=Restricted, 2=Not Specified/Unknown */ + char * name; /* Remote party name */ + RIL_CDMA_SignalInfoRecord signalInfoRecord; + /* Number type/Number plan required to support International Call Waiting */ + int number_type; /* 0=Unknown, 1=International, 2=National, + 3=Network specific, 4=subscriber */ + int number_plan; /* 0=Unknown, 1=ISDN, 3=Data, 4=Telex, 8=Nat'l, 9=Private */ +} RIL_CDMA_CallWaiting_v6; + +/** + * Which types of Cell Broadcast Message (CBM) are to be received by the ME + * + * uFromServiceID - uToServiceID defines a range of CBM message identifiers + * whose value is 0x0000 - 0xFFFF as defined in TS 23.041 9.4.1.2.2 for GMS + * and 9.4.4.2.2 for UMTS. All other values can be treated as empty + * CBM message ID. + * + * uFromCodeScheme - uToCodeScheme defines a range of CBM data coding schemes + * whose value is 0x00 - 0xFF as defined in TS 23.041 9.4.1.2.3 for GMS + * and 9.4.4.2.3 for UMTS. + * All other values can be treated as empty CBM data coding scheme. + * + * selected 0 means message types specified in + * and are not accepted, while 1 means accepted. + * + * Used by RIL_REQUEST_GSM_GET_BROADCAST_CONFIG and + * RIL_REQUEST_GSM_SET_BROADCAST_CONFIG. + */ +typedef struct { + int fromServiceId; + int toServiceId; + int fromCodeScheme; + int toCodeScheme; + unsigned char selected; +} RIL_GSM_BroadcastSmsConfigInfo; + +/* No restriction at all including voice/SMS/USSD/SS/AV64 and packet data. */ +#define RIL_RESTRICTED_STATE_NONE 0x00 +/* Block emergency call due to restriction. But allow all normal voice/SMS/USSD/SS/AV64. */ +#define RIL_RESTRICTED_STATE_CS_EMERGENCY 0x01 +/* Block all normal voice/SMS/USSD/SS/AV64 due to restriction. Only Emergency call allowed. */ +#define RIL_RESTRICTED_STATE_CS_NORMAL 0x02 +/* Block all voice/SMS/USSD/SS/AV64 including emergency call due to restriction.*/ +#define RIL_RESTRICTED_STATE_CS_ALL 0x04 +/* Block packet data access due to restriction. */ +#define RIL_RESTRICTED_STATE_PS_ALL 0x10 + +/* The status for an OTASP/OTAPA session */ +typedef enum { + CDMA_OTA_PROVISION_STATUS_SPL_UNLOCKED, + CDMA_OTA_PROVISION_STATUS_SPC_RETRIES_EXCEEDED, + CDMA_OTA_PROVISION_STATUS_A_KEY_EXCHANGED, + CDMA_OTA_PROVISION_STATUS_SSD_UPDATED, + CDMA_OTA_PROVISION_STATUS_NAM_DOWNLOADED, + CDMA_OTA_PROVISION_STATUS_MDN_DOWNLOADED, + CDMA_OTA_PROVISION_STATUS_IMSI_DOWNLOADED, + CDMA_OTA_PROVISION_STATUS_PRL_DOWNLOADED, + CDMA_OTA_PROVISION_STATUS_COMMITTED, + CDMA_OTA_PROVISION_STATUS_OTAPA_STARTED, + CDMA_OTA_PROVISION_STATUS_OTAPA_STOPPED, + CDMA_OTA_PROVISION_STATUS_OTAPA_ABORTED +} RIL_CDMA_OTA_ProvisionStatus; + +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */ +} RIL_GW_SignalStrength; + +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */ + int timingAdvance; /* Timing Advance in bit periods. 1 bit period = 48/13 us. + * INT_MAX denotes invalid value */ +} RIL_GSM_SignalStrength_v12; + +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int bitErrorRate; /* bit error rate (0-7, 99) as defined in TS 27.007 8.5 */ +} RIL_SignalStrengthWcdma; + +typedef struct { + int dbm; /* Valid values are positive integers. This value is the actual RSSI value + * multiplied by -1. Example: If the actual RSSI is -75, then this response + * value will be 75. + */ + int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied + * by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value + * will be 125. + */ +} RIL_CDMA_SignalStrength; + + +typedef struct { + int dbm; /* Valid values are positive integers. This value is the actual RSSI value + * multiplied by -1. Example: If the actual RSSI is -75, then this response + * value will be 75. + */ + int ecio; /* Valid values are positive integers. This value is the actual Ec/Io multiplied + * by -10. Example: If the actual Ec/Io is -12.5 dB, then this response value + * will be 125. + */ + int signalNoiseRatio; /* Valid values are 0-8. 8 is the highest signal to noise ratio. */ +} RIL_EVDO_SignalStrength; + +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1. + * Range: 44 to 140 dBm + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.4 */ + int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1. + * Range: 20 to 3 dB. + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.7 */ + int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units. + * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB). + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 8.1.1 */ + int cqi; /* The current Channel Quality Indicator. + * Range: 0 to 15. + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */ +} RIL_LTE_SignalStrength; + +typedef struct { + int signalStrength; /* Valid values are (0-31, 99) as defined in TS 27.007 8.5 */ + int rsrp; /* The current Reference Signal Receive Power in dBm multipled by -1. + * Range: 44 to 140 dBm + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.4 */ + int rsrq; /* The current Reference Signal Receive Quality in dB multiplied by -1. + * Range: 20 to 3 dB. + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.133 9.1.7 */ + int rssnr; /* The current reference signal signal-to-noise ratio in 0.1 dB units. + * Range: -200 to +300 (-200 = -20.0 dB, +300 = 30dB). + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 8.1.1 */ + int cqi; /* The current Channel Quality Indicator. + * Range: 0 to 15. + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 36.101 9.2, 9.3, A.4 */ + int timingAdvance; /* timing advance in micro seconds for a one way trip from cell to device. + * Approximate distance can be calculated using 300m/us * timingAdvance. + * Range: 0 to 0x7FFFFFFE + * INT_MAX : 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP 36.321 section 6.1.3.5 + * also: http://www.cellular-planningoptimization.com/2010/02/timing-advance-with-calculation.html */ +} RIL_LTE_SignalStrength_v8; + +typedef struct { + int rscp; /* The Received Signal Code Power in dBm multipled by -1. + * Range : 25 to 120 + * INT_MAX: 0x7FFFFFFF denotes invalid value. + * Reference: 3GPP TS 25.123, section 9.1.1.1 */ +} RIL_TD_SCDMA_SignalStrength; + +/* Deprecated, use RIL_SignalStrength_v6 */ +typedef struct { + RIL_GW_SignalStrength GW_SignalStrength; + RIL_CDMA_SignalStrength CDMA_SignalStrength; + RIL_EVDO_SignalStrength EVDO_SignalStrength; +} RIL_SignalStrength_v5; + +typedef struct { + RIL_GW_SignalStrength GW_SignalStrength; + RIL_CDMA_SignalStrength CDMA_SignalStrength; + RIL_EVDO_SignalStrength EVDO_SignalStrength; + RIL_LTE_SignalStrength LTE_SignalStrength; +} RIL_SignalStrength_v6; + +typedef struct { + RIL_GW_SignalStrength GW_SignalStrength; + RIL_CDMA_SignalStrength CDMA_SignalStrength; + RIL_EVDO_SignalStrength EVDO_SignalStrength; + RIL_LTE_SignalStrength_v8 LTE_SignalStrength; +} RIL_SignalStrength_v8; + +typedef struct { + RIL_GW_SignalStrength GW_SignalStrength; + RIL_CDMA_SignalStrength CDMA_SignalStrength; + RIL_EVDO_SignalStrength EVDO_SignalStrength; + RIL_LTE_SignalStrength_v8 LTE_SignalStrength; + RIL_TD_SCDMA_SignalStrength TD_SCDMA_SignalStrength; +} RIL_SignalStrength_v10; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ + int cid; /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown */ +} RIL_CellIdentityGsm; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ + int cid; /* 16-bit GSM Cell Identity described in TS 27.007, 0..65535, INT_MAX if unknown */ + int arfcn; /* 16-bit GSM Absolute RF channel number; this value must be reported */ + uint8_t bsic; /* 6-bit Base Station Identity Code; 0xFF if unknown */ +} RIL_CellIdentityGsm_v12; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ + int cid; /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */ + int psc; /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511, INT_MAX if unknown */ +} RIL_CellIdentityWcdma; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ + int cid; /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */ + int psc; /* 9-bit UMTS Primary Scrambling Code described in TS 25.331, 0..511; this value must be reported */ + int uarfcn; /* 16-bit UMTS Absolute RF Channel Number; this value must be reported */ +} RIL_CellIdentityWcdma_v12; + +typedef struct { + int networkId; /* Network Id 0..65535, INT_MAX if unknown */ + int systemId; /* CDMA System Id 0..32767, INT_MAX if unknown */ + int basestationId; /* Base Station Id 0..65535, INT_MAX if unknown */ + int longitude; /* Longitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -2592000 + * to 2592000, both values inclusive (corresponding to a range of -180 + * to +180 degrees). INT_MAX if unknown */ + + int latitude; /* Latitude is a decimal number as specified in 3GPP2 C.S0005-A v6.0. + * It is represented in units of 0.25 seconds and ranges from -1296000 + * to 1296000, both values inclusive (corresponding to a range of -90 + * to +90 degrees). INT_MAX if unknown */ +} RIL_CellIdentityCdma; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int ci; /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */ + int pci; /* physical cell id 0..503, INT_MAX if unknown */ + int tac; /* 16-bit tracking area code, INT_MAX if unknown */ +} RIL_CellIdentityLte; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int ci; /* 28-bit Cell Identity described in TS ???, INT_MAX if unknown */ + int pci; /* physical cell id 0..503; this value must be reported */ + int tac; /* 16-bit tracking area code, INT_MAX if unknown */ + int earfcn; /* 18-bit LTE Absolute RF Channel Number; this value must be reported */ +} RIL_CellIdentityLte_v12; + +typedef struct { + int mcc; /* 3-digit Mobile Country Code, 0..999, INT_MAX if unknown */ + int mnc; /* 2 or 3-digit Mobile Network Code, 0..999; + the most significant nibble encodes the number of digits - {2, 3, 0 (unset)}; + INT_MAX if unknown */ + int lac; /* 16-bit Location Area Code, 0..65535, INT_MAX if unknown */ + int cid; /* 28-bit UMTS Cell Identity described in TS 25.331, 0..268435455, INT_MAX if unknown */ + int cpid; /* 8-bit Cell Parameters ID described in TS 25.331, 0..127, INT_MAX if unknown */ +} RIL_CellIdentityTdscdma; + +typedef struct { + RIL_CellIdentityGsm cellIdentityGsm; + RIL_GW_SignalStrength signalStrengthGsm; +} RIL_CellInfoGsm; + +typedef struct { + RIL_CellIdentityGsm_v12 cellIdentityGsm; + RIL_GSM_SignalStrength_v12 signalStrengthGsm; +} RIL_CellInfoGsm_v12; + +typedef struct { + RIL_CellIdentityWcdma cellIdentityWcdma; + RIL_SignalStrengthWcdma signalStrengthWcdma; +} RIL_CellInfoWcdma; + +typedef struct { + RIL_CellIdentityWcdma_v12 cellIdentityWcdma; + RIL_SignalStrengthWcdma signalStrengthWcdma; +} RIL_CellInfoWcdma_v12; + +typedef struct { + RIL_CellIdentityCdma cellIdentityCdma; + RIL_CDMA_SignalStrength signalStrengthCdma; + RIL_EVDO_SignalStrength signalStrengthEvdo; +} RIL_CellInfoCdma; + +typedef struct { + RIL_CellIdentityLte cellIdentityLte; + RIL_LTE_SignalStrength_v8 signalStrengthLte; +} RIL_CellInfoLte; + +typedef struct { + RIL_CellIdentityLte_v12 cellIdentityLte; + RIL_LTE_SignalStrength_v8 signalStrengthLte; +} RIL_CellInfoLte_v12; + +typedef struct { + RIL_CellIdentityTdscdma cellIdentityTdscdma; + RIL_TD_SCDMA_SignalStrength signalStrengthTdscdma; +} RIL_CellInfoTdscdma; + +// Must be the same as CellInfo.TYPE_XXX +typedef enum { + RIL_CELL_INFO_TYPE_NONE = 0, /* indicates no cell information */ + RIL_CELL_INFO_TYPE_GSM = 1, + RIL_CELL_INFO_TYPE_CDMA = 2, + RIL_CELL_INFO_TYPE_LTE = 3, + RIL_CELL_INFO_TYPE_WCDMA = 4, + RIL_CELL_INFO_TYPE_TD_SCDMA = 5 +} RIL_CellInfoType; + +// Must be the same as CellInfo.TIMESTAMP_TYPE_XXX +typedef enum { + RIL_TIMESTAMP_TYPE_UNKNOWN = 0, + RIL_TIMESTAMP_TYPE_ANTENNA = 1, + RIL_TIMESTAMP_TYPE_MODEM = 2, + RIL_TIMESTAMP_TYPE_OEM_RIL = 3, + RIL_TIMESTAMP_TYPE_JAVA_RIL = 4, +} RIL_TimeStampType; + +typedef struct { + RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */ + int registered; /* !0 if this cell is registered 0 if not registered */ + RIL_TimeStampType timeStampType; /* type of time stamp represented by timeStamp */ + uint64_t timeStamp; /* Time in nanos as returned by ril_nano_time */ + union { + RIL_CellInfoGsm gsm; + RIL_CellInfoCdma cdma; + RIL_CellInfoLte lte; + RIL_CellInfoWcdma wcdma; + RIL_CellInfoTdscdma tdscdma; + } CellInfo; +} RIL_CellInfo; + +typedef struct { + RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */ + int registered; /* !0 if this cell is registered 0 if not registered */ + RIL_TimeStampType timeStampType; /* type of time stamp represented by timeStamp */ + uint64_t timeStamp; /* Time in nanos as returned by ril_nano_time */ + union { + RIL_CellInfoGsm_v12 gsm; + RIL_CellInfoCdma cdma; + RIL_CellInfoLte_v12 lte; + RIL_CellInfoWcdma_v12 wcdma; + RIL_CellInfoTdscdma tdscdma; + } CellInfo; +} RIL_CellInfo_v12; + +typedef struct { + RIL_CellInfoType cellInfoType; /* cell type for selecting from union CellInfo */ + union { + RIL_CellIdentityGsm_v12 cellIdentityGsm; + RIL_CellIdentityWcdma_v12 cellIdentityWcdma; + RIL_CellIdentityLte_v12 cellIdentityLte; + RIL_CellIdentityTdscdma cellIdentityTdscdma; + RIL_CellIdentityCdma cellIdentityCdma; + }; +}RIL_CellIdentity_v16; + +typedef struct { + RIL_RegState regState; // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING, + // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED, + // UNKNOWN, REG_ROAMING defined in RegState + RIL_RadioTechnology rat; // indicates the available voice radio technology, + // valid values as defined by RadioTechnology. + int32_t cssSupported; // concurrent services support indicator. if + // registered on a CDMA system. + // 0 - Concurrent services not supported, + // 1 - Concurrent services supported + int32_t roamingIndicator; // TSB-58 Roaming Indicator if registered + // on a CDMA or EVDO system or -1 if not. + // Valid values are 0-255. + int32_t systemIsInPrl; // indicates whether the current system is in the + // PRL if registered on a CDMA or EVDO system or -1 if + // not. 0=not in the PRL, 1=in the PRL + int32_t defaultRoamingIndicator; // default Roaming Indicator from the PRL, + // if registered on a CDMA or EVDO system or -1 if not. + // Valid values are 0-255. + int32_t reasonForDenial; // reasonForDenial if registration state is 3 + // (Registration denied) this is an enumerated reason why + // registration was denied. See 3GPP TS 24.008, + // 10.5.3.6 and Annex G. + // 0 - General + // 1 - Authentication Failure + // 2 - IMSI unknown in HLR + // 3 - Illegal MS + // 4 - Illegal ME + // 5 - PLMN not allowed + // 6 - Location area not allowed + // 7 - Roaming not allowed + // 8 - No Suitable Cells in this Location Area + // 9 - Network failure + // 10 - Persistent location update reject + // 11 - PLMN not allowed + // 12 - Location area not allowed + // 13 - Roaming not allowed in this Location Area + // 15 - No Suitable Cells in this Location Area + // 17 - Network Failure + // 20 - MAC Failure + // 21 - Sync Failure + // 22 - Congestion + // 23 - GSM Authentication unacceptable + // 25 - Not Authorized for this CSG + // 32 - Service option not supported + // 33 - Requested service option not subscribed + // 34 - Service option temporarily out of order + // 38 - Call cannot be identified + // 48-63 - Retry upon entry into a new cell + // 95 - Semantically incorrect message + // 96 - Invalid mandatory information + // 97 - Message type non-existent or not implemented + // 98 - Message type not compatible with protocol state + // 99 - Information element non-existent or + // not implemented + // 100 - Conditional IE error + // 101 - Message not compatible with protocol state; + RIL_CellIdentity_v16 cellIdentity; // current cell information +}RIL_VoiceRegistrationStateResponse; + + +typedef struct { + RIL_RegState regState; // Valid reg states are RIL_NOT_REG_AND_NOT_SEARCHING, + // REG_HOME, RIL_NOT_REG_AND_SEARCHING, REG_DENIED, + // UNKNOWN, REG_ROAMING defined in RegState + RIL_RadioTechnology rat; // indicates the available data radio technology, + // valid values as defined by RadioTechnology. + int32_t reasonDataDenied; // if registration state is 3 (Registration + // denied) this is an enumerated reason why + // registration was denied. See 3GPP TS 24.008, + // Annex G.6 "Additional cause codes for GMM". + // 7 == GPRS services not allowed + // 8 == GPRS services and non-GPRS services not allowed + // 9 == MS identity cannot be derived by the network + // 10 == Implicitly detached + // 14 == GPRS services not allowed in this PLMN + // 16 == MSC temporarily not reachable + // 40 == No PDP context activated + int32_t maxDataCalls; // The maximum number of simultaneous Data Calls that + // must be established using setupDataCall(). + RIL_CellIdentity_v16 cellIdentity; // Current cell information +}RIL_DataRegistrationStateResponse; + +/* Names of the CDMA info records (C.S0005 section 3.7.5) */ +typedef enum { + RIL_CDMA_DISPLAY_INFO_REC, + RIL_CDMA_CALLED_PARTY_NUMBER_INFO_REC, + RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC, + RIL_CDMA_CONNECTED_NUMBER_INFO_REC, + RIL_CDMA_SIGNAL_INFO_REC, + RIL_CDMA_REDIRECTING_NUMBER_INFO_REC, + RIL_CDMA_LINE_CONTROL_INFO_REC, + RIL_CDMA_EXTENDED_DISPLAY_INFO_REC, + RIL_CDMA_T53_CLIR_INFO_REC, + RIL_CDMA_T53_RELEASE_INFO_REC, + RIL_CDMA_T53_AUDIO_CONTROL_INFO_REC +} RIL_CDMA_InfoRecName; + +/* Display Info Rec as defined in C.S0005 section 3.7.5.1 + Extended Display Info Rec as defined in C.S0005 section 3.7.5.16 + Note: the Extended Display info rec contains multiple records of the + form: display_tag, display_len, and display_len occurrences of the + chari field if the display_tag is not 10000000 or 10000001. + To save space, the records are stored consecutively in a byte buffer. + The display_tag, display_len and chari fields are all 1 byte. +*/ + +typedef struct { + char alpha_len; + char alpha_buf[CDMA_ALPHA_INFO_BUFFER_LENGTH]; +} RIL_CDMA_DisplayInfoRecord; + +/* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2 + Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3 + Connected Number Info Rec as defined in C.S0005 section 3.7.5.4 +*/ + +typedef struct { + char len; + char buf[CDMA_NUMBER_INFO_BUFFER_LENGTH]; + char number_type; + char number_plan; + char pi; + char si; +} RIL_CDMA_NumberInfoRecord; + +/* Redirecting Number Information Record as defined in C.S0005 section 3.7.5.11 */ +typedef enum { + RIL_REDIRECTING_REASON_UNKNOWN = 0, + RIL_REDIRECTING_REASON_CALL_FORWARDING_BUSY = 1, + RIL_REDIRECTING_REASON_CALL_FORWARDING_NO_REPLY = 2, + RIL_REDIRECTING_REASON_CALLED_DTE_OUT_OF_ORDER = 9, + RIL_REDIRECTING_REASON_CALL_FORWARDING_BY_THE_CALLED_DTE = 10, + RIL_REDIRECTING_REASON_CALL_FORWARDING_UNCONDITIONAL = 15, + RIL_REDIRECTING_REASON_RESERVED +} RIL_CDMA_RedirectingReason; + +typedef struct { + RIL_CDMA_NumberInfoRecord redirectingNumber; + /* redirectingReason is set to RIL_REDIRECTING_REASON_UNKNOWN if not included */ + RIL_CDMA_RedirectingReason redirectingReason; +} RIL_CDMA_RedirectingNumberInfoRecord; + +/* Line Control Information Record as defined in C.S0005 section 3.7.5.15 */ +typedef struct { + char lineCtrlPolarityIncluded; + char lineCtrlToggle; + char lineCtrlReverse; + char lineCtrlPowerDenial; +} RIL_CDMA_LineControlInfoRecord; + +/* T53 CLIR Information Record */ +typedef struct { + char cause; +} RIL_CDMA_T53_CLIRInfoRecord; + +/* T53 Audio Control Information Record */ +typedef struct { + char upLink; + char downLink; +} RIL_CDMA_T53_AudioControlInfoRecord; + +typedef struct { + + RIL_CDMA_InfoRecName name; + + union { + /* Display and Extended Display Info Rec */ + RIL_CDMA_DisplayInfoRecord display; + + /* Called Party Number, Calling Party Number, Connected Number Info Rec */ + RIL_CDMA_NumberInfoRecord number; + + /* Signal Info Rec */ + RIL_CDMA_SignalInfoRecord signal; + + /* Redirecting Number Info Rec */ + RIL_CDMA_RedirectingNumberInfoRecord redir; + + /* Line Control Info Rec */ + RIL_CDMA_LineControlInfoRecord lineCtrl; + + /* T53 CLIR Info Rec */ + RIL_CDMA_T53_CLIRInfoRecord clir; + + /* T53 Audio Control Info Rec */ + RIL_CDMA_T53_AudioControlInfoRecord audioCtrl; + } rec; +} RIL_CDMA_InformationRecord; + +#define RIL_CDMA_MAX_NUMBER_OF_INFO_RECS 10 + +typedef struct { + char numberOfInfoRecs; + RIL_CDMA_InformationRecord infoRec[RIL_CDMA_MAX_NUMBER_OF_INFO_RECS]; +} RIL_CDMA_InformationRecords; + +/* See RIL_REQUEST_NV_READ_ITEM */ +typedef struct { + RIL_NV_Item itemID; +} RIL_NV_ReadItem; + +/* See RIL_REQUEST_NV_WRITE_ITEM */ +typedef struct { + RIL_NV_Item itemID; + char * value; +} RIL_NV_WriteItem; + +typedef enum { + HANDOVER_STARTED = 0, + HANDOVER_COMPLETED = 1, + HANDOVER_FAILED = 2, + HANDOVER_CANCELED = 3 +} RIL_SrvccState; + +/* hardware configuration reported to RILJ. */ +typedef enum { + RIL_HARDWARE_CONFIG_MODEM = 0, + RIL_HARDWARE_CONFIG_SIM = 1, +} RIL_HardwareConfig_Type; + +typedef enum { + RIL_HARDWARE_CONFIG_STATE_ENABLED = 0, + RIL_HARDWARE_CONFIG_STATE_STANDBY = 1, + RIL_HARDWARE_CONFIG_STATE_DISABLED = 2, +} RIL_HardwareConfig_State; + +typedef struct { + int rilModel; + uint32_t rat; /* bitset - ref. RIL_RadioTechnology. */ + int maxVoice; + int maxData; + int maxStandby; +} RIL_HardwareConfig_Modem; + +typedef struct { + char modemUuid[MAX_UUID_LENGTH]; +} RIL_HardwareConfig_Sim; + +typedef struct { + RIL_HardwareConfig_Type type; + char uuid[MAX_UUID_LENGTH]; + RIL_HardwareConfig_State state; + union { + RIL_HardwareConfig_Modem modem; + RIL_HardwareConfig_Sim sim; + } cfg; +} RIL_HardwareConfig; + +typedef enum { + SS_CFU, + SS_CF_BUSY, + SS_CF_NO_REPLY, + SS_CF_NOT_REACHABLE, + SS_CF_ALL, + SS_CF_ALL_CONDITIONAL, + SS_CLIP, + SS_CLIR, + SS_COLP, + SS_COLR, + SS_WAIT, + SS_BAOC, + SS_BAOIC, + SS_BAOIC_EXC_HOME, + SS_BAIC, + SS_BAIC_ROAMING, + SS_ALL_BARRING, + SS_OUTGOING_BARRING, + SS_INCOMING_BARRING +} RIL_SsServiceType; + +typedef enum { + SS_ACTIVATION, + SS_DEACTIVATION, + SS_INTERROGATION, + SS_REGISTRATION, + SS_ERASURE +} RIL_SsRequestType; + +typedef enum { + SS_ALL_TELE_AND_BEARER_SERVICES, + SS_ALL_TELESEVICES, + SS_TELEPHONY, + SS_ALL_DATA_TELESERVICES, + SS_SMS_SERVICES, + SS_ALL_TELESERVICES_EXCEPT_SMS +} RIL_SsTeleserviceType; + +#define SS_INFO_MAX 4 +#define NUM_SERVICE_CLASSES 7 + +typedef struct { + int numValidIndexes; /* This gives the number of valid values in cfInfo. + For example if voice is forwarded to one number and data + is forwarded to a different one then numValidIndexes will be + 2 indicating total number of valid values in cfInfo. + Similarly if all the services are forwarded to the same + number then the value of numValidIndexes will be 1. */ + + RIL_CallForwardInfo cfInfo[NUM_SERVICE_CLASSES]; /* This is the response data + for SS request to query call + forward status. see + RIL_REQUEST_QUERY_CALL_FORWARD_STATUS */ +} RIL_CfData; + +typedef struct { + RIL_SsServiceType serviceType; + RIL_SsRequestType requestType; + RIL_SsTeleserviceType teleserviceType; + int serviceClass; + RIL_Errno result; + + union { + int ssInfo[SS_INFO_MAX]; /* This is the response data for most of the SS GET/SET + RIL requests. E.g. RIL_REQUSET_GET_CLIR returns + two ints, so first two values of ssInfo[] will be + used for response if serviceType is SS_CLIR and + requestType is SS_INTERROGATION */ + + RIL_CfData cfData; + }; +} RIL_StkCcUnsolSsResponse; + +/** + * Data connection power state + */ +typedef enum { + RIL_DC_POWER_STATE_LOW = 1, // Low power state + RIL_DC_POWER_STATE_MEDIUM = 2, // Medium power state + RIL_DC_POWER_STATE_HIGH = 3, // High power state + RIL_DC_POWER_STATE_UNKNOWN = INT32_MAX // Unknown state +} RIL_DcPowerStates; + +/** + * Data connection real time info + */ +typedef struct { + uint64_t time; // Time in nanos as returned by ril_nano_time + RIL_DcPowerStates powerState; // Current power state +} RIL_DcRtInfo; + +/** + * Data profile to modem + */ +typedef struct { + /* id of the data profile */ + int profileId; + /* the APN to connect to */ + char* apn; + /** one of the PDP_type values in TS 27.007 section 10.1.1. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + */ + char* protocol; + /** authentication protocol used for this PDP context + * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) + */ + int authType; + /* the username for APN, or NULL */ + char* user; + /* the password for APN, or NULL */ + char* password; + /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */ + int type; + /* the period in seconds to limit the maximum connections */ + int maxConnsTime; + /* the maximum connections during maxConnsTime */ + int maxConns; + /** the required wait time in seconds after a successful UE initiated + * disconnect of a given PDN connection before the device can send + * a new PDN connection request for that given PDN + */ + int waitTime; + /* true to enable the profile, 0 to disable, 1 to enable */ + int enabled; +} RIL_DataProfileInfo; + +typedef struct { + /* id of the data profile */ + int profileId; + /* the APN to connect to */ + char* apn; + /** one of the PDP_type values in TS 27.007 section 10.1.1. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + */ + char* protocol; + /** one of the PDP_type values in TS 27.007 section 10.1.1 used on roaming network. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + */ + char *roamingProtocol; + /** authentication protocol used for this PDP context + * (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) + */ + int authType; + /* the username for APN, or NULL */ + char* user; + /* the password for APN, or NULL */ + char* password; + /* the profile type, TYPE_COMMON-0, TYPE_3GPP-1, TYPE_3GPP2-2 */ + int type; + /* the period in seconds to limit the maximum connections */ + int maxConnsTime; + /* the maximum connections during maxConnsTime */ + int maxConns; + /** the required wait time in seconds after a successful UE initiated + * disconnect of a given PDN connection before the device can send + * a new PDN connection request for that given PDN + */ + int waitTime; + /* true to enable the profile, 0 to disable, 1 to enable */ + int enabled; + /* supported APN types bitmask. See RIL_ApnTypes for the value of each bit. */ + int supportedTypesBitmask; + /** the bearer bitmask. See RIL_RadioAccessFamily for the value of each bit. */ + int bearerBitmask; + /** maximum transmission unit (MTU) size in bytes */ + int mtu; + /** the MVNO type: possible values are "imsi", "gid", "spn" */ + char *mvnoType; + /** MVNO match data. Can be anything defined by the carrier. For example, + * SPN like: "A MOBILE", "BEN NL", etc... + * IMSI like: "302720x94", "2060188", etc... + * GID like: "4E", "33", etc... + */ + char *mvnoMatchData; +} RIL_DataProfileInfo_v15; + +/* Tx Power Levels */ +#define RIL_NUM_TX_POWER_LEVELS 5 + +/** + * Aggregate modem activity information + */ +typedef struct { + + /* total time (in ms) when modem is in a low power or + * sleep state + */ + uint32_t sleep_mode_time_ms; + + /* total time (in ms) when modem is awake but neither + * the transmitter nor receiver are active/awake */ + uint32_t idle_mode_time_ms; + + /* total time (in ms) during which the transmitter is active/awake, + * subdivided by manufacturer-defined device-specific + * contiguous increasing ranges of transmit power between + * 0 and the transmitter's maximum transmit power. + */ + uint32_t tx_mode_time_ms[RIL_NUM_TX_POWER_LEVELS]; + + /* total time (in ms) for which receiver is active/awake and + * the transmitter is inactive */ + uint32_t rx_mode_time_ms; +} RIL_ActivityStatsInfo; + +typedef enum { + RIL_APN_TYPE_UNKNOWN = 0x0, // Unknown + RIL_APN_TYPE_DEFAULT = 0x1, // APN type for default data traffic + RIL_APN_TYPE_MMS = 0x2, // APN type for MMS traffic + RIL_APN_TYPE_SUPL = 0x4, // APN type for SUPL assisted GPS + RIL_APN_TYPE_DUN = 0x8, // APN type for DUN traffic + RIL_APN_TYPE_HIPRI = 0x10, // APN type for HiPri traffic + RIL_APN_TYPE_FOTA = 0x20, // APN type for FOTA + RIL_APN_TYPE_IMS = 0x40, // APN type for IMS + RIL_APN_TYPE_CBS = 0x80, // APN type for CBS + RIL_APN_TYPE_IA = 0x100, // APN type for IA Initial Attach APN + RIL_APN_TYPE_EMERGENCY = 0x200, // APN type for Emergency PDN. This is not an IA apn, + // but is used for access to carrier services in an + // emergency call situation. + RIL_APN_TYPE_ALL = 0xFFFFFFFF // All APN types +} RIL_ApnTypes; + +typedef enum { + RIL_DST_POWER_SAVE_MODE, // Device power save mode (provided by PowerManager) + // True indicates the device is in power save mode. + RIL_DST_CHARGING_STATE, // Device charging state (provided by BatteryManager) + // True indicates the device is charging. + RIL_DST_LOW_DATA_EXPECTED // Low data expected mode. True indicates low data traffic + // is expected, for example, when the device is idle + // (e.g. not doing tethering in the background). Note + // this doesn't mean no data is expected. +} RIL_DeviceStateType; + +typedef enum { + RIL_UR_SIGNAL_STRENGTH = 0x01, // When this bit is set, modem should always send the + // signal strength update through + // RIL_UNSOL_SIGNAL_STRENGTH, otherwise suppress it. + RIL_UR_FULL_NETWORK_STATE = 0x02, // When this bit is set, modem should always send + // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED + // when any field in + // RIL_REQUEST_VOICE_REGISTRATION_STATE or + // RIL_REQUEST_DATA_REGISTRATION_STATE changes. When + // this bit is not set, modem should suppress + // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED + // only when insignificant fields change + // (e.g. cell info). + // Modem should continue sending + // RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED + // when significant fields are updated even when this + // bit is not set. The following fields are + // considered significant, registration state and + // radio technology. + RIL_UR_DATA_CALL_DORMANCY_CHANGED = 0x04 // When this bit is set, modem should send the data + // call list changed unsolicited response + // RIL_UNSOL_DATA_CALL_LIST_CHANGED whenever any + // field in RIL_Data_Call_Response changes. + // Otherwise modem should suppress the unsolicited + // response when the only changed field is 'active' + // (for data dormancy). For all other fields change, + // modem should continue sending + // RIL_UNSOL_DATA_CALL_LIST_CHANGED regardless this + // bit is set or not. +} RIL_UnsolicitedResponseFilter; + +typedef struct { + char * aidPtr; /* AID value, See ETSI 102.221 and 101.220*/ + int p2; /* P2 parameter (described in ISO 7816-4) + P2Constants:NO_P2 if to be ignored */ +} RIL_OpenChannelParams; + +typedef enum { + RIL_ONE_SHOT = 0x01, // Performs the scan only once + RIL_PERIODIC = 0x02 // Performs the scan periodically until cancelled +} RIL_ScanType; + +typedef enum { + GERAN = 0x01, // GSM EDGE Radio Access Network + UTRAN = 0x02, // Universal Terrestrial Radio Access Network + EUTRAN = 0x03, // Evolved Universal Terrestrial Radio Access Network +} RIL_RadioAccessNetworks; + +typedef enum { + GERAN_BAND_T380 = 1, + GERAN_BAND_T410 = 2, + GERAN_BAND_450 = 3, + GERAN_BAND_480 = 4, + GERAN_BAND_710 = 5, + GERAN_BAND_750 = 6, + GERAN_BAND_T810 = 7, + GERAN_BAND_850 = 8, + GERAN_BAND_P900 = 9, + GERAN_BAND_E900 = 10, + GERAN_BAND_R900 = 11, + GERAN_BAND_DCS1800 = 12, + GERAN_BAND_PCS1900 = 13, + GERAN_BAND_ER900 = 14, +} RIL_GeranBands; + +typedef enum { + UTRAN_BAND_1 = 1, + UTRAN_BAND_2 = 2, + UTRAN_BAND_3 = 3, + UTRAN_BAND_4 = 4, + UTRAN_BAND_5 = 5, + UTRAN_BAND_6 = 6, + UTRAN_BAND_7 = 7, + UTRAN_BAND_8 = 8, + UTRAN_BAND_9 = 9, + UTRAN_BAND_10 = 10, + UTRAN_BAND_11 = 11, + UTRAN_BAND_12 = 12, + UTRAN_BAND_13 = 13, + UTRAN_BAND_14 = 14, + UTRAN_BAND_19 = 19, + UTRAN_BAND_20 = 20, + UTRAN_BAND_21 = 21, + UTRAN_BAND_22 = 22, + UTRAN_BAND_25 = 25, + UTRAN_BAND_26 = 26, +} RIL_UtranBands; + +typedef enum { + EUTRAN_BAND_1 = 1, + EUTRAN_BAND_2 = 2, + EUTRAN_BAND_3 = 3, + EUTRAN_BAND_4 = 4, + EUTRAN_BAND_5 = 5, + EUTRAN_BAND_6 = 6, + EUTRAN_BAND_7 = 7, + EUTRAN_BAND_8 = 8, + EUTRAN_BAND_9 = 9, + EUTRAN_BAND_10 = 10, + EUTRAN_BAND_11 = 11, + EUTRAN_BAND_12 = 12, + EUTRAN_BAND_13 = 13, + EUTRAN_BAND_14 = 14, + EUTRAN_BAND_17 = 17, + EUTRAN_BAND_18 = 18, + EUTRAN_BAND_19 = 19, + EUTRAN_BAND_20 = 20, + EUTRAN_BAND_21 = 21, + EUTRAN_BAND_22 = 22, + EUTRAN_BAND_23 = 23, + EUTRAN_BAND_24 = 24, + EUTRAN_BAND_25 = 25, + EUTRAN_BAND_26 = 26, + EUTRAN_BAND_27 = 27, + EUTRAN_BAND_28 = 28, + EUTRAN_BAND_30 = 30, + EUTRAN_BAND_31 = 31, + EUTRAN_BAND_33 = 33, + EUTRAN_BAND_34 = 34, + EUTRAN_BAND_35 = 35, + EUTRAN_BAND_36 = 36, + EUTRAN_BAND_37 = 37, + EUTRAN_BAND_38 = 38, + EUTRAN_BAND_39 = 39, + EUTRAN_BAND_40 = 40, + EUTRAN_BAND_41 = 41, + EUTRAN_BAND_42 = 42, + EUTRAN_BAND_43 = 43, + EUTRAN_BAND_44 = 44, + EUTRAN_BAND_45 = 45, + EUTRAN_BAND_46 = 46, + EUTRAN_BAND_47 = 47, + EUTRAN_BAND_48 = 48, + EUTRAN_BAND_65 = 65, + EUTRAN_BAND_66 = 66, + EUTRAN_BAND_68 = 68, + EUTRAN_BAND_70 = 70, +} RIL_EutranBands; + +typedef struct { + RIL_RadioAccessNetworks radio_access_network; // The type of network to scan. + uint32_t bands_length; // Length of bands + union { + RIL_GeranBands geran_bands[MAX_BANDS]; + RIL_UtranBands utran_bands[MAX_BANDS]; + RIL_EutranBands eutran_bands[MAX_BANDS]; + } bands; + uint32_t channels_length; // Length of channels + uint32_t channels[MAX_CHANNELS]; // Frequency channels to scan +} RIL_RadioAccessSpecifier; + +typedef struct { + RIL_ScanType type; // Type of the scan + int32_t interval; // Time interval in seconds + // between periodic scans, only + // valid when type=RIL_PERIODIC + uint32_t specifiers_length; // Length of specifiers + RIL_RadioAccessSpecifier specifiers[MAX_RADIO_ACCESS_NETWORKS]; // Radio access networks + // with bands/channels. +} RIL_NetworkScanRequest; + +typedef enum { + PARTIAL = 0x01, // The result contains a part of the scan results + COMPLETE = 0x02, // The result contains the last part of the scan results +} RIL_ScanStatus; + +typedef struct { + RIL_ScanStatus status; // The status of the scan + uint32_t network_infos_length; // Total length of RIL_CellInfo + RIL_CellInfo_v12* network_infos; // List of network information + RIL_Errno error; +} RIL_NetworkScanResult; + +/** + * RIL_REQUEST_GET_SIM_STATUS + * + * Requests status of the SIM interface and the SIM card + * + * "data" is NULL + * + * "response" is const RIL_CardStatus_v6 * + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_GET_SIM_STATUS 1 + +/** + * RIL_REQUEST_ENTER_SIM_PIN + * + * Supplies SIM PIN. Only called if RIL_CardStatus has RIL_APPSTATE_PIN state + * + * "data" is const char ** + * ((const char **)data)[0] is PIN value + * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ENTER_SIM_PIN 2 + +/** + * RIL_REQUEST_ENTER_SIM_PUK + * + * Supplies SIM PUK and new PIN. + * + * "data" is const char ** + * ((const char **)data)[0] is PUK value + * ((const char **)data)[1] is new PIN value + * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * (PUK is invalid) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ENTER_SIM_PUK 3 + +/** + * RIL_REQUEST_ENTER_SIM_PIN2 + * + * Supplies SIM PIN2. Only called following operation where SIM_PIN2 was + * returned as a a failure from a previous operation. + * + * "data" is const char ** + * ((const char **)data)[0] is PIN2 value + * ((const char **)data)[1] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ENTER_SIM_PIN2 4 + +/** + * RIL_REQUEST_ENTER_SIM_PUK2 + * + * Supplies SIM PUK2 and new PIN2. + * + * "data" is const char ** + * ((const char **)data)[0] is PUK2 value + * ((const char **)data)[1] is new PIN2 value + * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * (PUK2 is invalid) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ENTER_SIM_PUK2 5 + +/** + * RIL_REQUEST_CHANGE_SIM_PIN + * + * Supplies old SIM PIN and new PIN. + * + * "data" is const char ** + * ((const char **)data)[0] is old PIN value + * ((const char **)data)[1] is new PIN value + * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * (old PIN is invalid) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_CHANGE_SIM_PIN 6 + + +/** + * RIL_REQUEST_CHANGE_SIM_PIN2 + * + * Supplies old SIM PIN2 and new PIN2. + * + * "data" is const char ** + * ((const char **)data)[0] is old PIN2 value + * ((const char **)data)[1] is new PIN2 value + * ((const char **)data)[2] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * (old PIN2 is invalid) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + * + */ + +#define RIL_REQUEST_CHANGE_SIM_PIN2 7 + +/** + * RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION + * + * Requests that network personlization be deactivated + * + * "data" is const char ** + * ((const char **)(data))[0]] is network depersonlization code + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * PASSWORD_INCORRECT + * SIM_ABSENT + * (code is invalid) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION 8 + +/** + * RIL_REQUEST_GET_CURRENT_CALLS + * + * Requests current call list + * + * "data" is NULL + * + * "response" must be a "const RIL_Call **" + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * (request will be made again in a few hundred msec) + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_GET_CURRENT_CALLS 9 + + +/** + * RIL_REQUEST_DIAL + * + * Initiate voice call + * + * "data" is const RIL_Dial * + * "response" is NULL + * + * This method is never used for supplementary service codes + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * DIAL_MODIFIED_TO_USSD + * DIAL_MODIFIED_TO_SS + * DIAL_MODIFIED_TO_DIAL + * INVALID_ARGUMENTS + * NO_MEMORY + * INVALID_STATE + * NO_RESOURCES + * INTERNAL_ERR + * FDN_CHECK_FAILURE + * MODEM_ERR + * NO_SUBSCRIPTION + * NO_NETWORK_FOUND + * INVALID_CALL_ID + * DEVICE_IN_USE + * OPERATION_NOT_ALLOWED + * ABORTED + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_DIAL 10 + +/** + * RIL_REQUEST_GET_IMSI + * + * Get the SIM IMSI + * + * Only valid when radio state is "RADIO_STATE_ON" + * + * "data" is const char ** + * ((const char **)data)[0] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * "response" is a const char * containing the IMSI + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_SIM_STATE + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_GET_IMSI 11 + +/** + * RIL_REQUEST_HANGUP + * + * Hang up a specific line (like AT+CHLD=1x) + * + * After this HANGUP request returns, RIL should show the connection is NOT + * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. + * + * "data" is an int * + * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_ARGUMENTS + * NO_MEMORY + * INVALID_STATE + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_CALL_ID + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_HANGUP 12 + +/** + * RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND + * + * Hang up waiting or held (like AT+CHLD=0) + * + * After this HANGUP request returns, RIL should show the connection is NOT + * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_CALL_ID + * NO_RESOURCES + * OPERATION_NOT_ALLOWED + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND 13 + +/** + * RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND + * + * Hang up waiting or held (like AT+CHLD=1) + * + * After this HANGUP request returns, RIL should show the connection is NOT + * active anymore in next RIL_REQUEST_GET_CURRENT_CALLS query. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * OPERATION_NOT_ALLOWED + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND 14 + +/** + * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE + * + * Switch waiting or holding call and active call (like AT+CHLD=2) + * + * State transitions should be is follows: + * + * If call 1 is waiting and call 2 is active, then if this re + * + * BEFORE AFTER + * Call 1 Call 2 Call 1 Call 2 + * ACTIVE HOLDING HOLDING ACTIVE + * ACTIVE WAITING HOLDING ACTIVE + * HOLDING WAITING HOLDING ACTIVE + * ACTIVE IDLE HOLDING IDLE + * IDLE IDLE IDLE IDLE + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_STATE + * INVALID_ARGUMENTS + * INVALID_CALL_ID + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE 15 +#define RIL_REQUEST_SWITCH_HOLDING_AND_ACTIVE 15 + +/** + * RIL_REQUEST_CONFERENCE + * + * Conference holding and active (like AT+CHLD=3) + + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_STATE + * INVALID_CALL_ID + * INVALID_ARGUMENTS + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_CONFERENCE 16 + +/** + * RIL_REQUEST_UDUB + * + * Send UDUB (user determined used busy) to ringing or + * waiting call answer)(RIL_BasicRequest r); + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_RESOURCES + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * OPERATION_NOT_ALLOWED + * INVALID_ARGUMENTS + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_UDUB 17 + +/** + * RIL_REQUEST_LAST_CALL_FAIL_CAUSE + * + * Requests the failure cause code for the most recently terminated call + * + * "data" is NULL + * "response" is a const RIL_LastCallFailCauseInfo * + * RIL_LastCallFailCauseInfo contains LastCallFailCause and vendor cause. + * The vendor cause code must be used for debugging purpose only. + * The implementation must return one of the values of LastCallFailCause + * as mentioned below. + * + * GSM failure reasons codes for the cause codes defined in TS 24.008 Annex H + * where possible. + * CDMA failure reasons codes for the possible call failure scenarios + * described in the "CDMA IS-2000 Release A (C.S0005-A v6.0)" standard. + * Any of the following reason codes if the call is failed or dropped due to reason + * mentioned with in the braces. + * + * CALL_FAIL_RADIO_OFF (Radio is OFF) + * CALL_FAIL_OUT_OF_SERVICE (No cell coverage) + * CALL_FAIL_NO_VALID_SIM (No valid SIM) + * CALL_FAIL_RADIO_INTERNAL_ERROR (Modem hit unexpected error scenario) + * CALL_FAIL_NETWORK_RESP_TIMEOUT (No response from network) + * CALL_FAIL_NETWORK_REJECT (Explicit network reject) + * CALL_FAIL_RADIO_ACCESS_FAILURE (RRC connection failure. Eg.RACH) + * CALL_FAIL_RADIO_LINK_FAILURE (Radio Link Failure) + * CALL_FAIL_RADIO_LINK_LOST (Radio link lost due to poor coverage) + * CALL_FAIL_RADIO_UPLINK_FAILURE (Radio uplink failure) + * CALL_FAIL_RADIO_SETUP_FAILURE (RRC connection setup failure) + * CALL_FAIL_RADIO_RELEASE_NORMAL (RRC connection release, normal) + * CALL_FAIL_RADIO_RELEASE_ABNORMAL (RRC connection release, abnormal) + * CALL_FAIL_ACCESS_CLASS_BLOCKED (Access class barring) + * CALL_FAIL_NETWORK_DETACH (Explicit network detach) + * + * OEM causes (CALL_FAIL_OEM_CAUSE_XX) must be used for debug purpose only + * + * If the implementation does not have access to the exact cause codes, + * then it should return one of the values listed in RIL_LastCallFailCause, + * as the UI layer needs to distinguish these cases for tone generation or + * error notification. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE + */ +#define RIL_REQUEST_LAST_CALL_FAIL_CAUSE 18 + +/** + * RIL_REQUEST_SIGNAL_STRENGTH + * + * Requests current signal strength and associated information + * + * Must succeed if radio is on. + * + * "data" is NULL + * + * "response" is a const RIL_SignalStrength * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SIGNAL_STRENGTH 19 + +/** + * RIL_REQUEST_VOICE_REGISTRATION_STATE + * + * Request current registration state + * + * "data" is NULL + * "response" is a const RIL_VoiceRegistrationStateResponse * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_VOICE_REGISTRATION_STATE 20 + +/** + * RIL_REQUEST_DATA_REGISTRATION_STATE + * + * Request current DATA registration state + * + * "data" is NULL + * "response" is a const RIL_DataRegistrationStateResponse * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_DATA_REGISTRATION_STATE 21 + +/** + * RIL_REQUEST_OPERATOR + * + * Request current operator ONS or EONS + * + * "data" is NULL + * "response" is a "const char **" + * ((const char **)response)[0] is long alpha ONS or EONS + * or NULL if unregistered + * + * ((const char **)response)[1] is short alpha ONS or EONS + * or NULL if unregistered + * ((const char **)response)[2] is 5 or 6 digit numeric code (MCC + MNC) + * or NULL if unregistered + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_OPERATOR 22 + +/** + * RIL_REQUEST_RADIO_POWER + * + * Toggle radio on and off (for "airplane" mode) + * If the radio is is turned off/on the radio modem subsystem + * is expected return to an initialized state. For instance, + * any voice and data calls will be terminated and all associated + * lists emptied. + * + * "data" is int * + * ((int *)data)[0] is > 0 for "Radio On" + * ((int *)data)[0] is == 0 for "Radio Off" + * + * "response" is NULL + * + * Turn radio on if "on" > 0 + * Turn radio off if "on" == 0 + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * INVALID_STATE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * DEVICE_IN_USE + * OPERATION_NOT_ALLOWED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_RADIO_POWER 23 + +/** + * RIL_REQUEST_DTMF + * + * Send a DTMF tone + * + * If the implementation is currently playing a tone requested via + * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone + * should be played instead + * + * "data" is a char * containing a single character with one of 12 values: 0-9,*,# + * "response" is NULL + * + * FIXME should this block/mute microphone? + * How does this interact with local DTMF feedback? + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_RESOURCES + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_DTMF_STOP, RIL_REQUEST_DTMF_START + * + */ +#define RIL_REQUEST_DTMF 24 + +/** + * RIL_REQUEST_SEND_SMS + * + * Send an SMS message + * + * "data" is const char ** + * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed + * by a length byte (as expected by TS 27.005) or NULL for default SMSC + * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string + * less the SMSC address + * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" + * + * "response" is a const RIL_SMS_Response * + * + * Based on the return error, caller decides to resend if sending sms + * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SMS_SEND_FAIL_RETRY + * FDN_CHECK_FAILURE + * NETWORK_REJECT + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * INVALID_SMS_FORMAT + * SYSTEM_ERR + * ENCODING_ERR + * INVALID_SMSC_ADDRESS + * MODEM_ERR + * NETWORK_ERR + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * MODE_NOT_SUPPORTED + * SIM_ABSENT + * + * FIXME how do we specify TP-Message-Reference if we need to resend? + */ +#define RIL_REQUEST_SEND_SMS 25 + + +/** + * RIL_REQUEST_SEND_SMS_EXPECT_MORE + * + * Send an SMS message. Identical to RIL_REQUEST_SEND_SMS, + * except that more messages are expected to be sent soon. If possible, + * keep SMS relay protocol link open (eg TS 27.005 AT+CMMS command) + * + * "data" is const char ** + * ((const char **)data)[0] is SMSC address in GSM BCD format prefixed + * by a length byte (as expected by TS 27.005) or NULL for default SMSC + * ((const char **)data)[1] is SMS in PDU format as an ASCII hex string + * less the SMSC address + * TP-Layer-Length is be "strlen(((const char **)data)[1])/2" + * + * "response" is a const RIL_SMS_Response * + * + * Based on the return error, caller decides to resend if sending sms + * fails. SMS_SEND_FAIL_RETRY means retry (i.e. error cause is 332) + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SMS_SEND_FAIL_RETRY + * NETWORK_REJECT + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * INVALID_SMS_FORMAT + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * FDN_CHECK_FAILURE + * MODEM_ERR + * NETWORK_ERR + * ENCODING_ERR + * INVALID_SMSC_ADDRESS + * OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * MODE_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_SEND_SMS_EXPECT_MORE 26 + + +/** + * RIL_REQUEST_SETUP_DATA_CALL + * + * Setup a packet data connection. If RIL_Data_Call_Response_v6.status + * return success it is added to the list of data calls and a + * RIL_UNSOL_DATA_CALL_LIST_CHANGED is sent. The call remains in the + * list until RIL_REQUEST_DEACTIVATE_DATA_CALL is issued or the + * radio is powered off/on. This list is returned by RIL_REQUEST_DATA_CALL_LIST + * and RIL_UNSOL_DATA_CALL_LIST_CHANGED. + * + * The RIL is expected to: + * - Create one data call context. + * - Create and configure a dedicated interface for the context + * - The interface must be point to point. + * - The interface is configured with one or more addresses and + * is capable of sending and receiving packets. The prefix length + * of the addresses must be /32 for IPv4 and /128 for IPv6. + * - Must NOT change the linux routing table. + * - Support up to RIL_REQUEST_DATA_REGISTRATION_STATE response[5] + * number of simultaneous data call contexts. + * + * "data" is a const char ** + * ((const char **)data)[0] Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2... + * for values above 2 this is RIL_RadioTechnology + 2. + * ((const char **)data)[1] is a RIL_DataProfile (support is optional) + * ((const char **)data)[2] is the APN to connect to if radio technology is GSM/UMTS. This APN will + * override the one in the profile. NULL indicates no APN overrride. + * ((const char **)data)[3] is the username for APN, or NULL + * ((const char **)data)[4] is the password for APN, or NULL + * ((const char **)data)[5] is the PAP / CHAP auth type. Values: + * 0 => PAP and CHAP is never performed. + * 1 => PAP may be performed; CHAP is never performed. + * 2 => CHAP may be performed; PAP is never performed. + * 3 => PAP / CHAP may be performed - baseband dependent. + * ((const char **)data)[6] is the non-roaming/home connection type to request. Must be one of the + * PDP_type values in TS 27.007 section 10.1.1. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + * ((const char **)data)[7] is the roaming connection type to request. Must be one of the + * PDP_type values in TS 27.007 section 10.1.1. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + * ((const char **)data)[8] is the bitmask of APN type in decimal string format. The + * bitmask will encapsulate the following values: + * ia,mms,agps,supl,hipri,fota,dun,ims,default. + * ((const char **)data)[9] is the bearer bitmask in decimal string format. Each bit is a + * RIL_RadioAccessFamily. "0" or NULL indicates all RATs. + * ((const char **)data)[10] is the boolean in string format indicating the APN setting was + * sent to the modem through RIL_REQUEST_SET_DATA_PROFILE earlier. + * ((const char **)data)[11] is the mtu size in bytes of the mobile interface to which + * the apn is connected. + * ((const char **)data)[12] is the MVNO type: + * possible values are "imsi", "gid", "spn". + * ((const char **)data)[13] is MVNO match data in string. Can be anything defined by the carrier. + * For example, + * SPN like: "A MOBILE", "BEN NL", etc... + * IMSI like: "302720x94", "2060188", etc... + * GID like: "4E", "33", etc... + * ((const char **)data)[14] is the boolean string indicating data roaming is allowed or not. "1" + * indicates data roaming is enabled by the user, "0" indicates disabled. + * + * "response" is a RIL_Data_Call_Response_v11 + * + * FIXME may need way to configure QoS settings + * + * Valid errors: + * SUCCESS should be returned on both success and failure of setup with + * the RIL_Data_Call_Response_v6.status containing the actual status. + * For all other errors the RIL_Data_Call_Resonse_v6 is ignored. + * + * Other errors could include: + * RADIO_NOT_AVAILABLE, OP_NOT_ALLOWED_BEFORE_REG_TO_NW, + * OP_NOT_ALLOWED_DURING_VOICE_CALL, REQUEST_NOT_SUPPORTED, + * INVALID_ARGUMENTS, INTERNAL_ERR, NO_MEMORY, NO_RESOURCES, + * CANCELLED and SIM_ABSENT + * + * See also: RIL_REQUEST_DEACTIVATE_DATA_CALL + */ +#define RIL_REQUEST_SETUP_DATA_CALL 27 + + +/** + * RIL_REQUEST_SIM_IO + * + * Request SIM I/O operation. + * This is similar to the TS 27.007 "restricted SIM" operation + * where it assumes all of the EF selection will be done by the + * callee. + * + * "data" is a const RIL_SIM_IO_v6 * + * Please note that RIL_SIM_IO has a "PIN2" field which may be NULL, + * or may specify a PIN2 for operations that require a PIN2 (eg + * updating FDN records) + * + * "response" is a const RIL_SIM_IO_Response * + * + * Arguments and responses that are unused for certain + * values of "command" should be ignored or set to NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SIM_PIN2 + * SIM_PUK2 + * INVALID_SIM_STATE + * SIM_ERR + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_IO 28 + +/** + * RIL_REQUEST_SEND_USSD + * + * Send a USSD message + * + * If a USSD session already exists, the message should be sent in the + * context of that session. Otherwise, a new session should be created. + * + * The network reply should be reported via RIL_UNSOL_ON_USSD + * + * Only one USSD session may exist at a time, and the session is assumed + * to exist until: + * a) The android system invokes RIL_REQUEST_CANCEL_USSD + * b) The implementation sends a RIL_UNSOL_ON_USSD with a type code + * of "0" (USSD-Notify/no further action) or "2" (session terminated) + * + * "data" is a const char * containing the USSD request in UTF-8 format + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * FDN_CHECK_FAILURE + * USSD_MODIFIED_TO_DIAL + * USSD_MODIFIED_TO_SS + * USSD_MODIFIED_TO_USSD + * SIM_BUSY + * OPERATION_NOT_ALLOWED + * INVALID_ARGUMENTS + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * ABORTED + * SYSTEM_ERR + * INVALID_STATE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_CANCEL_USSD, RIL_UNSOL_ON_USSD + */ + +#define RIL_REQUEST_SEND_USSD 29 + +/** + * RIL_REQUEST_CANCEL_USSD + * + * Cancel the current USSD session if one exists + * + * "data" is null + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SIM_BUSY + * OPERATION_NOT_ALLOWED + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_STATE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_CANCEL_USSD 30 + +/** + * RIL_REQUEST_GET_CLIR + * + * Gets current CLIR status + * "data" is NULL + * "response" is int * + * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 + * ((int *)data)[1] is "m" parameter from TS 27.007 7.7 + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * FDN_CHECK_FAILURE + * SYSTEM_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_GET_CLIR 31 + +/** + * RIL_REQUEST_SET_CLIR + * + * "data" is int * + * ((int *)data)[0] is "n" parameter from TS 27.007 7.7 + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * SYSTEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SET_CLIR 32 + +/** + * RIL_REQUEST_QUERY_CALL_FORWARD_STATUS + * + * "data" is const RIL_CallForwardInfo * + * + * "response" is const RIL_CallForwardInfo ** + * "response" points to an array of RIL_CallForwardInfo *'s, one for + * each distinct registered phone number. + * + * For example, if data is forwarded to +18005551212 and voice is forwarded + * to +18005559999, then two separate RIL_CallForwardInfo's should be returned + * + * If, however, both data and voice are forwarded to +18005551212, then + * a single RIL_CallForwardInfo can be returned with the service class + * set to "data + voice = 3") + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_QUERY_CALL_FORWARD_STATUS 33 + + +/** + * RIL_REQUEST_SET_CALL_FORWARD + * + * Configure call forward rule + * + * "data" is const RIL_CallForwardInfo * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_STATE + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SET_CALL_FORWARD 34 + + +/** + * RIL_REQUEST_QUERY_CALL_WAITING + * + * Query current call waiting state + * + * "data" is const int * + * ((const int *)data)[0] is the TS 27.007 service class to query. + * "response" is a const int * + * ((const int *)response)[0] is 0 for "disabled" and 1 for "enabled" + * + * If ((const int *)response)[0] is = 1, then ((const int *)response)[1] + * must follow, with the TS 27.007 service class bit vector of services + * for which call waiting is enabled. + * + * For example, if ((const int *)response)[0] is 1 and + * ((const int *)response)[1] is 3, then call waiting is enabled for data + * and voice and disabled for everything else + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * FDN_CHECK_FAILURE + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_QUERY_CALL_WAITING 35 + + +/** + * RIL_REQUEST_SET_CALL_WAITING + * + * Configure current call waiting state + * + * "data" is const int * + * ((const int *)data)[0] is 0 for "disabled" and 1 for "enabled" + * ((const int *)data)[1] is the TS 27.007 service class bit vector of + * services to modify + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * INVALID_STATE + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SET_CALL_WAITING 36 + +/** + * RIL_REQUEST_SMS_ACKNOWLEDGE + * + * Acknowledge successful or failed receipt of SMS previously indicated + * via RIL_UNSOL_RESPONSE_NEW_SMS + * + * "data" is int * + * ((int *)data)[0] is 1 on successful receipt + * (basically, AT+CNMA=1 from TS 27.005 + * is 0 on failed receipt + * (basically, AT+CNMA=2 from TS 27.005) + * ((int *)data)[1] if data[0] is 0, this contains the failure cause as defined + * in TS 23.040, 9.2.3.22. Currently only 0xD3 (memory + * capacity exceeded) and 0xFF (unspecified error) are + * reported. + * + * "response" is NULL + * + * FIXME would like request that specified RP-ACK/RP-ERROR PDU + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SMS_ACKNOWLEDGE 37 + +/** + * RIL_REQUEST_GET_IMEI - DEPRECATED + * + * Get the device IMEI, including check digit + * + * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY + * Valid when RadioState is not RADIO_STATE_UNAVAILABLE + * + * "data" is NULL + * "response" is a const char * containing the IMEI + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ + +#define RIL_REQUEST_GET_IMEI 38 + +/** + * RIL_REQUEST_GET_IMEISV - DEPRECATED + * + * Get the device IMEISV, which should be two decimal digits + * + * The request is DEPRECATED, use RIL_REQUEST_DEVICE_IDENTITY + * Valid when RadioState is not RADIO_STATE_UNAVAILABLE + * + * "data" is NULL + * "response" is a const char * containing the IMEISV + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ + +#define RIL_REQUEST_GET_IMEISV 39 + + +/** + * RIL_REQUEST_ANSWER + * + * Answer incoming call + * + * Will not be called for WAITING calls. + * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case + * instead + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_ANSWER 40 + +/** + * RIL_REQUEST_DEACTIVATE_DATA_CALL + * + * Deactivate packet data connection and remove from the + * data call list if SUCCESS is returned. Any other return + * values should also try to remove the call from the list, + * but that may not be possible. In any event a + * RIL_REQUEST_RADIO_POWER off/on must clear the list. An + * RIL_UNSOL_DATA_CALL_LIST_CHANGED is not expected to be + * issued because of an RIL_REQUEST_DEACTIVATE_DATA_CALL. + * + * "data" is const char ** + * ((char**)data)[0] indicating CID + * ((char**)data)[1] indicating Disconnect Reason + * 0 => No specific reason specified + * 1 => Radio shutdown requested + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_CALL_ID + * INVALID_STATE + * INVALID_ARGUMENTS + * REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * SIM_ABSENT + * + * See also: RIL_REQUEST_SETUP_DATA_CALL + */ +#define RIL_REQUEST_DEACTIVATE_DATA_CALL 41 + +/** + * RIL_REQUEST_QUERY_FACILITY_LOCK + * + * Query the status of a facility lock state + * + * "data" is const char ** + * ((const char **)data)[0] is the facility string code from TS 27.007 7.4 + * (eg "AO" for BAOC, "SC" for SIM lock) + * ((const char **)data)[1] is the password, or "" if not required + * ((const char **)data)[2] is the TS 27.007 service class bit vector of + * services to query + * ((const char **)data)[3] is AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * This is only applicable in the case of Fixed Dialing Numbers + * (FDN) requests. + * + * "response" is an int * + * ((const int *)response) 0 is the TS 27.007 service class bit vector of + * services for which the specified barring facility + * is active. "0" means "disabled for all" + * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_QUERY_FACILITY_LOCK 42 + +/** + * RIL_REQUEST_SET_FACILITY_LOCK + * + * Enable/disable one facility lock + * + * "data" is const char ** + * + * ((const char **)data)[0] = facility string code from TS 27.007 7.4 + * (eg "AO" for BAOC) + * ((const char **)data)[1] = "0" for "unlock" and "1" for "lock" + * ((const char **)data)[2] = password + * ((const char **)data)[3] = string representation of decimal TS 27.007 + * service class bit vector. Eg, the string + * "1" means "set this facility for voice services" + * ((const char **)data)[4] = AID value, See ETSI 102.221 8.1 and 101.220 4, NULL if no value. + * This is only applicable in the case of Fixed Dialing Numbers + * (FDN) requests. + * + * "response" is int * + * ((int *)response)[0] is the number of retries remaining, or -1 if unknown + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * INTERNAL_ERR + * NO_MEMORY + * MODEM_ERR + * INVALID_STATE + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_SET_FACILITY_LOCK 43 + +/** + * RIL_REQUEST_CHANGE_BARRING_PASSWORD + * + * Change call barring facility password + * + * "data" is const char ** + * + * ((const char **)data)[0] = facility string code from TS 27.007 7.4 + * (eg "AO" for BAOC) + * ((const char **)data)[1] = old password + * ((const char **)data)[2] = new password + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * INVALID_ARGUMENTS + * NO_MEMORY + * MODEM_ERR + * INTERNAL_ERR + * SYSTEM_ERR + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CHANGE_BARRING_PASSWORD 44 + +/** + * RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE + * + * Query current network selectin mode + * + * "data" is NULL + * + * "response" is int * + * ((const int *)response)[0] is + * 0 for automatic selection + * 1 for manual selection + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE 45 + +/** + * RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC + * + * Specify that the network should be selected automatically + * + * "data" is NULL + * "response" is NULL + * + * This request must not respond until the new operator is selected + * and registered + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * ILLEGAL_SIM_OR_ME + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and + * no retries needed, such as illegal SIM or ME. + * + */ +#define RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC 46 + +/** + * RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL + * + * Manually select a specified network. + * + * "data" is const char * specifying MCCMNC of network to select (eg "310170") + * "response" is NULL + * + * This request must not respond until the new operator is selected + * and registered + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * ILLEGAL_SIM_OR_ME + * OPERATION_NOT_ALLOWED + * INVALID_STATE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * Note: Returns ILLEGAL_SIM_OR_ME when the failure is permanent and + * no retries needed, such as illegal SIM or ME. + * + */ +#define RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL 47 + +/** + * RIL_REQUEST_QUERY_AVAILABLE_NETWORKS + * + * Scans for available networks + * + * "data" is NULL + * "response" is const char ** that should be an array of n*4 strings, where + * n is the number of available networks + * For each available network: + * + * ((const char **)response)[n+0] is long alpha ONS or EONS + * ((const char **)response)[n+1] is short alpha ONS or EONS + * ((const char **)response)[n+2] is 5 or 6 digit numeric code (MCC + MNC) + * ((const char **)response)[n+3] is a string value of the status: + * "unknown" + * "available" + * "current" + * "forbidden" + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * ABORTED + * DEVICE_IN_USE + * INTERNAL_ERR + * NO_MEMORY + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * CANCELLED + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_QUERY_AVAILABLE_NETWORKS 48 + +/** + * RIL_REQUEST_DTMF_START + * + * Start playing a DTMF tone. Continue playing DTMF tone until + * RIL_REQUEST_DTMF_STOP is received + * + * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing, + * it should cancel the previous tone and play the new one. + * + * "data" is a char * + * ((char *)data)[0] is a single character with one of 12 values: 0-9,*,# + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_RESOURCES + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_STOP + */ +#define RIL_REQUEST_DTMF_START 49 + +/** + * RIL_REQUEST_DTMF_STOP + * + * Stop playing a currently playing DTMF tone. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * NO_MEMORY + * INVALID_ARGUMENTS + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_DTMF, RIL_REQUEST_DTMF_START + */ +#define RIL_REQUEST_DTMF_STOP 50 + +/** + * RIL_REQUEST_BASEBAND_VERSION + * + * Return string value indicating baseband version, eg + * response from AT+CGMR + * + * "data" is NULL + * "response" is const char * containing version string for log reporting + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * EMPTY_RECORD + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_BASEBAND_VERSION 51 + +/** + * RIL_REQUEST_SEPARATE_CONNECTION + * + * Separate a party from a multiparty call placing the multiparty call + * (less the specified party) on hold and leaving the specified party + * as the only other member of the current (active) call + * + * Like AT+CHLD=2x + * + * See TS 22.084 1.3.8.2 (iii) + * TS 22.030 6.5.5 "Entering "2X followed by send" + * TS 27.007 "AT+CHLD=2x" + * + * "data" is an int * + * (int *)data)[0] contains Connection index (value of 'x' in CHLD above) "response" is NULL + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_ARGUMENTS + * INVALID_STATE + * NO_RESOURCES + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * INVALID_STATE + * OPERATION_NOT_ALLOWED + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SEPARATE_CONNECTION 52 + + +/** + * RIL_REQUEST_SET_MUTE + * + * Turn on or off uplink (microphone) mute. + * + * Will only be sent while voice call is active. + * Will always be reset to "disable mute" when a new voice call is initiated + * + * "data" is an int * + * (int *)data)[0] is 1 for "enable mute" and 0 for "disable mute" + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_ARGUMENTS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_SET_MUTE 53 + +/** + * RIL_REQUEST_GET_MUTE + * + * Queries the current state of the uplink mute setting + * + * "data" is NULL + * "response" is an int * + * (int *)response)[0] is 1 for "mute enabled" and 0 for "mute disabled" + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * SS_MODIFIED_TO_DIAL + * SS_MODIFIED_TO_USSD + * SS_MODIFIED_TO_SS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_GET_MUTE 54 + +/** + * RIL_REQUEST_QUERY_CLIP + * + * Queries the status of the CLIP supplementary service + * + * (for MMI code "*#30#") + * + * "data" is NULL + * "response" is an int * + * (int *)response)[0] is 1 for "CLIP provisioned" + * and 0 for "CLIP not provisioned" + * and 2 for "unknown, e.g. no network etc" + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * FDN_CHECK_FAILURE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_QUERY_CLIP 55 + +/** + * RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE - Deprecated use the status + * field in RIL_Data_Call_Response_v6. + * + * Requests the failure cause code for the most recently failed PDP + * context or CDMA data connection active + * replaces RIL_REQUEST_LAST_PDP_FAIL_CAUSE + * + * "data" is NULL + * + * "response" is a "int *" + * ((int *)response)[0] is an integer cause code defined in TS 24.008 + * section 6.1.3.1.3 or close approximation + * + * If the implementation does not have access to the exact cause codes, + * then it should return one of the values listed in + * RIL_DataCallFailCause, as the UI layer needs to distinguish these + * cases for error notification + * and potential retries. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_LAST_CALL_FAIL_CAUSE + * + * Deprecated use the status field in RIL_Data_Call_Response_v6. + */ + +#define RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE 56 + +/** + * RIL_REQUEST_DATA_CALL_LIST + * + * Returns the data call list. An entry is added when a + * RIL_REQUEST_SETUP_DATA_CALL is issued and removed on a + * RIL_REQUEST_DEACTIVATE_DATA_CALL. The list is emptied + * when RIL_REQUEST_RADIO_POWER off/on is issued. + * + * "data" is NULL + * "response" is an array of RIL_Data_Call_Response_v6 + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * + * See also: RIL_UNSOL_DATA_CALL_LIST_CHANGED + */ + +#define RIL_REQUEST_DATA_CALL_LIST 57 + +/** + * RIL_REQUEST_RESET_RADIO - DEPRECATED + * + * Request a radio reset. The RIL implementation may postpone + * the reset until after this request is responded to if the baseband + * is presently busy. + * + * The request is DEPRECATED, use RIL_REQUEST_RADIO_POWER + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * REQUEST_NOT_SUPPORTED + */ + +#define RIL_REQUEST_RESET_RADIO 58 + +/** + * RIL_REQUEST_OEM_HOOK_RAW + * + * This request reserved for OEM-specific uses. It passes raw byte arrays + * back and forth. + * + * It can be invoked on the Java side from + * com.android.internal.telephony.Phone.invokeOemRilRequestRaw() + * + * "data" is a char * of bytes copied from the byte[] data argument in java + * "response" is a char * of bytes that will returned via the + * caller's "response" Message here: + * (byte[])(((AsyncResult)response.obj).result) + * + * An error response here will result in + * (((AsyncResult)response.obj).result) == null and + * (((AsyncResult)response.obj).exception) being an instance of + * com.android.internal.telephony.gsm.CommandException + * + * Valid errors: + * All + */ + +#define RIL_REQUEST_OEM_HOOK_RAW 59 + +/** + * RIL_REQUEST_OEM_HOOK_STRINGS + * + * This request reserved for OEM-specific uses. It passes strings + * back and forth. + * + * It can be invoked on the Java side from + * com.android.internal.telephony.Phone.invokeOemRilRequestStrings() + * + * "data" is a const char **, representing an array of null-terminated UTF-8 + * strings copied from the "String[] strings" argument to + * invokeOemRilRequestStrings() + * + * "response" is a const char **, representing an array of null-terminated UTF-8 + * stings that will be returned via the caller's response message here: + * + * (String[])(((AsyncResult)response.obj).result) + * + * An error response here will result in + * (((AsyncResult)response.obj).result) == null and + * (((AsyncResult)response.obj).exception) being an instance of + * com.android.internal.telephony.gsm.CommandException + * + * Valid errors: + * All + */ + +#define RIL_REQUEST_OEM_HOOK_STRINGS 60 + +/** + * RIL_REQUEST_SCREEN_STATE - DEPRECATED + * + * Indicates the current state of the screen. When the screen is off, the + * RIL should notify the baseband to suppress certain notifications (eg, + * signal strength and changes in LAC/CID or BID/SID/NID/latitude/longitude) + * in an effort to conserve power. These notifications should resume when the + * screen is on. + * + * Note this request is deprecated. Use RIL_REQUEST_SEND_DEVICE_STATE to report the device state + * to the modem and use RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER to turn on/off unsolicited + * response from the modem in different scenarios. + * + * "data" is int * + * ((int *)data)[0] is == 1 for "Screen On" + * ((int *)data)[0] is == 0 for "Screen Off" + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SCREEN_STATE 61 + + +/** + * RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION + * + * Enables/disables supplementary service related notifications + * from the network. + * + * Notifications are reported via RIL_UNSOL_SUPP_SVC_NOTIFICATION. + * + * "data" is int * + * ((int *)data)[0] is == 1 for notifications enabled + * ((int *)data)[0] is == 0 for notifications disabled + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SIM_BUSY + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_UNSOL_SUPP_SVC_NOTIFICATION. + */ +#define RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION 62 + +/** + * RIL_REQUEST_WRITE_SMS_TO_SIM + * + * Stores a SMS message to SIM memory. + * + * "data" is RIL_SMS_WriteArgs * + * + * "response" is int * + * ((const int *)response)[0] is the record index where the message is stored. + * + * Valid errors: + * SUCCESS + * SIM_FULL + * INVALID_ARGUMENTS + * INVALID_SMS_FORMAT + * INTERNAL_ERR + * MODEM_ERR + * ENCODING_ERR + * NO_MEMORY + * NO_RESOURCES + * INVALID_MODEM_STATE + * OPERATION_NOT_ALLOWED + * INVALID_SMSC_ADDRESS + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_WRITE_SMS_TO_SIM 63 + +/** + * RIL_REQUEST_DELETE_SMS_ON_SIM + * + * Deletes a SMS message from SIM memory. + * + * "data" is int * + * ((int *)data)[0] is the record index of the message to delete. + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * SIM_FULL + * INVALID_ARGUMENTS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * MODEM_ERR + * NO_SUCH_ENTRY + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_DELETE_SMS_ON_SIM 64 + +/** + * RIL_REQUEST_SET_BAND_MODE + * + * Assign a specified band for RF configuration. + * + * "data" is int * + * ((int *)data)[0] is a RIL_RadioBandMode + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * See also: RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE + */ +#define RIL_REQUEST_SET_BAND_MODE 65 + +/** + * RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE + * + * Query the list of band mode supported by RF. + * + * "data" is NULL + * + * "response" is int * + * "response" points to an array of int's, the int[0] is the size of array; + * subsequent values are a list of RIL_RadioBandMode listing supported modes. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * See also: RIL_REQUEST_SET_BAND_MODE + */ +#define RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE 66 + +/** + * RIL_REQUEST_STK_GET_PROFILE + * + * Requests the profile of SIM tool kit. + * The profile indicates the SAT/USAT features supported by ME. + * The SAT/USAT features refer to 3GPP TS 11.14 and 3GPP TS 31.111 + * + * "data" is NULL + * + * "response" is a const char * containing SAT/USAT profile + * in hexadecimal format string starting with first byte of terminal profile + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_STK_GET_PROFILE 67 + +/** + * RIL_REQUEST_STK_SET_PROFILE + * + * Download the STK terminal profile as part of SIM initialization + * procedure + * + * "data" is a const char * containing SAT/USAT profile + * in hexadecimal format string starting with first byte of terminal profile + * + * "response" is NULL + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_STK_SET_PROFILE 68 + +/** + * RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND + * + * Requests to send a SAT/USAT envelope command to SIM. + * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111 + * + * "data" is a const char * containing SAT/USAT command + * in hexadecimal format string starting with command tag + * + * "response" is a const char * containing SAT/USAT response + * in hexadecimal format string starting with first byte of response + * (May be NULL) + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * SIM_BUSY + * OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND 69 + +/** + * RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE + * + * Requests to send a terminal response to SIM for a received + * proactive command + * + * "data" is a const char * containing SAT/USAT response + * in hexadecimal format string starting with first byte of response data + * + * "response" is NULL + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * RIL_E_OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE 70 + +/** + * RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM + * + * When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has + * been initialized by ME already. (We could see the call has been in the 'call + * list') So, STK application needs to accept/reject the call according as user + * operations. + * + * "data" is int * + * ((int *)data)[0] is > 0 for "accept" the call setup + * ((int *)data)[0] is == 0 for "reject" the call setup + * + * "response" is NULL + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * RIL_E_OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM 71 + +/** + * RIL_REQUEST_EXPLICIT_CALL_TRANSFER + * + * Connects the two calls and disconnects the subscriber from both calls. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * INVALID_STATE + * NO_RESOURCES + * NO_MEMORY + * INVALID_ARGUMENTS + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * INVALID_STATE + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_EXPLICIT_CALL_TRANSFER 72 + +/** + * RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE + * + * Requests to set the preferred network type for searching and registering + * (CS/PS domain, RAT, and operation mode) + * + * "data" is int * which is RIL_PreferredNetworkType + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * OPERATION_NOT_ALLOWED + * MODE_NOT_SUPPORTED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE 73 + +/** + * RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE + * + * Query the preferred network type (CS/PS domain, RAT, and operation mode) + * for searching and registering + * + * "data" is NULL + * + * "response" is int * + * ((int *)reponse)[0] is == RIL_PreferredNetworkType + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * See also: RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE + */ +#define RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE 74 + +/** + * RIL_REQUEST_NEIGHBORING_CELL_IDS + * + * Request neighboring cell id in GSM network + * + * "data" is NULL + * "response" must be a " const RIL_NeighboringCell** " + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NO_NETWORK_FOUND + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_GET_NEIGHBORING_CELL_IDS 75 + +/** + * RIL_REQUEST_SET_LOCATION_UPDATES + * + * Enables/disables network state change notifications due to changes in + * LAC and/or CID (for GSM) or BID/SID/NID/latitude/longitude (for CDMA). + * Basically +CREG=2 vs. +CREG=1 (TS 27.007). + * + * Note: The RIL implementation should default to "updates enabled" + * when the screen is on and "updates disabled" when the screen is off. + * + * "data" is int * + * ((int *)data)[0] is == 1 for updates enabled (+CREG=2) + * ((int *)data)[0] is == 0 for updates disabled (+CREG=1) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + * See also: RIL_REQUEST_SCREEN_STATE, RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED + */ +#define RIL_REQUEST_SET_LOCATION_UPDATES 76 + +/** + * RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE + * + * Request to set the location where the CDMA subscription shall + * be retrieved + * + * "data" is int * + * ((int *)data)[0] is == RIL_CdmaSubscriptionSource + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SIM_ABSENT + * SUBSCRIPTION_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE + */ +#define RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE 77 + +/** + * RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE + * + * Request to set the roaming preferences in CDMA + * + * "data" is int * + * ((int *)data)[0] is == 0 for Home Networks only, as defined in PRL + * ((int *)data)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL + * ((int *)data)[0] is == 2 for Roaming on Any Network, as defined in the PRL + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE 78 + +/** + * RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE + * + * Request the actual setting of the roaming preferences in CDMA in the modem + * + * "data" is NULL + * + * "response" is int * + * ((int *)response)[0] is == 0 for Home Networks only, as defined in PRL + * ((int *)response)[0] is == 1 for Roaming on Affiliated networks, as defined in PRL + * ((int *)response)[0] is == 2 for Roaming on Any Network, as defined in the PRL + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE 79 + +/** + * RIL_REQUEST_SET_TTY_MODE + * + * Request to set the TTY mode + * + * "data" is int * + * ((int *)data)[0] is == 0 for TTY off + * ((int *)data)[0] is == 1 for TTY Full + * ((int *)data)[0] is == 2 for TTY HCO (hearing carryover) + * ((int *)data)[0] is == 3 for TTY VCO (voice carryover) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_ARGUMENTS + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SET_TTY_MODE 80 + +/** + * RIL_REQUEST_QUERY_TTY_MODE + * + * Request the setting of TTY mode + * + * "data" is NULL + * + * "response" is int * + * ((int *)response)[0] is == 0 for TTY off + * ((int *)response)[0] is == 1 for TTY Full + * ((int *)response)[0] is == 2 for TTY HCO (hearing carryover) + * ((int *)response)[0] is == 3 for TTY VCO (voice carryover) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_QUERY_TTY_MODE 81 + +/** + * RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE + * + * Request to set the preferred voice privacy mode used in voice + * scrambling + * + * "data" is int * + * ((int *)data)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask) + * ((int *)data)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_CALL_ID + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE 82 + +/** + * RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE + * + * Request the setting of preferred voice privacy mode + * + * "data" is NULL + * + * "response" is int * + * ((int *)response)[0] is == 0 for Standard Privacy Mode (Public Long Code Mask) + * ((int *)response)[0] is == 1 for Enhanced Privacy Mode (Private Long Code Mask) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * MODEM_ERR + * INTERNAL_ERR + * NO_MEMORY + * INVALID_ARGUMENTS + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE 83 + +/** + * RIL_REQUEST_CDMA_FLASH + * + * Send FLASH + * + * "data" is const char * + * ((const char *)data)[0] is a FLASH string + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * INVALID_STATE + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_FLASH 84 + +/** + * RIL_REQUEST_CDMA_BURST_DTMF + * + * Send DTMF string + * + * "data" is const char ** + * ((const char **)data)[0] is a DTMF string + * ((const char **)data)[1] is the DTMF ON length in milliseconds, or 0 to use + * default + * ((const char **)data)[2] is the DTMF OFF length in milliseconds, or 0 to use + * default + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * MODEM_ERR + * INTERNAL_ERR + * INVALID_CALL_ID + * NO_RESOURCES + * CANCELLED + * OPERATION_NOT_ALLOWED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_BURST_DTMF 85 + +/** + * RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY + * + * Takes a 26 digit string (20 digit AKEY + 6 digit checksum). + * If the checksum is valid the 20 digit AKEY is written to NV, + * replacing the existing AKEY no matter what it was before. + * + * "data" is const char * + * ((const char *)data)[0] is a 26 digit string (ASCII digits '0'-'9') + * where the last 6 digits are a checksum of the + * first 20, as specified in TR45.AHAG + * "Common Cryptographic Algorithms, Revision D.1 + * Section 2.2" + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY 86 + +/** + * RIL_REQUEST_CDMA_SEND_SMS + * + * Send a CDMA SMS message + * + * "data" is const RIL_CDMA_SMS_Message * + * + * "response" is a const RIL_SMS_Response * + * + * Based on the return error, caller decides to resend if sending sms + * fails. The CDMA error class is derived as follows, + * SUCCESS is error class 0 (no error) + * SMS_SEND_FAIL_RETRY is error class 2 (temporary failure) + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SMS_SEND_FAIL_RETRY + * NETWORK_REJECT + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * INVALID_SMS_FORMAT + * SYSTEM_ERR + * FDN_CHECK_FAILURE + * MODEM_ERR + * NETWORK_ERR + * ENCODING_ERR + * INVALID_SMSC_ADDRESS + * OPERATION_NOT_ALLOWED + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * MODE_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_CDMA_SEND_SMS 87 + +/** + * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE + * + * Acknowledge the success or failure in the receipt of SMS + * previously indicated via RIL_UNSOL_RESPONSE_CDMA_NEW_SMS + * + * "data" is const RIL_CDMA_SMS_Ack * + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_SMS_TO_ACK + * INVALID_STATE + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * MODEM_ERR + * INVALID_STATE + * OPERATION_NOT_ALLOWED + * NETWORK_NOT_READY + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE 88 + +/** + * RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG + * + * Request the setting of GSM/WCDMA Cell Broadcast SMS config. + * + * "data" is NULL + * + * "response" is a const RIL_GSM_BroadcastSmsConfigInfo ** + * "responselen" is count * sizeof (RIL_GSM_BroadcastSmsConfigInfo *) + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * NO_RESOURCES + * MODEM_ERR + * SYSTEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG 89 + +/** + * RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG + * + * Set GSM/WCDMA Cell Broadcast SMS config + * + * "data" is a const RIL_GSM_BroadcastSmsConfigInfo ** + * "datalen" is count * sizeof(RIL_GSM_BroadcastSmsConfigInfo *) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * SYSTEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG 90 + +/** + * RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION + * +* Enable or disable the reception of GSM/WCDMA Cell Broadcast SMS + * + * "data" is const int * + * (const int *)data[0] indicates to activate or turn off the + * reception of GSM/WCDMA Cell Broadcast SMS, 0-1, + * 0 - Activate, 1 - Turn off + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * REQUEST_RATE_LIMITED +* MODEM_ERR +* INTERNAL_ERR +* NO_RESOURCES +* CANCELLED +* INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION 91 + +/** + * RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG + * + * Request the setting of CDMA Broadcast SMS config + * + * "data" is NULL + * + * "response" is a const RIL_CDMA_BroadcastSmsConfigInfo ** + * "responselen" is count * sizeof (RIL_CDMA_BroadcastSmsConfigInfo *) + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * NO_RESOURCES + * MODEM_ERR + * SYSTEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG 92 + +/** + * RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG + * + * Set CDMA Broadcast SMS config + * + * "data" is a const RIL_CDMA_BroadcastSmsConfigInfo ** + * "datalen" is count * sizeof(const RIL_CDMA_BroadcastSmsConfigInfo *) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * SYSTEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG 93 + +/** + * RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION + * + * Enable or disable the reception of CDMA Broadcast SMS + * + * "data" is const int * + * (const int *)data[0] indicates to activate or turn off the + * reception of CDMA Broadcast SMS, 0-1, + * 0 - Activate, 1 - Turn off + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_STATE + * INVALID_ARGUMENTS + * NO_MEMORY + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION 94 + +/** + * RIL_REQUEST_CDMA_SUBSCRIPTION + * + * Request the device MDN / H_SID / H_NID. + * + * The request is only allowed when CDMA subscription is available. When CDMA + * subscription is changed, application layer should re-issue the request to + * update the subscription information. + * + * If a NULL value is returned for any of the device id, it means that error + * accessing the device. + * + * "response" is const char ** + * ((const char **)response)[0] is MDN if CDMA subscription is available + * ((const char **)response)[1] is a comma separated list of H_SID (Home SID) if + * CDMA subscription is available, in decimal format + * ((const char **)response)[2] is a comma separated list of H_NID (Home NID) if + * CDMA subscription is available, in decimal format + * ((const char **)response)[3] is MIN (10 digits, MIN2+MIN1) if CDMA subscription is available + * ((const char **)response)[4] is PRL version if CDMA subscription is available + * + * Valid errors: + * SUCCESS + * RIL_E_SUBSCRIPTION_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * + */ + +#define RIL_REQUEST_CDMA_SUBSCRIPTION 95 + +/** + * RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM + * + * Stores a CDMA SMS message to RUIM memory. + * + * "data" is RIL_CDMA_SMS_WriteArgs * + * + * "response" is int * + * ((const int *)response)[0] is the record index where the message is stored. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SIM_FULL + * INVALID_ARGUMENTS + * INVALID_SMS_FORMAT + * INTERNAL_ERR + * MODEM_ERR + * ENCODING_ERR + * NO_MEMORY + * NO_RESOURCES + * INVALID_MODEM_STATE + * OPERATION_NOT_ALLOWED + * INVALID_SMSC_ADDRESS + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM 96 + +/** + * RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM + * + * Deletes a CDMA SMS message from RUIM memory. + * + * "data" is int * + * ((int *)data)[0] is the record index of the message to delete. + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * MODEM_ERR + * NO_SUCH_ENTRY + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM 97 + +/** + * RIL_REQUEST_DEVICE_IDENTITY + * + * Request the device ESN / MEID / IMEI / IMEISV. + * + * The request is always allowed and contains GSM and CDMA device identity; + * it substitutes the deprecated requests RIL_REQUEST_GET_IMEI and + * RIL_REQUEST_GET_IMEISV. + * + * If a NULL value is returned for any of the device id, it means that error + * accessing the device. + * + * When CDMA subscription is changed the ESN/MEID may change. The application + * layer should re-issue the request to update the device identity in this case. + * + * "response" is const char ** + * ((const char **)response)[0] is IMEI if GSM subscription is available + * ((const char **)response)[1] is IMEISV if GSM subscription is available + * ((const char **)response)[2] is ESN if CDMA subscription is available + * ((const char **)response)[3] is MEID if CDMA subscription is available + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_DEVICE_IDENTITY 98 + +/** + * RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE + * + * Request the radio's system selection module to exit emergency + * callback mode. RIL will not respond with SUCCESS until the modem has + * completely exited from Emergency Callback Mode. + * + * "data" is NULL + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE 99 + +/** + * RIL_REQUEST_GET_SMSC_ADDRESS + * + * Queries the default Short Message Service Center address on the device. + * + * "data" is NULL + * + * "response" is const char * containing the SMSC address. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * REQUEST_RATE_LIMITED + * SYSTEM_ERR + * INTERNAL_ERR + * MODEM_ERR + * INVALID_ARGUMENTS + * INVALID_MODEM_STATE + * NOT_PROVISIONED + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * + */ +#define RIL_REQUEST_GET_SMSC_ADDRESS 100 + +/** + * RIL_REQUEST_SET_SMSC_ADDRESS + * + * Sets the default Short Message Service Center address on the device. + * + * "data" is const char * containing the SMSC address. + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * INVALID_SMS_FORMAT + * NO_MEMORY + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * NO_RESOURCES + * INTERNAL_ERR + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_SET_SMSC_ADDRESS 101 + +/** + * RIL_REQUEST_REPORT_SMS_MEMORY_STATUS + * + * Indicates whether there is storage available for new SMS messages. + * + * "data" is int * + * ((int *)data)[0] is 1 if memory is available for storing new messages + * is 0 if memory capacity is exceeded + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INVALID_ARGUMENTS + * NO_MEMORY + * INVALID_STATE + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_REPORT_SMS_MEMORY_STATUS 102 + +/** + * RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING + * + * Indicates that the StkSerivce is running and is + * ready to receive RIL_UNSOL_STK_XXXXX commands. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING 103 + +/** + * RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE + * + * Request to query the location where the CDMA subscription shall + * be retrieved + * + * "data" is NULL + * + * "response" is int * + * ((int *)data)[0] is == RIL_CdmaSubscriptionSource + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SUBSCRIPTION_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + * See also: RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE + */ +#define RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE 104 + +/** + * RIL_REQUEST_ISIM_AUTHENTICATION + * + * Request the ISIM application on the UICC to perform AKA + * challenge/response algorithm for IMS authentication + * + * "data" is a const char * containing the challenge string in Base64 format + * "response" is a const char * containing the response in Base64 format + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_ISIM_AUTHENTICATION 105 + +/** + * RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU + * + * Acknowledge successful or failed receipt of SMS previously indicated + * via RIL_UNSOL_RESPONSE_NEW_SMS, including acknowledgement TPDU to send + * as the RP-User-Data element of the RP-ACK or RP-ERROR PDU. + * + * "data" is const char ** + * ((const char **)data)[0] is "1" on successful receipt (send RP-ACK) + * is "0" on failed receipt (send RP-ERROR) + * ((const char **)data)[1] is the acknowledgement TPDU in hexadecimal format + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU 106 + +/** + * RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS + * + * Requests to send a SAT/USAT envelope command to SIM. + * The SAT/USAT envelope command refers to 3GPP TS 11.14 and 3GPP TS 31.111. + * + * This request has one difference from RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND: + * the SW1 and SW2 status bytes from the UICC response are returned along with + * the response data, using the same structure as RIL_REQUEST_SIM_IO. + * + * The RIL implementation shall perform the normal processing of a '91XX' + * response in SW1/SW2 to retrieve the pending proactive command and send it + * as an unsolicited response, as RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND does. + * + * "data" is a const char * containing the SAT/USAT command + * in hexadecimal format starting with command tag + * + * "response" is a const RIL_SIM_IO_Response * + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE (radio resetting) + * SIM_BUSY + * OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS 107 + +/** + * RIL_REQUEST_VOICE_RADIO_TECH + * + * Query the radio technology type (3GPP/3GPP2) used for voice. Query is valid only + * when radio state is not RADIO_STATE_UNAVAILABLE + * + * "data" is NULL + * "response" is int * + * ((int *) response)[0] is of type const RIL_RadioTechnology + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_VOICE_RADIO_TECH 108 + +/** + * RIL_REQUEST_GET_CELL_INFO_LIST + * + * Request all of the current cell information known to the radio. The radio + * must a list of all current cells, including the neighboring cells. If for a particular + * cell information isn't known then the appropriate unknown value will be returned. + * This does not cause or change the rate of RIL_UNSOL_CELL_INFO_LIST. + * + * "data" is NULL + * + * "response" is an array of RIL_CellInfo_v12. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NO_NETWORK_FOUND + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_GET_CELL_INFO_LIST 109 + +/** + * RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE + * + * Sets the minimum time between when RIL_UNSOL_CELL_INFO_LIST should be invoked. + * A value of 0, means invoke RIL_UNSOL_CELL_INFO_LIST when any of the reported + * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue + * a RIL_UNSOL_CELL_INFO_LIST. + * + * "data" is int * + * ((int *)data)[0] is minimum time in milliseconds + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE 110 + +/** + * RIL_REQUEST_SET_INITIAL_ATTACH_APN + * + * Set an apn to initial attach network + * + * "data" is a const char ** + * ((const char **)data)[0] is the APN to connect if radio technology is LTE + * ((const char **)data)[1] is the connection type to request must be one of the + * PDP_type values in TS 27.007 section 10.1.1. + * For example, "IP", "IPV6", "IPV4V6", or "PPP". + * ((const char **)data)[2] is the PAP / CHAP auth type. Values: + * 0 => PAP and CHAP is never performed. + * 1 => PAP may be performed; CHAP is never performed. + * 2 => CHAP may be performed; PAP is never performed. + * 3 => PAP / CHAP may be performed - baseband dependent. + * ((const char **)data)[3] is the username for APN, or NULL + * ((const char **)data)[4] is the password for APN, or NULL + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * SUBSCRIPTION_NOT_AVAILABLE + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_SET_INITIAL_ATTACH_APN 111 + +/** + * RIL_REQUEST_IMS_REGISTRATION_STATE + * + * This message is DEPRECATED and shall be removed in a future release (target: 2018); + * instead, provide IMS registration status via an IMS Service. + * + * Request current IMS registration state + * + * "data" is NULL + * + * "response" is int * + * ((int *)response)[0] is registration state: + * 0 - Not registered + * 1 - Registered + * + * If ((int*)response)[0] is = 1, then ((int *) response)[1] + * must follow with IMS SMS format: + * + * ((int *) response)[1] is of type RIL_RadioTechnologyFamily + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_IMS_REGISTRATION_STATE 112 + +/** + * RIL_REQUEST_IMS_SEND_SMS + * + * Send a SMS message over IMS + * + * "data" is const RIL_IMS_SMS_Message * + * + * "response" is a const RIL_SMS_Response * + * + * Based on the return error, caller decides to resend if sending sms + * fails. SMS_SEND_FAIL_RETRY means retry, and other errors means no retry. + * In case of retry, data is encoded based on Voice Technology available. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * SMS_SEND_FAIL_RETRY + * FDN_CHECK_FAILURE + * NETWORK_REJECT + * INVALID_ARGUMENTS + * INVALID_STATE + * NO_MEMORY + * INVALID_SMS_FORMAT + * SYSTEM_ERR + * REQUEST_RATE_LIMITED + * MODEM_ERR + * NETWORK_ERR + * ENCODING_ERR + * INVALID_SMSC_ADDRESS + * OPERATION_NOT_ALLOWED + * INTERNAL_ERR + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_IMS_SEND_SMS 113 + +/** + * RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC + * + * Request APDU exchange on the basic channel. This command reflects TS 27.007 + * "generic SIM access" operation (+CSIM). The modem must ensure proper function + * of GSM/CDMA, and filter commands appropriately. It should filter + * channel management and SELECT by DF name commands. + * + * "data" is a const RIL_SIM_APDU * + * "sessionid" field should be ignored. + * + * "response" is a const RIL_SIM_IO_Response * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC 114 + +/** + * RIL_REQUEST_SIM_OPEN_CHANNEL + * + * Open a new logical channel and select the given application. This command + * reflects TS 27.007 "open logical channel" operation (+CCHO). This request + * also specifies the P2 parameter (described in ISO 7816-4). + * + * "data" is a const RIL_OpenChannelParam * + * + * "response" is int * + * ((int *)data)[0] contains the session id of the logical channel. + * ((int *)data)[1] onwards may optionally contain the select response for the + * open channel command with one byte per integer. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * MISSING_RESOURCE + * NO_SUCH_ELEMENT + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * SIM_ERR + * INVALID_SIM_STATE + * MISSING_RESOURCE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_OPEN_CHANNEL 115 + +/** + * RIL_REQUEST_SIM_CLOSE_CHANNEL + * + * Close a previously opened logical channel. This command reflects TS 27.007 + * "close logical channel" operation (+CCHC). + * + * "data" is int * + * ((int *)data)[0] is the session id of logical the channel to close. + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_CLOSE_CHANNEL 116 + +/** + * RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL + * + * Exchange APDUs with a UICC over a previously opened logical channel. This + * command reflects TS 27.007 "generic logical channel access" operation + * (+CGLA). The modem should filter channel management and SELECT by DF name + * commands. + * + * "data" is a const RIL_SIM_APDU* + * + * "response" is a const RIL_SIM_IO_Response * + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL 117 + +/** + * RIL_REQUEST_NV_READ_ITEM + * + * Read one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h. + * This is used for device configuration by some CDMA operators. + * + * "data" is a const RIL_NV_ReadItem * + * + * "response" is const char * containing the contents of the NV item + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_NV_READ_ITEM 118 + +/** + * RIL_REQUEST_NV_WRITE_ITEM + * + * Write one of the radio NV items defined in RadioNVItems.java / ril_nv_items.h. + * This is used for device configuration by some CDMA operators. + * + * "data" is a const RIL_NV_WriteItem * + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_NV_WRITE_ITEM 119 + +/** + * RIL_REQUEST_NV_WRITE_CDMA_PRL + * + * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage. + * This is used for device configuration by some CDMA operators. + * + * "data" is a const char * containing the PRL as a byte array + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_NV_WRITE_CDMA_PRL 120 + +/** + * RIL_REQUEST_NV_RESET_CONFIG + * + * Reset the radio NV configuration to the factory state. + * This is used for device configuration by some CDMA operators. + * + * "data" is int * + * ((int *)data)[0] is 1 to reload all NV items + * ((int *)data)[0] is 2 for erase NV reset (SCRTN) + * ((int *)data)[0] is 3 for factory reset (RTN) + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_NV_RESET_CONFIG 121 + + /** RIL_REQUEST_SET_UICC_SUBSCRIPTION + * FIXME This API needs to have more documentation. + * + * Selection/de-selection of a subscription from a SIM card + * "data" is const RIL_SelectUiccSub* + + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * SUBSCRIPTION_NOT_SUPPORTED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_SET_UICC_SUBSCRIPTION 122 + +/** + * RIL_REQUEST_ALLOW_DATA + * + * Tells the modem whether data calls are allowed or not + * + * "data" is int * + * FIXME slotId and aid will be added. + * ((int *)data)[0] is == 0 to allow data calls + * ((int *)data)[0] is == 1 to disallow data calls + * + * "response" is NULL + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * INVALID_ARGUMENTS + * DEVICE_IN_USE + * INVALID_MODEM_STATE + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_ALLOW_DATA 123 + +/** + * RIL_REQUEST_GET_HARDWARE_CONFIG + * + * Request all of the current hardware (modem and sim) associated + * with the RIL. + * + * "data" is NULL + * + * "response" is an array of RIL_HardwareConfig. + * + * Valid errors: + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_GET_HARDWARE_CONFIG 124 + +/** + * RIL_REQUEST_SIM_AUTHENTICATION + * + * Returns the response of SIM Authentication through RIL to a + * challenge request. + * + * "data" Base64 encoded string containing challenge: + * int authContext; P2 value of authentication command, see P2 parameter in + * 3GPP TS 31.102 7.1.2 + * char *authData; the challenge string in Base64 format, see 3GPP + * TS 31.102 7.1.2 + * char *aid; AID value, See ETSI 102.221 8.1 and 101.220 4, + * NULL if no value + * + * "response" Base64 encoded strings containing response: + * int sw1; Status bytes per 3GPP TS 31.102 section 7.3 + * int sw2; + * char *simResponse; Response in Base64 format, see 3GPP TS 31.102 7.1.2 + * + * Valid errors: + * RADIO_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * INVALID_MODEM_STATE + * INVALID_ARGUMENTS + * SIM_ERR + * REQUEST_NOT_SUPPORTED + */ +#define RIL_REQUEST_SIM_AUTHENTICATION 125 + +/** + * RIL_REQUEST_GET_DC_RT_INFO + * + * The request is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO + * Requests the Data Connection Real Time Info + * + * "data" is NULL + * + * "response" is the most recent RIL_DcRtInfo + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * + * See also: RIL_UNSOL_DC_RT_INFO_CHANGED + */ +#define RIL_REQUEST_GET_DC_RT_INFO 126 + +/** + * RIL_REQUEST_SET_DC_RT_INFO_RATE + * + * The request is DEPRECATED + * This is the minimum number of milliseconds between successive + * RIL_UNSOL_DC_RT_INFO_CHANGED messages and defines the highest rate + * at which RIL_UNSOL_DC_RT_INFO_CHANGED's will be sent. A value of + * 0 means send as fast as possible. + * + * "data" The number of milliseconds as an int + * + * "response" is null + * + * Valid errors: + * SUCCESS must not fail + */ +#define RIL_REQUEST_SET_DC_RT_INFO_RATE 127 + +/** + * RIL_REQUEST_SET_DATA_PROFILE + * + * Set data profile in modem + * Modem should erase existed profiles from framework, and apply new profiles + * "data" is a const RIL_DataProfileInfo ** + * "datalen" is count * sizeof(const RIL_DataProfileInfo *) + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * SUBSCRIPTION_NOT_AVAILABLE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_SET_DATA_PROFILE 128 + +/** + * RIL_REQUEST_SHUTDOWN + * + * Device is shutting down. All further commands are ignored + * and RADIO_NOT_AVAILABLE must be returned. + * + * "data" is null + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SHUTDOWN 129 + +/** + * RIL_REQUEST_GET_RADIO_CAPABILITY + * + * Used to get phone radio capablility. + * + * "data" is the RIL_RadioCapability structure + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * INVALID_STATE + * REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_GET_RADIO_CAPABILITY 130 + +/** + * RIL_REQUEST_SET_RADIO_CAPABILITY + * + * Used to set the phones radio capability. Be VERY careful + * using this request as it may cause some vendor modems to reset. Because + * of the possible modem reset any RIL commands after this one may not be + * processed. + * + * "data" is the RIL_RadioCapability structure + * + * "response" is the RIL_RadioCapability structure, used to feedback return status + * + * Valid errors: + * SUCCESS means a RIL_UNSOL_RADIO_CAPABILITY will be sent within 30 seconds. + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * MODEM_ERR + * INVALID_STATE + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_RADIO_CAPABILITY 131 + +/** + * RIL_REQUEST_START_LCE + * + * Start Link Capacity Estimate (LCE) service if supported by the radio. + * + * "data" is const int * + * ((const int*)data)[0] specifies the desired reporting interval (ms). + * ((const int*)data)[1] specifies the LCE service mode. 1: PULL; 0: PUSH. + * + * "response" is the RIL_LceStatusInfo. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * LCE_NOT_SUPPORTED + * INTERNAL_ERR + * REQUEST_NOT_SUPPORTED + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * SIM_ABSENT + */ +#define RIL_REQUEST_START_LCE 132 + +/** + * RIL_REQUEST_STOP_LCE + * + * Stop Link Capacity Estimate (LCE) service, the STOP operation should be + * idempotent for the radio modem. + * + * "response" is the RIL_LceStatusInfo. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * LCE_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_STOP_LCE 133 + +/** + * RIL_REQUEST_PULL_LCEDATA + * + * Pull LCE service for capacity information. + * + * "response" is the RIL_LceDataInfo. + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * LCE_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + */ +#define RIL_REQUEST_PULL_LCEDATA 134 + +/** + * RIL_REQUEST_GET_ACTIVITY_INFO + * + * Get modem activity information for power consumption estimation. + * + * Request clear-on-read statistics information that is used for + * estimating the per-millisecond power consumption of the cellular + * modem. + * + * "data" is null + * "response" is const RIL_ActivityStatsInfo * + * + * Valid errors: + * + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * MODEM_ERR + * NOT_PROVISIONED + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES CANCELLED + */ +#define RIL_REQUEST_GET_ACTIVITY_INFO 135 + +/** + * RIL_REQUEST_SET_CARRIER_RESTRICTIONS + * + * Set carrier restrictions for this sim slot. Expected modem behavior: + * If never receives this command + * - Must allow all carriers + * Receives this command with data being NULL + * - Must allow all carriers. If a previously allowed SIM is present, modem must not reload + * the SIM. If a previously disallowed SIM is present, reload the SIM and notify Android. + * Receives this command with a list of carriers + * - Only allow specified carriers, persist across power cycles and FDR. If a present SIM + * is in the allowed list, modem must not reload the SIM. If a present SIM is *not* in + * the allowed list, modem must detach from the registered network and only keep emergency + * service, and notify Android SIM refresh reset with new SIM state being + * RIL_CARDSTATE_RESTRICTED. Emergency service must be enabled. + * + * "data" is const RIL_CarrierRestrictions * + * A list of allowed carriers and possibly a list of excluded carriers. + * If data is NULL, means to clear previous carrier restrictions and allow all carriers + * + * "response" is int * + * ((int *)data)[0] contains the number of allowed carriers which have been set correctly. + * On success, it should match the length of list data->allowed_carriers. + * If data is NULL, the value must be 0. + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_INVALID_ARGUMENTS + * RIL_E_RADIO_NOT_AVAILABLE + * RIL_E_REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_CARRIER_RESTRICTIONS 136 + +/** + * RIL_REQUEST_GET_CARRIER_RESTRICTIONS + * + * Get carrier restrictions for this sim slot. Expected modem behavior: + * Return list of allowed carriers, or null if all carriers are allowed. + * + * "data" is NULL + * + * "response" is const RIL_CarrierRestrictions *. + * If response is NULL, it means all carriers are allowed. + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE + * RIL_E_REQUEST_NOT_SUPPORTED + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_GET_CARRIER_RESTRICTIONS 137 + +/** + * RIL_REQUEST_SEND_DEVICE_STATE + * + * Send the updated device state. + * Modem can perform power saving based on the provided device state. + * "data" is const int * + * ((const int*)data)[0] A RIL_DeviceStateType that specifies the device state type. + * ((const int*)data)[1] Specifies the state. See RIL_DeviceStateType for the definition of each + * type. + * + * "datalen" is count * sizeof(const RIL_DeviceState *) + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * INVALID_ARGUMENTS + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SEND_DEVICE_STATE 138 + +/** + * RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER + * + * Set the unsolicited response filter + * This is used to prevent unnecessary application processor + * wake up for power saving purposes by suppressing the + * unsolicited responses in certain scenarios. + * + * "data" is an int * + * + * ((int *)data)[0] is a 32-bit bitmask of RIL_UnsolicitedResponseFilter + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * INVALID_ARGUMENTS (e.g. the requested filter doesn't exist) + * RADIO_NOT_AVAILABLE (radio resetting) + * NO_MEMORY + * INTERNAL_ERR + * SYSTEM_ERR + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER 139 + + /** + * RIL_REQUEST_SET_SIM_CARD_POWER + * + * Set SIM card power up or down + * + * Request is equivalent to inserting and removing the card, with + * an additional effect where the ability to detect card removal/insertion + * is disabled when the SIM card is powered down. + * + * This will generate RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED + * as if the SIM had been inserted or removed. + * + * "data" is int * + * ((int *)data)[0] is 1 for "SIM POWER UP" + * ((int *)data)[0] is 0 for "SIM POWER DOWN" + * + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * REQUEST_NOT_SUPPORTED + * SIM_ABSENT + * INVALID_ARGUMENTS + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_SIM_CARD_POWER 140 + +/** + * RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION + * + * Provide Carrier specific information to the modem that will be used to + * encrypt the IMSI and IMPI. Sent by the framework during boot, carrier + * switch and everytime we receive a new certificate. + * + * "data" is the RIL_CarrierInfoForImsiEncryption * structure. + * + * "response" is NULL + * + * Valid errors: + * RIL_E_SUCCESS + * RIL_E_RADIO_NOT_AVAILABLE + * SIM_ABSENT + * RIL_E_REQUEST_NOT_SUPPORTED + * INVALID_ARGUMENTS + * MODEM_INTERNAL_FAILURE + * INTERNAL_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + */ +#define RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION 141 + +/** + * RIL_REQUEST_START_NETWORK_SCAN + * + * Starts a new network scan + * + * Request to start a network scan with specified radio access networks with frequency bands and/or + * channels. + * + * "data" is a const RIL_NetworkScanRequest *. + * "response" is NULL + * + * Valid errors: + * SUCCESS + * RADIO_NOT_AVAILABLE + * OPERATION_NOT_ALLOWED + * DEVICE_IN_USE + * INTERNAL_ERR + * NO_MEMORY + * MODEM_ERR + * INVALID_ARGUMENTS + * REQUEST_NOT_SUPPORTED + * NO_RESOURCES + * CANCELLED + * + */ +#define RIL_REQUEST_START_NETWORK_SCAN 142 + +/** + * RIL_REQUEST_STOP_NETWORK_SCAN + * + * Stops an ongoing network scan + * + * Request to stop the ongoing network scan. Since the modem can only perform one scan at a time, + * there is no parameter for this request. + * + * "data" is NULL + * "response" is NULL + * + * Valid errors: + * SUCCESS + * INTERNAL_ERR + * MODEM_ERR + * NO_MEMORY + * NO_RESOURCES + * CANCELLED + * REQUEST_NOT_SUPPORTED + * + */ +#define RIL_REQUEST_STOP_NETWORK_SCAN 143 + +/** + * RIL_REQUEST_START_KEEPALIVE + * + * Start a keepalive session + * + * Request that the modem begin sending keepalive packets on a particular + * data call, with a specified source, destination, and format. + * + * "data" is a const RIL_RequestKeepalive + * "response" is RIL_KeepaliveStatus with a valid "handle" + * + * Valid errors: + * SUCCESS + * NO_RESOURCES + * INVALID_ARGUMENTS + * + */ +#define RIL_REQUEST_START_KEEPALIVE 144 + +/** + * RIL_REQUEST_STOP_KEEPALIVE + * + * Stops an ongoing keepalive session + * + * Requests that a keepalive session with the given handle be stopped. + * there is no parameter for this request. + * + * "data" is an integer handle + * "response" is NULL + * + * Valid errors: + * SUCCESS + * INVALID_ARGUMENTS + * + */ +#define RIL_REQUEST_STOP_KEEPALIVE 145 + +/***********************************************************************/ + +/** + * RIL_RESPONSE_ACKNOWLEDGEMENT + * + * This is used by Asynchronous solicited messages and Unsolicited messages + * to acknowledge the receipt of those messages in RIL.java so that the ack + * can be used to let ril.cpp to release wakelock. + * + * Valid errors + * SUCCESS + * RADIO_NOT_AVAILABLE + */ + +#define RIL_RESPONSE_ACKNOWLEDGEMENT 800 + +/***********************************************************************/ + + +#define RIL_UNSOL_RESPONSE_BASE 1000 + +/** + * RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED + * + * Indicate when value of RIL_RadioState has changed. + * + * Callee will invoke RIL_RadioStateRequest method on main thread + * + * "data" is NULL + */ + +#define RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED 1000 + + +/** + * RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED + * + * Indicate when call state has changed + * + * Callee will invoke RIL_REQUEST_GET_CURRENT_CALLS on main thread + * + * "data" is NULL + * + * Response should be invoked on, for example, + * "RING", "BUSY", "NO CARRIER", and also call state + * transitions (DIALING->ALERTING ALERTING->ACTIVE) + * + * Redundent or extraneous invocations are tolerated + */ +#define RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED 1001 + + +/** + * RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED + * + * Called when the voice network state changed + * + * Callee will invoke the following requests on main thread: + * + * RIL_REQUEST_VOICE_REGISTRATION_STATE + * RIL_REQUEST_OPERATOR + * + * "data" is NULL + * + * FIXME should this happen when SIM records are loaded? (eg, for + * EONS) + */ +#define RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED 1002 + +/** + * RIL_UNSOL_RESPONSE_NEW_SMS + * + * Called when new SMS is received. + * + * "data" is const char * + * This is a pointer to a string containing the PDU of an SMS-DELIVER + * as an ascii string of hex digits. The PDU starts with the SMSC address + * per TS 27.005 (+CMT:) + * + * Callee will subsequently confirm the receipt of thei SMS with a + * RIL_REQUEST_SMS_ACKNOWLEDGE + * + * No new RIL_UNSOL_RESPONSE_NEW_SMS + * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a + * RIL_REQUEST_SMS_ACKNOWLEDGE has been received + */ + +#define RIL_UNSOL_RESPONSE_NEW_SMS 1003 + +/** + * RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT + * + * Called when new SMS Status Report is received. + * + * "data" is const char * + * This is a pointer to a string containing the PDU of an SMS-STATUS-REPORT + * as an ascii string of hex digits. The PDU starts with the SMSC address + * per TS 27.005 (+CDS:). + * + * Callee will subsequently confirm the receipt of the SMS with a + * RIL_REQUEST_SMS_ACKNOWLEDGE + * + * No new RIL_UNSOL_RESPONSE_NEW_SMS + * or RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT messages should be sent until a + * RIL_REQUEST_SMS_ACKNOWLEDGE has been received + */ + +#define RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT 1004 + +/** + * RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM + * + * Called when new SMS has been stored on SIM card + * + * "data" is const int * + * ((const int *)data)[0] contains the slot index on the SIM that contains + * the new message + */ + +#define RIL_UNSOL_RESPONSE_NEW_SMS_ON_SIM 1005 + +/** + * RIL_UNSOL_ON_USSD + * + * Called when a new USSD message is received. + * + * "data" is const char ** + * ((const char **)data)[0] points to a type code, which is + * one of these string values: + * "0" USSD-Notify -- text in ((const char **)data)[1] + * "1" USSD-Request -- text in ((const char **)data)[1] + * "2" Session terminated by network + * "3" other local client (eg, SIM Toolkit) has responded + * "4" Operation not supported + * "5" Network timeout + * + * The USSD session is assumed to persist if the type code is "1", otherwise + * the current session (if any) is assumed to have terminated. + * + * ((const char **)data)[1] points to a message string if applicable, which + * should always be in UTF-8. + */ +#define RIL_UNSOL_ON_USSD 1006 +/* Previously #define RIL_UNSOL_ON_USSD_NOTIFY 1006 */ + +/** + * RIL_UNSOL_ON_USSD_REQUEST + * + * Obsolete. Send via RIL_UNSOL_ON_USSD + */ +#define RIL_UNSOL_ON_USSD_REQUEST 1007 + +/** + * RIL_UNSOL_NITZ_TIME_RECEIVED + * + * Called when radio has received a NITZ time message + * + * "data" is const char * pointing to NITZ time string + * in the form "yy/mm/dd,hh:mm:ss(+/-)tz,dt" + */ +#define RIL_UNSOL_NITZ_TIME_RECEIVED 1008 + +/** + * RIL_UNSOL_SIGNAL_STRENGTH + * + * Radio may report signal strength rather han have it polled. + * + * "data" is a const RIL_SignalStrength * + */ +#define RIL_UNSOL_SIGNAL_STRENGTH 1009 + + +/** + * RIL_UNSOL_DATA_CALL_LIST_CHANGED + * + * "data" is an array of RIL_Data_Call_Response_v6 identical to that + * returned by RIL_REQUEST_DATA_CALL_LIST. It is the complete list + * of current data contexts including new contexts that have been + * activated. A data call is only removed from this list when the + * framework sends a RIL_REQUEST_DEACTIVATE_DATA_CALL or the radio + * is powered off/on. + * + * See also: RIL_REQUEST_DATA_CALL_LIST + */ + +#define RIL_UNSOL_DATA_CALL_LIST_CHANGED 1010 + +/** + * RIL_UNSOL_SUPP_SVC_NOTIFICATION + * + * Reports supplementary service related notification from the network. + * + * "data" is a const RIL_SuppSvcNotification * + * + */ + +#define RIL_UNSOL_SUPP_SVC_NOTIFICATION 1011 + +/** + * RIL_UNSOL_STK_SESSION_END + * + * Indicate when STK session is terminated by SIM. + * + * "data" is NULL + */ +#define RIL_UNSOL_STK_SESSION_END 1012 + +/** + * RIL_UNSOL_STK_PROACTIVE_COMMAND + * + * Indicate when SIM issue a STK proactive command to applications + * + * "data" is a const char * containing SAT/USAT proactive command + * in hexadecimal format string starting with command tag + * + */ +#define RIL_UNSOL_STK_PROACTIVE_COMMAND 1013 + +/** + * RIL_UNSOL_STK_EVENT_NOTIFY + * + * Indicate when SIM notifies applcations some event happens. + * Generally, application does not need to have any feedback to + * SIM but shall be able to indicate appropriate messages to users. + * + * "data" is a const char * containing SAT/USAT commands or responses + * sent by ME to SIM or commands handled by ME, in hexadecimal format string + * starting with first byte of response data or command tag + * + */ +#define RIL_UNSOL_STK_EVENT_NOTIFY 1014 + +/** + * RIL_UNSOL_STK_CALL_SETUP + * + * Indicate when SIM wants application to setup a voice call. + * + * "data" is const int * + * ((const int *)data)[0] contains timeout value (in milliseconds) + */ +#define RIL_UNSOL_STK_CALL_SETUP 1015 + +/** + * RIL_UNSOL_SIM_SMS_STORAGE_FULL + * + * Indicates that SMS storage on the SIM is full. Sent when the network + * attempts to deliver a new SMS message. Messages cannot be saved on the + * SIM until space is freed. In particular, incoming Class 2 messages + * cannot be stored. + * + * "data" is null + * + */ +#define RIL_UNSOL_SIM_SMS_STORAGE_FULL 1016 + +/** + * RIL_UNSOL_SIM_REFRESH + * + * Indicates that file(s) on the SIM have been updated, or the SIM + * has been reinitialized. + * + * In the case where RIL is version 6 or older: + * "data" is an int * + * ((int *)data)[0] is a RIL_SimRefreshResult. + * ((int *)data)[1] is the EFID of the updated file if the result is + * SIM_FILE_UPDATE or NULL for any other result. + * + * In the case where RIL is version 7: + * "data" is a RIL_SimRefreshResponse_v7 * + * + * Note: If the SIM state changes as a result of the SIM refresh (eg, + * SIM_READY -> SIM_LOCKED_OR_ABSENT), RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED + * should be sent. + */ +#define RIL_UNSOL_SIM_REFRESH 1017 + +/** + * RIL_UNSOL_CALL_RING + * + * Ring indication for an incoming call (eg, RING or CRING event). + * There must be at least one RIL_UNSOL_CALL_RING at the beginning + * of a call and sending multiple is optional. If the system property + * ro.telephony.call_ring.multiple is false then the upper layers + * will generate the multiple events internally. Otherwise the vendor + * ril must generate multiple RIL_UNSOL_CALL_RING if + * ro.telephony.call_ring.multiple is true or if it is absent. + * + * The rate of these events is controlled by ro.telephony.call_ring.delay + * and has a default value of 3000 (3 seconds) if absent. + * + * "data" is null for GSM + * "data" is const RIL_CDMA_SignalInfoRecord * if CDMA + */ +#define RIL_UNSOL_CALL_RING 1018 + +/** + * RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED + * + * Indicates that SIM state changes. + * + * Callee will invoke RIL_REQUEST_GET_SIM_STATUS on main thread + + * "data" is null + */ +#define RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED 1019 + +/** + * RIL_UNSOL_RESPONSE_CDMA_NEW_SMS + * + * Called when new CDMA SMS is received + * + * "data" is const RIL_CDMA_SMS_Message * + * + * Callee will subsequently confirm the receipt of the SMS with + * a RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE + * + * No new RIL_UNSOL_RESPONSE_CDMA_NEW_SMS should be sent until + * RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE has been received + * + */ +#define RIL_UNSOL_RESPONSE_CDMA_NEW_SMS 1020 + +/** + * RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS + * + * Called when new Broadcast SMS is received + * + * "data" can be one of the following: + * If received from GSM network, "data" is const char of 88 bytes + * which indicates each page of a CBS Message sent to the MS by the + * BTS as coded in 3GPP 23.041 Section 9.4.1.2. + * If received from UMTS network, "data" is const char of 90 up to 1252 + * bytes which contain between 1 and 15 CBS Message pages sent as one + * packet to the MS by the BTS as coded in 3GPP 23.041 Section 9.4.2.2. + * + */ +#define RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS 1021 + +/** + * RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL + * + * Indicates that SMS storage on the RUIM is full. Messages + * cannot be saved on the RUIM until space is freed. + * + * "data" is null + * + */ +#define RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL 1022 + +/** + * RIL_UNSOL_RESTRICTED_STATE_CHANGED + * + * Indicates a restricted state change (eg, for Domain Specific Access Control). + * + * Radio need send this msg after radio off/on cycle no matter it is changed or not. + * + * "data" is an int * + * ((int *)data)[0] contains a bitmask of RIL_RESTRICTED_STATE_* values. + */ +#define RIL_UNSOL_RESTRICTED_STATE_CHANGED 1023 + +/** + * RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE + * + * Indicates that the radio system selection module has + * autonomously entered emergency callback mode. + * + * "data" is null + * + */ +#define RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE 1024 + +/** + * RIL_UNSOL_CDMA_CALL_WAITING + * + * Called when CDMA radio receives a call waiting indication. + * + * "data" is const RIL_CDMA_CallWaiting * + * + */ +#define RIL_UNSOL_CDMA_CALL_WAITING 1025 + +/** + * RIL_UNSOL_CDMA_OTA_PROVISION_STATUS + * + * Called when CDMA radio receives an update of the progress of an + * OTASP/OTAPA call. + * + * "data" is const int * + * For CDMA this is an integer OTASP/OTAPA status listed in + * RIL_CDMA_OTA_ProvisionStatus. + * + */ +#define RIL_UNSOL_CDMA_OTA_PROVISION_STATUS 1026 + +/** + * RIL_UNSOL_CDMA_INFO_REC + * + * Called when CDMA radio receives one or more info recs. + * + * "data" is const RIL_CDMA_InformationRecords * + * + */ +#define RIL_UNSOL_CDMA_INFO_REC 1027 + +/** + * RIL_UNSOL_OEM_HOOK_RAW + * + * This is for OEM specific use. + * + * "data" is a byte[] + */ +#define RIL_UNSOL_OEM_HOOK_RAW 1028 + +/** + * RIL_UNSOL_RINGBACK_TONE + * + * Indicates that nework doesn't have in-band information, need to + * play out-band tone. + * + * "data" is an int * + * ((int *)data)[0] == 0 for stop play ringback tone. + * ((int *)data)[0] == 1 for start play ringback tone. + */ +#define RIL_UNSOL_RINGBACK_TONE 1029 + +/** + * RIL_UNSOL_RESEND_INCALL_MUTE + * + * Indicates that framework/application need reset the uplink mute state. + * + * There may be situations where the mute state becomes out of sync + * between the application and device in some GSM infrastructures. + * + * "data" is null + */ +#define RIL_UNSOL_RESEND_INCALL_MUTE 1030 + +/** + * RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED + * + * Called when CDMA subscription source changed. + * + * "data" is int * + * ((int *)data)[0] is == RIL_CdmaSubscriptionSource + */ +#define RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED 1031 + +/** + * RIL_UNSOL_CDMA_PRL_CHANGED + * + * Called when PRL (preferred roaming list) changes. + * + * "data" is int * + * ((int *)data)[0] is PRL_VERSION as would be returned by RIL_REQUEST_CDMA_SUBSCRIPTION + */ +#define RIL_UNSOL_CDMA_PRL_CHANGED 1032 + +/** + * RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE + * + * Called when Emergency Callback Mode Ends + * + * Indicates that the radio system selection module has + * proactively exited emergency callback mode. + * + * "data" is NULL + * + */ +#define RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE 1033 + +/** + * RIL_UNSOL_RIL_CONNECTED + * + * Called the ril connects and returns the version + * + * "data" is int * + * ((int *)data)[0] is RIL_VERSION + */ +#define RIL_UNSOL_RIL_CONNECTED 1034 + +/** + * RIL_UNSOL_VOICE_RADIO_TECH_CHANGED + * + * Indicates that voice technology has changed. Contains new radio technology + * as a data in the message. + * + * "data" is int * + * ((int *)data)[0] is of type const RIL_RadioTechnology + * + */ +#define RIL_UNSOL_VOICE_RADIO_TECH_CHANGED 1035 + +/** + * RIL_UNSOL_CELL_INFO_LIST + * + * Same information as returned by RIL_REQUEST_GET_CELL_INFO_LIST, but returned + * at the rate no greater than specified by RIL_REQUEST_SET_UNSOL_CELL_INFO_RATE. + * + * "data" is NULL + * + * "response" is an array of RIL_CellInfo_v12. + */ +#define RIL_UNSOL_CELL_INFO_LIST 1036 + +/** + * RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED + * + * This message is DEPRECATED and shall be removed in a future release (target: 2018); + * instead, provide IMS registration status via an IMS Service. + * + * Called when IMS registration state has changed + * + * To get IMS registration state and IMS SMS format, callee needs to invoke the + * following request on main thread: + * + * RIL_REQUEST_IMS_REGISTRATION_STATE + * + * "data" is NULL + * + */ +#define RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED 1037 + +/** + * RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED + * + * Indicated when there is a change in subscription status. + * This event will be sent in the following scenarios + * - subscription readiness at modem, which was selected by telephony layer + * - when subscription is deactivated by modem due to UICC card removal + * - When network invalidates the subscription i.e. attach reject due to authentication reject + * + * "data" is const int * + * ((const int *)data)[0] == 0 for Subscription Deactivated + * ((const int *)data)[0] == 1 for Subscription Activated + * + */ +#define RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED 1038 + +/** + * RIL_UNSOL_SRVCC_STATE_NOTIFY + * + * Called when Single Radio Voice Call Continuity(SRVCC) + * progress state has changed + * + * "data" is int * + * ((int *)data)[0] is of type const RIL_SrvccState + * + */ + +#define RIL_UNSOL_SRVCC_STATE_NOTIFY 1039 + +/** + * RIL_UNSOL_HARDWARE_CONFIG_CHANGED + * + * Called when the hardware configuration associated with the RILd changes + * + * "data" is an array of RIL_HardwareConfig + * + */ +#define RIL_UNSOL_HARDWARE_CONFIG_CHANGED 1040 + +/** + * RIL_UNSOL_DC_RT_INFO_CHANGED + * + * The message is DEPRECATED, use RIL_REQUEST_GET_ACTIVITY_INFO + * Sent when the DC_RT_STATE changes but the time + * between these messages must not be less than the + * value set by RIL_REQUEST_SET_DC_RT_RATE. + * + * "data" is the most recent RIL_DcRtInfo + * + */ +#define RIL_UNSOL_DC_RT_INFO_CHANGED 1041 + +/** + * RIL_UNSOL_RADIO_CAPABILITY + * + * Sent when RIL_REQUEST_SET_RADIO_CAPABILITY completes. + * Returns the phone radio capability exactly as + * RIL_REQUEST_GET_RADIO_CAPABILITY and should be the + * same set as sent by RIL_REQUEST_SET_RADIO_CAPABILITY. + * + * "data" is the RIL_RadioCapability structure + */ +#define RIL_UNSOL_RADIO_CAPABILITY 1042 + +/* + * RIL_UNSOL_ON_SS + * + * Called when SS response is received when DIAL/USSD/SS is changed to SS by + * call control. + * + * "data" is const RIL_StkCcUnsolSsResponse * + * + */ +#define RIL_UNSOL_ON_SS 1043 + +/** + * RIL_UNSOL_STK_CC_ALPHA_NOTIFY + * + * Called when there is an ALPHA from UICC during Call Control. + * + * "data" is const char * containing ALPHA string from UICC in UTF-8 format. + * + */ +#define RIL_UNSOL_STK_CC_ALPHA_NOTIFY 1044 + +/** + * RIL_UNSOL_LCEDATA_RECV + * + * Called when there is an incoming Link Capacity Estimate (LCE) info report. + * + * "data" is the RIL_LceDataInfo structure. + * + */ +#define RIL_UNSOL_LCEDATA_RECV 1045 + + /** + * RIL_UNSOL_PCO_DATA + * + * Called when there is new Carrier PCO data received for a data call. Ideally + * only new data will be forwarded, though this is not required. Multiple + * boxes of carrier PCO data for a given call should result in a series of + * RIL_UNSOL_PCO_DATA calls. + * + * "data" is the RIL_PCO_Data structure. + * + */ +#define RIL_UNSOL_PCO_DATA 1046 + + /** + * RIL_UNSOL_MODEM_RESTART + * + * Called when there is a modem reset. + * + * "reason" is "const char *" containing the reason for the reset. It + * could be a crash signature if the restart was due to a crash or some + * string such as "user-initiated restart" or "AT command initiated + * restart" that explains the cause of the modem restart. + * + * When modem restarts, one of the following radio state transitions will happen + * 1) RADIO_STATE_ON->RADIO_STATE_UNAVAILABLE->RADIO_STATE_ON or + * 2) RADIO_STATE_OFF->RADIO_STATE_UNAVAILABLE->RADIO_STATE_OFF + * This message can be sent either just before the RADIO_STATE changes to RADIO_STATE_UNAVAILABLE + * or just after but should never be sent after the RADIO_STATE changes from UNAVAILABLE to + * AVAILABLE(RADIO_STATE_ON/RADIO_STATE_OFF) again. + * + * It should NOT be sent after the RADIO_STATE changes to AVAILABLE after the + * modem restart as that could be interpreted as a second modem reset by the + * framework. + */ +#define RIL_UNSOL_MODEM_RESTART 1047 + +/** + * RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION + * + * Called when the modem needs Carrier specific information that will + * be used to encrypt IMSI and IMPI. + * + * "data" is NULL + * + */ +#define RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION 1048 + +/** + * RIL_UNSOL_NETWORK_SCAN_RESULT + * + * Returns incremental result for the network scan which is started by + * RIL_REQUEST_START_NETWORK_SCAN, sent to report results, status, or errors. + * + * "data" is NULL + * "response" is a const RIL_NetworkScanResult * + */ +#define RIL_UNSOL_NETWORK_SCAN_RESULT 1049 + +/** + * RIL_UNSOL_KEEPALIVE_STATUS + * + * "data" is NULL + * "response" is a const RIL_KeepaliveStatus * + */ +#define RIL_UNSOL_KEEPALIVE_STATUS 1050 + +/***********************************************************************/ + +#define RIL_OEM_REQUEST_BASE 10000 + +/* + * You normally find these constants if you decompile RILConstants.class in + * framework2.odex. + */ +#define RIL_REQUEST_DIAL_EMERGENCY_CALL 10001 +#define RIL_REQUEST_CALL_DEFLECTION 10002 +#define RIL_REQUEST_MODIFY_CALL_INITIATE 10003 +#define RIL_REQUEST_MODIFY_CALL_CONFIRM 10004 +#define RIL_REQUEST_SET_VOICE_DOMAIN_PREF 10005 +#define RIL_REQUEST_SAFE_MODE 10006 +#define RIL_REQUEST_SET_TRANSMIT_POWER 10007 +#define RIL_REQUEST_GET_CELL_BROADCAST_CONFIG 10008 +#define RIL_REQUEST_GET_PHONEBOOK_STORAGE_INFO 10009 +#define RIL_REQUEST_GET_PHONEBOOK_ENTRY 10010 +#define RIL_REQUEST_ACCESS_PHONEBOOK_ENTRY 10011 +#define RIL_REQUEST_USIM_PB_CAPA 10012 +#define RIL_REQUEST_LOCK_INFO 10013 +#define RIL_REQUEST_STK_SIM_INIT_EVENT 10014 +#define RIL_REQUEST_SET_PREFERRED_NETWORK_LIST 10015 +#define RIL_REQUEST_GET_PREFERRED_NETWORK_LIST 10016 +#define RIL_REQUEST_CHANGE_SIM_PERSO 10017 +#define RIL_REQUEST_ENTER_SIM_PERSO 10018 +#define RIL_REQUEST_SEND_ENCODED_USSD 10019 +#define RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE 10020 +#define RIL_REQUEST_HANGUP_VT 10021 +#define RIL_REQUEST_HOLD 10022 +#define RIL_REQUEST_SET_SIM_POWER 10023 +#define RIL_REQUEST_UICC_GBA_AUTHENTICATE_BOOTSTRAP 10025 +#define RIL_REQUEST_UICC_GBA_AUTHENTICATE_NAF 10026 +#define RIL_REQUEST_GET_INCOMING_COMMUNICATION_BARRING 10027 +#define RIL_REQUEST_SET_INCOMING_COMMUNICATION_BARRING 10028 +#define RIL_REQUEST_QUERY_CNAP 10029 +#define RIL_REQUEST_SET_TRANSFER_CALL 10030 + +/***********************************************************************/ + +/********************************************************** + * SAMSUNG RESPONSE + **********************************************************/ + +#define SAMSUNG_UNSOL_RESPONSE_BASE 11000 + +#define RIL_UNSOL_RESPONSE_NEW_CB_MSG 11000 +#define RIL_UNSOL_RELEASE_COMPLETE_MESSAGE 11001 +#define RIL_UNSOL_STK_SEND_SMS_RESULT 11002 +#define RIL_UNSOL_STK_CALL_CONTROL_RESULT 11003 +#define RIL_UNSOL_DEVICE_READY_NOTI 11008 +#define RIL_UNSOL_GPS_NOTI 11009 +#define RIL_UNSOL_AM 11010 +#define RIL_UNSOL_DUN_PIN_CONTROL_SIGNAL 11011 +#define RIL_UNSOL_DATA_SUSPEND_RESUME 11012 +#define RIL_UNSOL_SAP 11013 +#define RIL_UNSOL_UART 11020 +#define RIL_UNSOL_WB_AMR_STATE 11017 +#define RIL_UNSOL_SIM_PB_READY 11021 +#define RIL_UNSOL_VE 11024 +#define RIL_UNSOL_FACTORY_AM 11026 +#define RIL_UNSOL_IMS_REGISTRATION_STATE_CHANGED 11027 +#define RIL_UNSOL_MODIFY_CALL 11028 +#define RIL_UNSOL_CS_FALLBACK 11030 +#define RIL_UNSOL_VOICE_SYSTEM_ID 11032 +#define RIL_UNSOL_IMS_RETRYOVER 11034 +#define RIL_UNSOL_PB_INIT_COMPLETE 11035 +#define RIL_UNSOL_HYSTERESIS_DCN 11037 +#define RIL_UNSOL_CP_POSITION 11038 +#define RIL_UNSOL_HOME_NETWORK_NOTI 11043 +#define RIL_UNSOL_STK_CALL_STATUS 11054 +#define RIL_UNSOL_MODEM_CAP 11056 +#define RIL_UNSOL_SIM_SWAP_STATE_CHANGED 11057 +#define RIL_UNSOL_DUN 11060 +#define RIL_UNSOL_IMS_PREFERENCE_CHANGED 11061 +#define RIL_UNSOL_SIM_APPLICATION_REFRESH 11062 +#define RIL_UNSOL_UICC_APPLICATION_STATUS 11063 +#define RIL_UNSOL_VOICE_RADIO_BEARER_HO_STATUS 11064 +#define RIL_UNSOL_CLM_NOTI 11065 +#define RIL_UNSOL_SIM_ICCID_NOTI 11066 + +/* SNDMGR */ +#define RIL_UNSOL_SNDMGR_WB_AMR_REPORT 20017 +#define RIL_UNSOL_SNDMGR_CLOCK_CTRL 20022 + +/***********************************************************************/ + +#if defined(ANDROID_MULTI_SIM) +/** + * RIL_Request Function pointer + * + * @param request is one of RIL_REQUEST_* + * @param data is pointer to data defined for that RIL_REQUEST_* + * data is owned by caller, and should not be modified or freed by callee + * structures passed as data may contain pointers to non-contiguous memory + * @param t should be used in subsequent call to RIL_onResponse + * @param datalen is the length of "data" which is defined as other argument. It may or may + * not be equal to sizeof(data). Refer to the documentation of individual structures + * to find if pointers listed in the structure are contiguous and counted in the datalen + * length or not. + * (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data)) + * + */ +typedef void (*RIL_RequestFunc) (int request, void *data, + size_t datalen, RIL_Token t, RIL_SOCKET_ID socket_id); + +/** + * This function should return the current radio state synchronously + */ +typedef RIL_RadioState (*RIL_RadioStateRequest)(RIL_SOCKET_ID socket_id); + +#else +/* Backward compatible */ + +/** + * RIL_Request Function pointer + * + * @param request is one of RIL_REQUEST_* + * @param data is pointer to data defined for that RIL_REQUEST_* + * data is owned by caller, and should not be modified or freed by callee + * structures passed as data may contain pointers to non-contiguous memory + * @param t should be used in subsequent call to RIL_onResponse + * @param datalen is the length of "data" which is defined as other argument. It may or may + * not be equal to sizeof(data). Refer to the documentation of individual structures + * to find if pointers listed in the structure are contiguous and counted in the datalen + * length or not. + * (Eg: RIL_IMS_SMS_Message where we don't have datalen equal to sizeof(data)) + * + */ +typedef void (*RIL_RequestFunc) (int request, void *data, + size_t datalen, RIL_Token t); + +/** + * This function should return the current radio state synchronously + */ +typedef RIL_RadioState (*RIL_RadioStateRequest)(); + +#endif + + +/** + * This function returns "1" if the specified RIL_REQUEST code is + * supported and 0 if it is not + * + * @param requestCode is one of RIL_REQUEST codes + */ + +typedef int (*RIL_Supports)(int requestCode); + +/** + * This function is called from a separate thread--not the + * thread that calls RIL_RequestFunc--and indicates that a pending + * request should be cancelled. + * + * On cancel, the callee should do its best to abandon the request and + * call RIL_onRequestComplete with RIL_Errno CANCELLED at some later point. + * + * Subsequent calls to RIL_onRequestComplete for this request with + * other results will be tolerated but ignored. (That is, it is valid + * to ignore the cancellation request) + * + * RIL_Cancel calls should return immediately, and not wait for cancellation + * + * Please see ITU v.250 5.6.1 for how one might implement this on a TS 27.007 + * interface + * + * @param t token wants to be canceled + */ + +typedef void (*RIL_Cancel)(RIL_Token t); + +typedef void (*RIL_TimedCallback) (void *param); + +/** + * Return a version string for your RIL implementation + */ +typedef const char * (*RIL_GetVersion) (void); + +typedef struct { + int version; /* set to RIL_VERSION */ + RIL_RequestFunc onRequest; + RIL_RadioStateRequest onStateRequest; + RIL_Supports supports; + RIL_Cancel onCancel; + RIL_GetVersion getVersion; +} RIL_RadioFunctions; + +typedef struct { + char *apn; /* the APN to connect to */ + char *protocol; /* one of the PDP_type values in TS 27.007 section 10.1.1 used on + roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/ + int authtype; /* authentication protocol used for this PDP context + (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */ + char *username; /* the username for APN, or NULL */ + char *password; /* the password for APN, or NULL */ +} RIL_InitialAttachApn; + +typedef struct { + char *apn; /* the APN to connect to */ + char *protocol; /* one of the PDP_type values in TS 27.007 section 10.1.1 used on + home network. For example, "IP", "IPV6", "IPV4V6", or "PPP". */ + char *roamingProtocol; /* one of the PDP_type values in TS 27.007 section 10.1.1 used on + roaming network. For example, "IP", "IPV6", "IPV4V6", or "PPP".*/ + int authtype; /* authentication protocol used for this PDP context + (None: 0, PAP: 1, CHAP: 2, PAP&CHAP: 3) */ + char *username; /* the username for APN, or NULL */ + char *password; /* the password for APN, or NULL */ + int supportedTypesBitmask; /* supported APN types bitmask. See RIL_ApnTypes for the value of + each bit. */ + int bearerBitmask; /* the bearer bitmask. See RIL_RadioAccessFamily for the value of + each bit. */ + int modemCognitive; /* indicating the APN setting was sent to the modem through + setDataProfile earlier. */ + int mtu; /* maximum transmission unit (MTU) size in bytes */ + char *mvnoType; /* the MVNO type: possible values are "imsi", "gid", "spn" */ + char *mvnoMatchData; /* MVNO match data. Can be anything defined by the carrier. + For example, + SPN like: "A MOBILE", "BEN NL", etc... + IMSI like: "302720x94", "2060188", etc... + GID like: "4E", "33", etc... */ +} RIL_InitialAttachApn_v15; + +typedef struct { + int authContext; /* P2 value of authentication command, see P2 parameter in + 3GPP TS 31.102 7.1.2 */ + char *authData; /* the challenge string in Base64 format, see 3GPP + TS 31.102 7.1.2 */ + char *aid; /* AID value, See ETSI 102.221 8.1 and 101.220 4, + NULL if no value. */ +} RIL_SimAuthentication; + +typedef struct { + int cid; /* Context ID, uniquely identifies this call */ + char *bearer_proto; /* One of the PDP_type values in TS 27.007 section 10.1.1. + For example, "IP", "IPV6", "IPV4V6". */ + int pco_id; /* The protocol ID for this box. Note that only IDs from + FF00H - FFFFH are accepted. If more than one is included + from the network, multiple calls should be made to send all + of them. */ + int contents_length; /* The number of octets in the contents. */ + char *contents; /* Carrier-defined content. It is binary, opaque and + loosely defined in LTE Layer 3 spec 24.008 */ +} RIL_PCO_Data; + +typedef enum { + NATT_IPV4 = 0, /* Keepalive specified by RFC 3948 Sec. 2.3 using IPv4 */ + NATT_IPV6 = 1 /* Keepalive specified by RFC 3948 Sec. 2.3 using IPv6 */ +} RIL_KeepaliveType; + +#define MAX_INADDR_LEN 16 +typedef struct { + RIL_KeepaliveType type; /* Type of keepalive packet */ + char sourceAddress[MAX_INADDR_LEN]; /* Source address in network-byte order */ + int sourcePort; /* Source port if applicable, or 0x7FFFFFFF; + the maximum value is 65535 */ + char destinationAddress[MAX_INADDR_LEN]; /* Destination address in network-byte order */ + int destinationPort; /* Destination port if applicable or 0x7FFFFFFF; + the maximum value is 65535 */ + int maxKeepaliveIntervalMillis; /* Maximum milliseconds between two packets */ + int cid; /* Context ID, uniquely identifies this call */ +} RIL_KeepaliveRequest; + +typedef enum { + KEEPALIVE_ACTIVE, /* Keepalive session is active */ + KEEPALIVE_INACTIVE, /* Keepalive session is inactive */ + KEEPALIVE_PENDING /* Keepalive session status not available */ +} RIL_KeepaliveStatusCode; + +typedef struct { + uint32_t sessionHandle; + RIL_KeepaliveStatusCode code; +} RIL_KeepaliveStatus; + +#ifdef RIL_SHLIB +struct RIL_Env { + /** + * "t" is parameter passed in on previous call to RIL_Notification + * routine. + * + * If "e" != SUCCESS, then response can be null/is ignored + * + * "response" is owned by caller, and should not be modified or + * freed by callee + * + * RIL_onRequestComplete will return as soon as possible + */ + void (*OnRequestComplete)(RIL_Token t, RIL_Errno e, + void *response, size_t responselen); + +#if defined(ANDROID_MULTI_SIM) + /** + * "unsolResponse" is one of RIL_UNSOL_RESPONSE_* + * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_* + * + * "data" is owned by caller, and should not be modified or freed by callee + */ + void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen, RIL_SOCKET_ID socket_id); +#else + /** + * "unsolResponse" is one of RIL_UNSOL_RESPONSE_* + * "data" is pointer to data defined for that RIL_UNSOL_RESPONSE_* + * + * "data" is owned by caller, and should not be modified or freed by callee + */ + void (*OnUnsolicitedResponse)(int unsolResponse, const void *data, size_t datalen); +#endif + /** + * Call user-specifed "callback" function on on the same thread that + * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies + * a relative time value at which the callback is invoked. If relativeTime is + * NULL or points to a 0-filled structure, the callback will be invoked as + * soon as possible + */ + + void (*RequestTimedCallback) (RIL_TimedCallback callback, + void *param, const struct timeval *relativeTime); + /** + * "t" is parameter passed in on previous call RIL_Notification routine + * + * RIL_onRequestAck will be called by vendor when an Async RIL request was received + * by them and an ack needs to be sent back to java ril. + */ + void (*OnRequestAck) (RIL_Token t); +}; + + +/** + * RIL implementations must defined RIL_Init + * argc and argv will be command line arguments intended for the RIL implementation + * Return NULL on error + * + * @param env is environment point defined as RIL_Env + * @param argc number of arguments + * @param argv list fo arguments + * + */ +const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **argv); + +/** + * If BT SAP(SIM Access Profile) is supported, then RIL implementations must define RIL_SAP_Init + * for initializing RIL_RadioFunctions used for BT SAP communcations. It is called whenever RILD + * starts or modem restarts. Returns handlers for SAP related request that are made on SAP + * sepecific socket, analogous to the RIL_RadioFunctions returned by the call to RIL_Init + * and used on the general RIL socket. + * argc and argv will be command line arguments intended for the RIL implementation + * Return NULL on error. + * + * @param env is environment point defined as RIL_Env + * @param argc number of arguments + * @param argv list fo arguments + * + */ +const RIL_RadioFunctions *RIL_SAP_Init(const struct RIL_Env *env, int argc, char **argv); + +#else /* RIL_SHLIB */ + +/** + * Call this once at startup to register notification routine + * + * @param callbacks user-specifed callback function + */ +void RIL_register (const RIL_RadioFunctions *callbacks); + +void rilc_thread_pool(); + + +/** + * + * RIL_onRequestComplete will return as soon as possible + * + * @param t is parameter passed in on previous call to RIL_Notification + * routine. + * @param e error code + * if "e" != SUCCESS, then response can be null/is ignored + * @param response is owned by caller, and should not be modified or + * freed by callee + * @param responselen the length of response in byte + */ +void RIL_onRequestComplete(RIL_Token t, RIL_Errno e, + void *response, size_t responselen); + +/** + * RIL_onRequestAck will be called by vendor when an Async RIL request was received by them and + * an ack needs to be sent back to java ril. This doesn't mark the end of the command or it's + * results, just that the command was received and will take a while. After sending this Ack + * its vendor's responsibility to make sure that AP is up whenever needed while command is + * being processed. + * + * @param t is parameter passed in on previous call to RIL_Notification + * routine. + */ +void RIL_onRequestAck(RIL_Token t); + +#if defined(ANDROID_MULTI_SIM) +/** + * @param unsolResponse is one of RIL_UNSOL_RESPONSE_* + * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_* + * "data" is owned by caller, and should not be modified or freed by callee + * @param datalen the length of data in byte + */ + +void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, + size_t datalen, RIL_SOCKET_ID socket_id); +#else +/** + * @param unsolResponse is one of RIL_UNSOL_RESPONSE_* + * @param data is pointer to data defined for that RIL_UNSOL_RESPONSE_* + * "data" is owned by caller, and should not be modified or freed by callee + * @param datalen the length of data in byte + */ + +void RIL_onUnsolicitedResponse(int unsolResponse, const void *data, + size_t datalen); +#endif + +/** + * Call user-specifed "callback" function on on the same thread that + * RIL_RequestFunc is called. If "relativeTime" is specified, then it specifies + * a relative time value at which the callback is invoked. If relativeTime is + * NULL or points to a 0-filled structure, the callback will be invoked as + * soon as possible + * + * @param callback user-specifed callback function + * @param param parameter list + * @param relativeTime a relative time value at which the callback is invoked + */ + +void RIL_requestTimedCallback (RIL_TimedCallback callback, + void *param, const struct timeval *relativeTime); + +#endif /* RIL_SHLIB */ + +#ifdef __cplusplus +} +#endif + +#endif /*ANDROID_RIL_H*/ diff --git a/include/telephony/ril_cdma_sms.h b/include/telephony/ril_cdma_sms.h new file mode 100644 index 0000000..bcf6b30 --- /dev/null +++ b/include/telephony/ril_cdma_sms.h @@ -0,0 +1,806 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * ISSUES: + * + */ + +/** + * TODO + * + * + */ + + +#ifndef ANDROID_RIL_CDMA_SMS_H +#define ANDROID_RIL_CDMA_SMS_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Used by RIL_REQUEST_CDMA_SEND_SMS and RIL_UNSOL_RESPONSE_CDMA_NEW_SMS */ + +#define RIL_CDMA_SMS_ADDRESS_MAX 36 +#define RIL_CDMA_SMS_SUBADDRESS_MAX 36 +#define RIL_CDMA_SMS_BEARER_DATA_MAX 255 + +typedef enum { + RIL_CDMA_SMS_DIGIT_MODE_4_BIT = 0, /* DTMF digits */ + RIL_CDMA_SMS_DIGIT_MODE_8_BIT = 1, + RIL_CDMA_SMS_DIGIT_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_DigitMode; + +typedef enum { + RIL_CDMA_SMS_NUMBER_MODE_NOT_DATA_NETWORK = 0, + RIL_CDMA_SMS_NUMBER_MODE_DATA_NETWORK = 1, + RIL_CDMA_SMS_NUMBER_MODE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_NumberMode; + +typedef enum { + RIL_CDMA_SMS_NUMBER_TYPE_UNKNOWN = 0, + RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP = 1, + /* INTERNATIONAL is used when number mode is not data network address. + * DATA_IP is used when the number mode is data network address + */ + RIL_CDMA_SMS_NUMBER_TYPE_NATIONAL_OR_INTERNET_MAIL = 2, + /* NATIONAL is used when the number mode is not data network address. + * INTERNET_MAIL is used when the number mode is data network address. + * For INTERNET_MAIL, in the address data "digits", each byte contains + * an ASCII character. Examples are "x@y.com,a@b.com - ref TIA/EIA-637A 3.4.3.3 + */ + RIL_CDMA_SMS_NUMBER_TYPE_NETWORK = 3, + RIL_CDMA_SMS_NUMBER_TYPE_SUBSCRIBER = 4, + RIL_CDMA_SMS_NUMBER_TYPE_ALPHANUMERIC = 5, + /* GSM SMS: address value is GSM 7-bit chars */ + RIL_CDMA_SMS_NUMBER_TYPE_ABBREVIATED = 6, + RIL_CDMA_SMS_NUMBER_TYPE_RESERVED_7 = 7, + RIL_CDMA_SMS_NUMBER_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_NumberType; + +typedef enum { + RIL_CDMA_SMS_NUMBER_PLAN_UNKNOWN = 0, + RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY = 1, /* CCITT E.164 and E.163, including ISDN plan */ + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_2 = 2, + RIL_CDMA_SMS_NUMBER_PLAN_DATA = 3, /* CCITT X.121 */ + RIL_CDMA_SMS_NUMBER_PLAN_TELEX = 4, /* CCITT F.69 */ + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_5 = 5, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_6 = 6, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_7 = 7, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_8 = 8, + RIL_CDMA_SMS_NUMBER_PLAN_PRIVATE = 9, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_10 = 10, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_11 = 11, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_12 = 12, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_13 = 13, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_14 = 14, + RIL_CDMA_SMS_NUMBER_PLAN_RESERVED_15 = 15, + RIL_CDMA_SMS_NUMBER_PLAN_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_NumberPlan; + +typedef struct { + RIL_CDMA_SMS_DigitMode digit_mode; + /* Indicates 4-bit or 8-bit */ + RIL_CDMA_SMS_NumberMode number_mode; + /* Used only when digitMode is 8-bit */ + RIL_CDMA_SMS_NumberType number_type; + /* Used only when digitMode is 8-bit. + * To specify an international address, use the following: + * digitMode = RIL_CDMA_SMS_DIGIT_MODE_8_BIT + * numberMode = RIL_CDMA_SMS_NOT_DATA_NETWORK + * numberType = RIL_CDMA_SMS_NUMBER_TYPE_INTERNATIONAL_OR_DATA_IP + * numberPlan = RIL_CDMA_SMS_NUMBER_PLAN_TELEPHONY + * numberOfDigits = number of digits + * digits = ASCII digits, e.g. '1', '2', '3'3, '4', and '5' + */ + RIL_CDMA_SMS_NumberPlan number_plan; + /* Used only when digitMode is 8-bit */ + unsigned char number_of_digits; + unsigned char digits[ RIL_CDMA_SMS_ADDRESS_MAX ]; + /* Each byte in this array represnts a 40bit or 8-bit digit of address data */ +} RIL_CDMA_SMS_Address; + +typedef enum { + RIL_CDMA_SMS_SUBADDRESS_TYPE_NSAP = 0, /* CCITT X.213 or ISO 8348 AD2 */ + RIL_CDMA_SMS_SUBADDRESS_TYPE_USER_SPECIFIED = 1, /* e.g. X.25 */ + RIL_CDMA_SMS_SUBADDRESS_TYPE_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_SubaddressType; + +typedef struct { + RIL_CDMA_SMS_SubaddressType subaddressType; + /* 1 means the last byte's lower 4 bits should be ignored */ + unsigned char odd; + unsigned char number_of_digits; + /* Each byte respresents a 8-bit digit of subaddress data */ + unsigned char digits[ RIL_CDMA_SMS_SUBADDRESS_MAX ]; +} RIL_CDMA_SMS_Subaddress; + +typedef struct { + int uTeleserviceID; + unsigned char bIsServicePresent; + int uServicecategory; + RIL_CDMA_SMS_Address sAddress; + RIL_CDMA_SMS_Subaddress sSubAddress; + int uBearerDataLen; + unsigned char aBearerData[ RIL_CDMA_SMS_BEARER_DATA_MAX ]; +} RIL_CDMA_SMS_Message; + +/* Used by RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE */ + +typedef enum { + RIL_CDMA_SMS_NO_ERROR = 0, + RIL_CDMA_SMS_ERROR = 1, + RIL_CDMA_SMS_ERROR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_ErrorClass; + +typedef struct { + RIL_CDMA_SMS_ErrorClass uErrorClass; + int uSMSCauseCode; /* As defined in N.S00005, 6.5.2.125. + Currently, only 35 (resource shortage) and + 39 (other terminal problem) are reported. */ +} RIL_CDMA_SMS_Ack; + +/* Used by RIL_REQUEST_CDMA_SMS_GET_BROADCAST_CONFIG and + RIL_REQUEST_CDMA_SMS_SET_BROADCAST_CONFIG */ + +typedef struct { + int service_category; + int language; + unsigned char selected; +} RIL_CDMA_BroadcastSmsConfigInfo; + +/* Used by RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM */ + +typedef struct { + int status; /* Status of message. See TS 27.005 3.1, "": */ + /* 0 = "REC UNREAD" */ + /* 1 = "REC READ" */ + /* 2 = "STO UNSENT" */ + /* 3 = "STO SENT" */ + + RIL_CDMA_SMS_Message message; +} RIL_CDMA_SMS_WriteArgs; + + +/* Used by RIL_REQUEST_ENCODE_CDMA_SMS and RIL_REQUEST_DECODE_CDMA_SMS*/ + +#define RIL_CDMA_SMS_UDH_MAX_SND_SIZE 128 +#define RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX 131 /* 140 - 3 - 6 */ +#define RIL_CDMA_SMS_MAX_UD_HEADERS 7 +#define RIL_CDMA_SMS_USER_DATA_MAX 229 +#define RIL_CDMA_SMS_ADDRESS_MAX 36 +#define RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE 128 +#define RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE 32 +#define RIL_CDMA_SMS_UDH_VAR_PIC_SIZE 134 +#define RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS 4 +#define RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE 32 +#define RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE 8 +#define RIL_CDMA_SMS_UDH_OTHER_SIZE 226 +#define RIL_CDMA_SMS_IP_ADDRESS_SIZE 4 + +/* ------------------- */ +/* ---- User Data ---- */ +/* ------------------- */ +typedef enum { + RIL_CDMA_SMS_UDH_CONCAT_8 = 0x00, + RIL_CDMA_SMS_UDH_SPECIAL_SM, + /* 02 - 03 Reserved */ + RIL_CDMA_SMS_UDH_PORT_8 = 0x04, + RIL_CDMA_SMS_UDH_PORT_16, + RIL_CDMA_SMS_UDH_SMSC_CONTROL, + RIL_CDMA_SMS_UDH_SOURCE, + RIL_CDMA_SMS_UDH_CONCAT_16, + RIL_CDMA_SMS_UDH_WCMP, + RIL_CDMA_SMS_UDH_TEXT_FORMATING, + RIL_CDMA_SMS_UDH_PRE_DEF_SOUND, + RIL_CDMA_SMS_UDH_USER_DEF_SOUND, + RIL_CDMA_SMS_UDH_PRE_DEF_ANIM, + RIL_CDMA_SMS_UDH_LARGE_ANIM, + RIL_CDMA_SMS_UDH_SMALL_ANIM, + RIL_CDMA_SMS_UDH_LARGE_PICTURE, + RIL_CDMA_SMS_UDH_SMALL_PICTURE, + RIL_CDMA_SMS_UDH_VAR_PICTURE, + + RIL_CDMA_SMS_UDH_USER_PROMPT = 0x13, + RIL_CDMA_SMS_UDH_EXTENDED_OBJECT = 0x14, + + /* 15 - 1F Reserved for future EMS */ + + RIL_CDMA_SMS_UDH_RFC822 = 0x20, + + /* 21 - 6F Reserved for future use */ + /* 70 - 7f Reserved for (U)SIM Toolkit Security Headers */ + /* 80 - 9F SME to SME specific use */ + /* A0 - BF Reserved for future use */ + /* C0 - DF SC specific use */ + /* E0 - FF Reserved for future use */ + + RIL_CDMA_SMS_UDH_OTHER = 0xFFFF, /* For unsupported or proprietary headers */ + RIL_CDMA_SMS_UDH_ID_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ + +} RIL_CDMA_SMS_UdhId; + +typedef struct { + /*indicates the reference number for a particular concatenated short message. */ + /*it is constant for every short message which makes up a particular concatenated short message*/ + unsigned char msg_ref; + + /*indicates the total number of short messages within the concatenated short message. + The value shall start at 1 and remain constant for every + short message which makes up the concatenated short message. + if it is 0 then the receiving entity shall ignore the whole Information Element*/ + unsigned char total_sm; + + /* + * it indicates the sequence number of a particular short message within the concatenated short + * message. The value shall start at 1 and increment by one for every short message sent + * within the concatenated short message. If the value is zero or the value is + * greater than the value in octet 2 then the receiving + * entity shall ignore the whole Information Element. + */ + unsigned char seq_num; +} RIL_CDMA_SMS_UdhConcat8; + +/* GW message waiting actions +*/ +typedef enum { + RIL_CDMA_SMS_GW_MSG_WAITING_NONE, + RIL_CDMA_SMS_GW_MSG_WAITING_DISCARD, + RIL_CDMA_SMS_GW_MSG_WAITING_STORE, + RIL_CDMA_SMS_GW_MSG_WAITING_NONE_1111, + RIL_CDMA_SMS_GW_MSG_WAITING_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_GWMsgWaiting; + +/* GW message waiting types +*/ +typedef enum { + RIL_CDMA_SMS_GW_MSG_WAITING_VOICEMAIL, + RIL_CDMA_SMS_GW_MSG_WAITING_FAX, + RIL_CDMA_SMS_GW_MSG_WAITING_EMAIL, + RIL_CDMA_SMS_GW_MSG_WAITING_OTHER, + RIL_CDMA_SMS_GW_MSG_WAITING_KIND_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_GWMsgWaitingKind; + +typedef struct { + RIL_CDMA_SMS_GWMsgWaiting msg_waiting; + RIL_CDMA_SMS_GWMsgWaitingKind msg_waiting_kind; + + /*it indicates the number of messages of the type specified in Octet 1 waiting.*/ + unsigned char message_count; +} RIL_CDMA_SMS_UdhSpecialSM; + +typedef struct { + unsigned char dest_port; + unsigned char orig_port; +} RIL_CDMA_SMS_UdhWap8; + +typedef struct { + unsigned short dest_port; + unsigned short orig_port; +} RIL_CDMA_SMS_UdhWap16; + +typedef struct { + unsigned short msg_ref; + unsigned char total_sm; + unsigned char seq_num; + +} RIL_CDMA_SMS_UdhConcat16; + +typedef enum { + RIL_CDMA_SMS_UDH_LEFT_ALIGNMENT = 0, + RIL_CDMA_SMS_UDH_CENTER_ALIGNMENT, + RIL_CDMA_SMS_UDH_RIGHT_ALIGNMENT, + RIL_CDMA_SMS_UDH_DEFAULT_ALIGNMENT, + RIL_CDMA_SMS_UDH_MAX_ALIGNMENT, + RIL_CDMA_SMS_UDH_ALIGNMENT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_UdhAlignment; + +typedef enum { + RIL_CDMA_SMS_UDH_FONT_NORMAL = 0, + RIL_CDMA_SMS_UDH_FONT_LARGE, + RIL_CDMA_SMS_UDH_FONT_SMALL, + RIL_CDMA_SMS_UDH_FONT_RESERVED, + RIL_CDMA_SMS_UDH_FONT_MAX, + RIL_CDMA_SMS_UDH_FONT_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_UdhFontSize; + +typedef enum { + RIL_CDMA_SMS_UDH_TEXT_COLOR_BLACK = 0x0, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREY = 0x1, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_RED = 0x2, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_YELLOW = 0x3, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_GREEN = 0x4, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_CYAN = 0x5, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_BLUE = 0x6, + RIL_CDMA_SMS_UDH_TEXT_COLOR_DARK_MAGENTA = 0x7, + RIL_CDMA_SMS_UDH_TEXT_COLOR_GREY = 0x8, + RIL_CDMA_SMS_UDH_TEXT_COLOR_WHITE = 0x9, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_RED = 0xA, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_YELLOW = 0xB, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_GREEN = 0xC, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_CYAN = 0xD, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_BLUE = 0xE, + RIL_CDMA_SMS_UDH_TEXT_COLOR_BRIGHT_MAGENTA = 0xF, + RIL_CDMA_SMS_UDH_TEXT_COLOR_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_UdhTextColor; + +typedef struct { + unsigned char start_position; + unsigned char text_formatting_length; + RIL_CDMA_SMS_UdhAlignment alignment_type ; /*bit 0 and bit 1*/ + RIL_CDMA_SMS_UdhFontSize font_size ; /*bit 3 and bit 2*/ + unsigned char style_bold; /*bit 4 */ + unsigned char style_italic; /*bit 5 */ + unsigned char style_underlined; /*bit 6 */ + unsigned char style_strikethrough; /*bit 7 */ + + /* if FALSE, ignore the following color information */ + unsigned char is_color_present; + RIL_CDMA_SMS_UdhTextColor text_color_foreground; + RIL_CDMA_SMS_UdhTextColor text_color_background; + +} RIL_CDMA_SMS_UdhTextFormating; + +/* Predefined sound +*/ +typedef struct { + unsigned char position; + unsigned char snd_number; +} RIL_CDMA_SMS_UdhPreDefSound; + +/* User Defined sound +*/ +typedef struct { + unsigned char data_length; + unsigned char position; + unsigned char user_def_sound[RIL_CDMA_SMS_UDH_MAX_SND_SIZE]; +} RIL_CDMA_SMS_UdhUserDefSound; + +/* Large picture +*/ +typedef struct { + unsigned char position; + unsigned char data[RIL_CDMA_SMS_UDH_LARGE_PIC_SIZE]; +} RIL_CDMA_SMS_UdhLargePictureData; + +/* Small picture +*/ +typedef struct { + unsigned char position; + unsigned char data[RIL_CDMA_SMS_UDH_SMALL_PIC_SIZE]; +} RIL_CDMA_SMS_UdhSmallPictureData; + +/* Variable length picture +*/ +typedef struct { + unsigned char position; + unsigned char width; /* Number of pixels - Should be a mutliple of 8 */ + unsigned char height; + unsigned char data[RIL_CDMA_SMS_UDH_VAR_PIC_SIZE]; +} RIL_CDMA_SMS_UdhVarPicture; + +/* Predefined animation +*/ +typedef struct { + unsigned char position; + unsigned char animation_number; +} RIL_CDMA_SMS_UdhPreDefAnim; + +/* Large animation +*/ +typedef struct { + unsigned char position; + unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_LARGE_BITMAP_SIZE]; +} RIL_CDMA_SMS_UdhLargeAnim; + +/* Small animation +*/ +typedef struct { + unsigned char position; + unsigned char data[RIL_CDMA_SMS_UDH_ANIM_NUM_BITMAPS][RIL_CDMA_SMS_UDH_SMALL_BITMAP_SIZE]; +} RIL_CDMA_SMS_UdhSmallAnim; + +/* User Prompt Indicator UDH +*/ +typedef struct { + unsigned char number_of_objects; + /* Number of objects of the same kind that follow this header which will + ** be stitched together by the applications. For example, 5 small pictures + ** are to be stitched together horizontally, or 6 iMelody tones are to be + ** connected together with intermediate iMelody header and footer ignored. + ** Allowed objects to be stitched: + ** - Images (small, large, variable) + ** - User defined sounds + */ +} RIL_CDMA_SMS_UdhUserPrompt; + +typedef struct { + unsigned char length; + + unsigned char data[RIL_CDMA_SMS_UDH_EO_DATA_SEGMENT_MAX]; + /* RIL_CDMA_SMS_UDH_EO_VCARD: See http://www.imc.org/pdi/vcard-21.doc for payload */ + /* RIL_CDMA_SMS_UDH_EO_VCALENDAR: See http://www.imc.org/pdi/vcal-10.doc */ + /* Or: Unsupported/proprietary extended objects */ + +} RIL_CDMA_SMS_UdhEoContent; + +/* Extended Object UDH +*/ +/* Extended Object IDs/types +*/ +typedef enum { + RIL_CDMA_SMS_UDH_EO_VCARD = 0x09, + RIL_CDMA_SMS_UDH_EO_VCALENDAR = 0x0A, + RIL_CDMA_SMS_UDH_EO_MAX32 = 0x10000000 /* Force constant ENUM size in structures */ +} RIL_CDMA_SMS_UdhEoId; + +typedef struct { + /* Extended objects are to be used together with 16-bit concatenation + ** UDH. The max number of segments supported for E.O. is 8 at least. + */ + RIL_CDMA_SMS_UdhEoContent content; + + unsigned char first_segment; + /* The following fields are only present in the first segment of a + ** concatenated SMS message. + */ + unsigned char reference; + /* Identify those extended object segments which should be linked together + */ + unsigned short length; + /* Length of the whole extended object data + */ + unsigned char control; + RIL_CDMA_SMS_UdhEoId type; + unsigned short position; + /* Absolute position of the E.O. in the whole text after concatenation, + ** starting from 1. + */ +} RIL_CDMA_SMS_UdhEo; + +typedef struct { + RIL_CDMA_SMS_UdhId header_id; + unsigned char header_length; + unsigned char data[RIL_CDMA_SMS_UDH_OTHER_SIZE]; +} RIL_CDMA_SMS_UdhOther; + +typedef struct { + unsigned char header_length; +} RIL_CDMA_SMS_UdhRfc822; + +typedef struct { + RIL_CDMA_SMS_UdhId header_id; + + union { + RIL_CDMA_SMS_UdhConcat8 concat_8; // 00 + + RIL_CDMA_SMS_UdhSpecialSM special_sm; // 01 + RIL_CDMA_SMS_UdhWap8 wap_8; // 04 + RIL_CDMA_SMS_UdhWap16 wap_16; // 05 + RIL_CDMA_SMS_UdhConcat16 concat_16; // 08 + RIL_CDMA_SMS_UdhTextFormating text_formating; // 0a + RIL_CDMA_SMS_UdhPreDefSound pre_def_sound; // 0b + RIL_CDMA_SMS_UdhUserDefSound user_def_sound; // 0c + RIL_CDMA_SMS_UdhPreDefAnim pre_def_anim; // 0d + RIL_CDMA_SMS_UdhLargeAnim large_anim; // 0e + RIL_CDMA_SMS_UdhSmallAnim small_anim; // 0f + RIL_CDMA_SMS_UdhLargePictureData large_picture; // 10 + RIL_CDMA_SMS_UdhSmallPictureData small_picture; // 11 + RIL_CDMA_SMS_UdhVarPicture var_picture; // 12 + + RIL_CDMA_SMS_UdhUserPrompt user_prompt; // 13 + RIL_CDMA_SMS_UdhEo eo; // 14 + + RIL_CDMA_SMS_UdhRfc822 rfc822; // 20 + RIL_CDMA_SMS_UdhOther other; + + }u; +} RIL_CDMA_SMS_Udh; + +/* ----------------------------- */ +/* -- User data encoding type -- */ +/* ----------------------------- */ +typedef enum { + RIL_CDMA_SMS_ENCODING_OCTET = 0, /* 8-bit */ + RIL_CDMA_SMS_ENCODING_IS91EP, /* varies */ + RIL_CDMA_SMS_ENCODING_ASCII, /* 7-bit */ + RIL_CDMA_SMS_ENCODING_IA5, /* 7-bit */ + RIL_CDMA_SMS_ENCODING_UNICODE, /* 16-bit */ + RIL_CDMA_SMS_ENCODING_SHIFT_JIS, /* 8 or 16-bit */ + RIL_CDMA_SMS_ENCODING_KOREAN, /* 8 or 16-bit */ + RIL_CDMA_SMS_ENCODING_LATIN_HEBREW, /* 8-bit */ + RIL_CDMA_SMS_ENCODING_LATIN, /* 8-bit */ + RIL_CDMA_SMS_ENCODING_GSM_7_BIT_DEFAULT, /* 7-bit */ + RIL_CDMA_SMS_ENCODING_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_UserDataEncoding; + +/* ------------------------ */ +/* -- IS-91 EP data type -- */ +/* ------------------------ */ +typedef enum { + RIL_CDMA_SMS_IS91EP_VOICE_MAIL = 0x82, + RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE_FULL = 0x83, + RIL_CDMA_SMS_IS91EP_CLI_ORDER = 0x84, + RIL_CDMA_SMS_IS91EP_SHORT_MESSAGE = 0x85, + RIL_CDMA_SMS_IS91EP_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_IS91EPType; + +typedef struct { + /* NOTE: If message_id.udh_present == TRUE: + ** 'num_headers' is the number of User Data Headers (UDHs), + ** and 'headers' include all those headers. + */ + unsigned char num_headers; + RIL_CDMA_SMS_Udh headers[RIL_CDMA_SMS_MAX_UD_HEADERS]; + + RIL_CDMA_SMS_UserDataEncoding encoding; + RIL_CDMA_SMS_IS91EPType is91ep_type; + + /*---------------------------------------------------------------------- + 'data_len' indicates the valid number of bytes in the 'data' array. + + 'padding_bits' (0-7) indicates how many bits in the last byte of 'data' + are invalid bits. This parameter is only used for Mobile-Originated + messages. There is no way for the API to tell how many padding bits + exist in the received message. Instead, the application can find out how + many padding bits exist in the user data when decoding the user data. + + 'data' has the raw bits of the user data field of the SMS message. + The client software should decode the raw user data according to its + supported encoding types and languages. + + EXCEPTION 1: CMT-91 user data raw bits are first translated into BD fields + (e.g. num_messages, callback, etc.) The translated user data field in + VMN and Short Message is in the form of ASCII characters, each occupying + a byte in the resulted 'data'. + + EXCEPTION 2: GSM 7-bit Default characters are decoded so that each byte + has one 7-bit GSM character. + + 'number_of_digits' is the number of digits/characters (7, 8, 16, or + whatever bits) in the raw user data, which can be used by the client + when decoding the user data according to the encoding type and language. + -------------------------------------------------------------------------*/ + unsigned char data_len; + unsigned char padding_bits; + unsigned char data[ RIL_CDMA_SMS_USER_DATA_MAX ]; + unsigned char number_of_digits; + +} RIL_CDMA_SMS_CdmaUserData; + +/* -------------------- */ +/* ---- Message Id ---- */ +/* -------------------- */ +typedef enum { + RIL_CDMA_SMS_BD_TYPE_RESERVED_0 = 0, + RIL_CDMA_SMS_BD_TYPE_DELIVER, /* MT only */ + RIL_CDMA_SMS_BD_TYPE_SUBMIT, /* MO only */ + RIL_CDMA_SMS_BD_TYPE_CANCELLATION, /* MO only */ + RIL_CDMA_SMS_BD_TYPE_DELIVERY_ACK, /* MT only */ + RIL_CDMA_SMS_BD_TYPE_USER_ACK, /* MT & MO */ + RIL_CDMA_SMS_BD_TYPE_READ_ACK, /* MT & MO */ + RIL_CDMA_SMS_BD_TYPE_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_BdMessageType; + +typedef unsigned int RIL_CDMA_SMS_MessageNumber; + +typedef struct { + RIL_CDMA_SMS_BdMessageType type; + RIL_CDMA_SMS_MessageNumber id_number; + unsigned char udh_present; + /* NOTE: if FEATURE_SMS_UDH is not defined, + ** udh_present should be ignored. + */ +} RIL_CDMA_SMS_MessageId; + +typedef unsigned char RIL_CDMA_SMS_UserResponse; + +/* ------------------- */ +/* ---- Timestamp ---- */ +/* ------------------- */ +typedef struct { + /* If 'year' is between 96 and 99, the actual year is 1900 + 'year'; + if 'year' is between 00 and 95, the actual year is 2000 + 'year'. + NOTE: Each field has two BCD digits and byte arrangement is + */ + unsigned char year; /* 0x00-0x99 */ + unsigned char month; /* 0x01-0x12 */ + unsigned char day; /* 0x01-0x31 */ + unsigned char hour; /* 0x00-0x23 */ + unsigned char minute; /* 0x00-0x59 */ + unsigned char second; /* 0x00-0x59 */ + signed char timezone; /* +/-, [-48,+48] number of 15 minutes - GW only */ +} RIL_CDMA_SMS_Timestamp; + +/* ------------------ */ +/* ---- Priority ---- */ +/* ------------------ */ +typedef enum { + RIL_CDMA_SMS_PRIORITY_NORMAL = 0, + RIL_CDMA_SMS_PRIORITY_INTERACTIVE, + RIL_CDMA_SMS_PRIORITY_URGENT, + RIL_CDMA_SMS_PRIORITY_EMERGENCY, + RIL_CDMA_SMS_PRIORITY_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_Priority; + +/* ----------------- */ +/* ---- Privacy ---- */ +/* ----------------- */ +typedef enum { + RIL_CDMA_SMS_PRIVACY_NORMAL = 0, + RIL_CDMA_SMS_PRIVACY_RESTRICTED, + RIL_CDMA_SMS_PRIVACY_CONFIDENTIAL, + RIL_CDMA_SMS_PRIVACY_SECRET, + RIL_CDMA_SMS_PRIVACY_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_Privacy; + +/* ---------------------- */ +/* ---- Reply option ---- */ +/* ---------------------- */ +typedef struct { + /* whether user ack is requested + */ + unsigned char user_ack_requested; + + /* whether delivery ack is requested. + Should be FALSE for incoming messages. + */ + unsigned char delivery_ack_requested; + + /* Message originator requests the receiving phone to send back a READ_ACK + ** message automatically when the user reads the received message. + */ + unsigned char read_ack_requested; + +} RIL_CDMA_SMS_ReplyOption; + +typedef enum { + RIL_CDMA_SMS_ALERT_MODE_DEFAULT = 0, + RIL_CDMA_SMS_ALERT_MODE_LOW_PRIORITY = 1, + RIL_CDMA_SMS_ALERT_MODE_MEDIUM_PRIORITY = 2, + RIL_CDMA_SMS_ALERT_MODE_HIGH_PRIORITY = 3, + + /* For pre-IS637A implementations, alert_mode only has values of True/False: + */ + RIL_CDMA_SMS_ALERT_MODE_OFF = 0, + RIL_CDMA_SMS_ALERT_MODE_ON = 1 + +} RIL_CDMA_SMS_AlertMode; + +/* ------------------ */ +/* ---- Language ---- */ +/* ------------------ */ +typedef enum { + RIL_CDMA_SMS_LANGUAGE_UNSPECIFIED = 0, + RIL_CDMA_SMS_LANGUAGE_ENGLISH, + RIL_CDMA_SMS_LANGUAGE_FRENCH, + RIL_CDMA_SMS_LANGUAGE_SPANISH, + RIL_CDMA_SMS_LANGUAGE_JAPANESE, + RIL_CDMA_SMS_LANGUAGE_KOREAN, + RIL_CDMA_SMS_LANGUAGE_CHINESE, + RIL_CDMA_SMS_LANGUAGE_HEBREW, + RIL_CDMA_SMS_LANGUAGE_MAX32 = 0x10000000 + +} RIL_CDMA_SMS_Language; + +/* ---------------------------------- */ +/* ---------- Display Mode ---------- */ +/* ---------------------------------- */ +typedef enum { + RIL_CDMA_SMS_DISPLAY_MODE_IMMEDIATE = 0, + RIL_CDMA_SMS_DISPLAY_MODE_DEFAULT = 1, + RIL_CDMA_SMS_DISPLAY_MODE_USER_INVOKE = 2, + RIL_CDMA_SMS_DISPLAY_MODE_RESERVED = 3 +} RIL_CDMA_SMS_DisplayMode; + +/* IS-637B parameters/fields +*/ + +/* ---------------------------------- */ +/* ---------- Delivery Status ------- */ +/* ---------------------------------- */ +typedef enum { + RIL_CDMA_SMS_DELIVERY_STATUS_ACCEPTED = 0, /* ERROR_CLASS_NONE */ + RIL_CDMA_SMS_DELIVERY_STATUS_DEPOSITED_TO_INTERNET = 1, /* ERROR_CLASS_NONE */ + RIL_CDMA_SMS_DELIVERY_STATUS_DELIVERED = 2, /* ERROR_CLASS_NONE */ + RIL_CDMA_SMS_DELIVERY_STATUS_CANCELLED = 3, /* ERROR_CLASS_NONE */ + + RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_CONGESTION = 4, /* ERROR_CLASS_TEMP & PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_NETWORK_ERROR = 5, /* ERROR_CLASS_TEMP & PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_CANCEL_FAILED = 6, /* ERROR_CLASS_PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_BLOCKED_DESTINATION = 7, /* ERROR_CLASS_PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_TEXT_TOO_LONG = 8, /* ERROR_CLASS_PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_DUPLICATE_MESSAGE = 9, /* ERROR_CLASS_PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_INVALID_DESTINATION = 10, /* ERROR_CLASS_PERM */ + RIL_CDMA_SMS_DELIVERY_STATUS_MESSAGE_EXPIRED = 13, /* ERROR_CLASS_PERM */ + + RIL_CDMA_SMS_DELIVERY_STATUS_UNKNOWN_ERROR = 0x1F /* ERROR_CLASS_PERM */ + + /* All the other values are reserved */ + +} RIL_CDMA_SMS_DeliveryStatusE; + +typedef struct { + RIL_CDMA_SMS_ErrorClass error_class; + RIL_CDMA_SMS_DeliveryStatusE status; +} RIL_CDMA_SMS_DeliveryStatus; + +typedef struct { + unsigned char address[RIL_CDMA_SMS_IP_ADDRESS_SIZE]; + unsigned char is_valid; +} RIL_CDMA_SMS_IpAddress; + +/* This special parameter captures any unrecognized/proprietary parameters +*/ +typedef struct { + unsigned char input_other_len; + unsigned char desired_other_len; /* used during decoding */ + unsigned char * other_data; +} RIL_CDMA_SMS_OtherParm; + +typedef struct { + /* the mask indicates which fields are present in this message */ + unsigned int mask; + + RIL_CDMA_SMS_MessageId message_id; + RIL_CDMA_SMS_CdmaUserData user_data; + RIL_CDMA_SMS_UserResponse user_response; + RIL_CDMA_SMS_Timestamp mc_time; + RIL_CDMA_SMS_Timestamp validity_absolute; + RIL_CDMA_SMS_Timestamp validity_relative; + RIL_CDMA_SMS_Timestamp deferred_absolute; + RIL_CDMA_SMS_Timestamp deferred_relative; + RIL_CDMA_SMS_Priority priority; + RIL_CDMA_SMS_Privacy privacy; + RIL_CDMA_SMS_ReplyOption reply_option; + unsigned char num_messages; /* the actual value; not BCDs */ + RIL_CDMA_SMS_AlertMode alert_mode; + /* For pre-IS-637A implementations, alert_mode is either Off or On. */ + RIL_CDMA_SMS_Language language; + RIL_CDMA_SMS_Address callback; + RIL_CDMA_SMS_DisplayMode display_mode; + + RIL_CDMA_SMS_DeliveryStatus delivery_status; + unsigned int deposit_index; + + RIL_CDMA_SMS_IpAddress ip_address; + unsigned char rsn_no_notify; + + /* See function comments of wms_ts_decode() and + ** wms_ts_decode_cdma_bd_with_other() for details regarding 'other' parameters + */ + RIL_CDMA_SMS_OtherParm other; + +} RIL_CDMA_SMS_ClientBd; + +typedef struct { + unsigned char length; /* length, in bytes, of the encoded SMS message */ + unsigned char * data; /* the encoded SMS message (max 255 bytes) */ +} RIL_CDMA_Encoded_SMS; + +#ifdef __cplusplus +} +#endif + +#endif /*ANDROID_RIL_CDMA_SMS_H*/ diff --git a/include/telephony/ril_commands_vendor.h b/include/telephony/ril_commands_vendor.h new file mode 100644 index 0000000..81e078f --- /dev/null +++ b/include/telephony/ril_commands_vendor.h @@ -0,0 +1,46 @@ +/* //device/libs/telephony/ril_commands.h +** +** Copyright 2006, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + {10000, NULL}, + {RIL_REQUEST_DIAL_EMERGENCY_CALL, NULL}, // 10001 + {RIL_REQUEST_CALL_DEFLECTION, NULL}, // 10002 + {RIL_REQUEST_MODIFY_CALL_INITIATE, NULL}, // 10003 + {RIL_REQUEST_MODIFY_CALL_CONFIRM, NULL}, // 10004 + {RIL_REQUEST_SET_VOICE_DOMAIN_PREF, NULL}, // 10005 + {RIL_REQUEST_SAFE_MODE, NULL}, // 10006 + {RIL_REQUEST_SET_TRANSMIT_POWER, NULL}, // 10007 + {RIL_REQUEST_GET_CELL_BROADCAST_CONFIG, NULL}, // 10008 + {RIL_REQUEST_GET_PHONEBOOK_STORAGE_INFO, NULL}, // 10009 + {RIL_REQUEST_GET_PHONEBOOK_ENTRY, NULL}, // 10010 + {RIL_REQUEST_ACCESS_PHONEBOOK_ENTRY, NULL}, // 10011 + {RIL_REQUEST_USIM_PB_CAPA, NULL}, // 10012 + {RIL_REQUEST_LOCK_INFO, NULL}, // 10013 + {RIL_REQUEST_STK_SIM_INIT_EVENT, NULL}, // 10014 + {RIL_REQUEST_SET_PREFERRED_NETWORK_LIST, NULL}, // 10015 + {RIL_REQUEST_GET_PREFERRED_NETWORK_LIST, NULL}, // 10016 + {RIL_REQUEST_CHANGE_SIM_PERSO, NULL}, // 10017 + {RIL_REQUEST_ENTER_SIM_PERSO, NULL}, // 10018 + {RIL_REQUEST_SEND_ENCODED_USSD, NULL}, // 10019 + {RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE, NULL}, // 10020 + {RIL_REQUEST_HANGUP_VT, NULL}, // 10021 + {RIL_REQUEST_HOLD, NULL}, // 10022 + {RIL_REQUEST_SET_SIM_POWER, NULL}, // 10023 + {RIL_REQUEST_UICC_GBA_AUTHENTICATE_BOOTSTRAP, NULL}, // 10025 + {RIL_REQUEST_UICC_GBA_AUTHENTICATE_NAF, NULL}, // 10026 + {RIL_REQUEST_GET_INCOMING_COMMUNICATION_BARRING, NULL}, // 10027 + {RIL_REQUEST_SET_INCOMING_COMMUNICATION_BARRING, NULL}, // 10028 + {RIL_REQUEST_QUERY_CNAP, NULL}, // 10029 + {RIL_REQUEST_SET_TRANSFER_CALL, NULL}, // 10030 diff --git a/include/telephony/ril_msim.h b/include/telephony/ril_msim.h new file mode 100644 index 0000000..5c0b8c5 --- /dev/null +++ b/include/telephony/ril_msim.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_RIL_MSIM_H +#define ANDROID_RIL_MSIM_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + RIL_UICC_SUBSCRIPTION_DEACTIVATE = 0, + RIL_UICC_SUBSCRIPTION_ACTIVATE = 1 +} RIL_UiccSubActStatus; + +typedef enum { + RIL_SUBSCRIPTION_1 = 0, + RIL_SUBSCRIPTION_2 = 1, + RIL_SUBSCRIPTION_3 = 2 +} RIL_SubscriptionType; + +typedef struct { + int slot; /* 0, 1, ... etc. */ + int app_index; /* array subscriptor from applications[RIL_CARD_MAX_APPS] in + RIL_REQUEST_GET_SIM_STATUS */ + RIL_SubscriptionType sub_type; /* Indicates subscription 1 or subscription 2 */ + RIL_UiccSubActStatus act_status; +} RIL_SelectUiccSub; + +#ifdef __cplusplus +} +#endif + +#endif /*ANDROID_RIL_MSIM_H*/ diff --git a/include/telephony/ril_nv_items.h b/include/telephony/ril_nv_items.h new file mode 100644 index 0000000..748ea07 --- /dev/null +++ b/include/telephony/ril_nv_items.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_RIL_NV_ITEMS_H +#define ANDROID_RIL_NV_ITEMS_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Must match the values in RadioNVItems.java in frameworks/opt/telephony. */ +typedef enum { + + // CDMA radio and account information (items 1-10) + RIL_NV_CDMA_MEID = 1, // CDMA MEID (hex) + RIL_NV_CDMA_MIN = 2, // CDMA MIN (MSID) + RIL_NV_CDMA_MDN = 3, // CDMA MDN + RIL_NV_CDMA_ACCOLC = 4, // CDMA access overload control + + // Carrier device provisioning (items 11-30) + RIL_NV_DEVICE_MSL = 11, // device MSL + RIL_NV_RTN_RECONDITIONED_STATUS = 12, // RTN reconditioned status + RIL_NV_RTN_ACTIVATION_DATE = 13, // RTN activation date + RIL_NV_RTN_LIFE_TIMER = 14, // RTN life timer + RIL_NV_RTN_LIFE_CALLS = 15, // RTN life calls + RIL_NV_RTN_LIFE_DATA_TX = 16, // RTN life data TX + RIL_NV_RTN_LIFE_DATA_RX = 17, // RTN life data RX + RIL_NV_OMADM_HFA_LEVEL = 18, // HFA in progress + + // Mobile IP profile information (items 31-50) + RIL_NV_MIP_PROFILE_NAI = 31, // NAI realm + RIL_NV_MIP_PROFILE_HOME_ADDRESS = 32, // MIP home address + RIL_NV_MIP_PROFILE_AAA_AUTH = 33, // AAA auth + RIL_NV_MIP_PROFILE_HA_AUTH = 34, // HA auth + RIL_NV_MIP_PROFILE_PRI_HA_ADDR = 35, // primary HA address + RIL_NV_MIP_PROFILE_SEC_HA_ADDR = 36, // secondary HA address + RIL_NV_MIP_PROFILE_REV_TUN_PREF = 37, // reverse TUN preference + RIL_NV_MIP_PROFILE_HA_SPI = 38, // HA SPI + RIL_NV_MIP_PROFILE_AAA_SPI = 39, // AAA SPI + RIL_NV_MIP_PROFILE_MN_HA_SS = 40, // HA shared secret + RIL_NV_MIP_PROFILE_MN_AAA_SS = 41, // AAA shared secret + + // CDMA network and band config (items 51-70) + RIL_NV_CDMA_PRL_VERSION = 51, // CDMA PRL version + RIL_NV_CDMA_BC10 = 52, // CDMA band class 10 + RIL_NV_CDMA_BC14 = 53, // CDMA band class 14 + RIL_NV_CDMA_SO68 = 54, // CDMA SO68 + RIL_NV_CDMA_SO73_COP0 = 55, // CDMA SO73 COP0 + RIL_NV_CDMA_SO73_COP1TO7 = 56, // CDMA SO73 COP1-7 + RIL_NV_CDMA_1X_ADVANCED_ENABLED = 57, // CDMA 1X Advanced enabled + RIL_NV_CDMA_EHRPD_ENABLED = 58, // CDMA eHRPD enabled + RIL_NV_CDMA_EHRPD_FORCED = 59, // CDMA eHRPD forced + + // LTE network and band config (items 71-90) + RIL_NV_LTE_BAND_ENABLE_25 = 71, // LTE band 25 enable + RIL_NV_LTE_BAND_ENABLE_26 = 72, // LTE band 26 enable + RIL_NV_LTE_BAND_ENABLE_41 = 73, // LTE band 41 enable + + RIL_NV_LTE_SCAN_PRIORITY_25 = 74, // LTE band 25 scan priority + RIL_NV_LTE_SCAN_PRIORITY_26 = 75, // LTE band 26 scan priority + RIL_NV_LTE_SCAN_PRIORITY_41 = 76, // LTE band 41 scan priority + + RIL_NV_LTE_HIDDEN_BAND_PRIORITY_25 = 77, // LTE hidden band 25 priority + RIL_NV_LTE_HIDDEN_BAND_PRIORITY_26 = 78, // LTE hidden band 26 priority + RIL_NV_LTE_HIDDEN_BAND_PRIORITY_41 = 79, // LTE hidden band 41 priority + +} RIL_NV_Item; + +#ifdef __cplusplus +} +#endif + +#endif /* ANDROID_RIL_NV_ITEMS_H */ diff --git a/include/telephony/ril_unsol_commands_vendor.h b/include/telephony/ril_unsol_commands_vendor.h new file mode 100644 index 0000000..bbd63ec --- /dev/null +++ b/include/telephony/ril_unsol_commands_vendor.h @@ -0,0 +1,85 @@ +/* //device/libs/telephony/ril_unsol_commands.h +** +** Copyright 2006, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + {SAMSUNG_UNSOL_RESPONSE_BASE, NULL, WAKE_PARTIAL}, // 11000 + {RIL_UNSOL_RELEASE_COMPLETE_MESSAGE, NULL, WAKE_PARTIAL}, // 11001 + {RIL_UNSOL_STK_SEND_SMS_RESULT, NULL, WAKE_PARTIAL}, // 11002 + {RIL_UNSOL_STK_CALL_CONTROL_RESULT, NULL, WAKE_PARTIAL}, // 11003 + {11004, NULL, WAKE_PARTIAL}, + {11005, NULL, WAKE_PARTIAL}, + {11006, NULL, WAKE_PARTIAL}, + {11007, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_DEVICE_READY_NOTI, NULL, WAKE_PARTIAL}, // 11008 + {RIL_UNSOL_GPS_NOTI, NULL, WAKE_PARTIAL}, // 11009 + {RIL_UNSOL_AM, NULL, WAKE_PARTIAL}, // 11010 + {RIL_UNSOL_DUN_PIN_CONTROL_SIGNAL, NULL, WAKE_PARTIAL}, // 11011 + {RIL_UNSOL_DATA_SUSPEND_RESUME, NULL, WAKE_PARTIAL}, // 11012 + {RIL_UNSOL_SAP, NULL, WAKE_PARTIAL}, // 11013 + {11014, NULL, WAKE_PARTIAL}, + {11015, NULL, WAKE_PARTIAL}, + {11016, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_WB_AMR_STATE, NULL, WAKE_PARTIAL}, + {11018, NULL, WAKE_PARTIAL}, + {11019, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_UART, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_SIM_PB_READY, NULL, WAKE_PARTIAL}, + {11022, NULL, WAKE_PARTIAL}, + {11023, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_VE, NULL, WAKE_PARTIAL}, // 11024 + {11025, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_FACTORY_AM, NULL, WAKE_PARTIAL}, // 11026 + {RIL_UNSOL_IMS_REGISTRATION_STATE_CHANGED, NULL, WAKE_PARTIAL}, // 11027 + {RIL_UNSOL_MODIFY_CALL, NULL, WAKE_PARTIAL}, // 11028 + {11029, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_CS_FALLBACK, NULL, WAKE_PARTIAL}, // 11030 + {11031, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_VOICE_SYSTEM_ID, NULL, WAKE_PARTIAL}, // 11032 + {11033, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_IMS_RETRYOVER, NULL, WAKE_PARTIAL}, // 11034 + {RIL_UNSOL_PB_INIT_COMPLETE, NULL, WAKE_PARTIAL}, // 11035 + {11036, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_HYSTERESIS_DCN, NULL, WAKE_PARTIAL}, // 11037 + {RIL_UNSOL_CP_POSITION, NULL, WAKE_PARTIAL}, // 11038 + {11039, NULL, WAKE_PARTIAL}, + {11040, NULL, WAKE_PARTIAL}, + {11041, NULL, WAKE_PARTIAL}, + {11042, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_HOME_NETWORK_NOTI, NULL, WAKE_PARTIAL}, // 11043 + {11044, NULL, WAKE_PARTIAL}, + {11045, NULL, WAKE_PARTIAL}, + {11046, NULL, WAKE_PARTIAL}, + {11047, NULL, WAKE_PARTIAL}, + {11048, NULL, WAKE_PARTIAL}, + {11049, NULL, WAKE_PARTIAL}, + {11050, NULL, WAKE_PARTIAL}, + {11051, NULL, WAKE_PARTIAL}, + {11052, NULL, WAKE_PARTIAL}, + {11053, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_STK_CALL_STATUS, NULL, WAKE_PARTIAL}, // 11054 + {11055, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_MODEM_CAP, NULL, WAKE_PARTIAL}, // 11056 + {RIL_UNSOL_SIM_SWAP_STATE_CHANGED, NULL, WAKE_PARTIAL}, // 11057 + {11058, NULL, WAKE_PARTIAL}, + {11059, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_DUN, NULL, WAKE_PARTIAL}, // 11060 + {RIL_UNSOL_IMS_PREFERENCE_CHANGED, NULL, WAKE_PARTIAL}, // 11061 + {RIL_UNSOL_SIM_APPLICATION_REFRESH, NULL, WAKE_PARTIAL}, // 11062 + {RIL_UNSOL_UICC_APPLICATION_STATUS, NULL, WAKE_PARTIAL}, // 11063 + {RIL_UNSOL_VOICE_RADIO_BEARER_HO_STATUS, NULL, WAKE_PARTIAL}, // 11064 + {RIL_UNSOL_CLM_NOTI, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_SIM_ICCID_NOTI, NULL, WAKE_PARTIAL}, + {RIL_UNSOL_SNDMGR_WB_AMR_REPORT, NULL, WAKE_PARTIAL}, // 20017 + {RIL_UNSOL_SNDMGR_CLOCK_CTRL, NULL, WAKE_PARTIAL}, // 20022 diff --git a/lineage.dependencies b/lineage.dependencies new file mode 100644 index 0000000..16a46fd --- /dev/null +++ b/lineage.dependencies @@ -0,0 +1,14 @@ +[ + { + "repository": "android_hardware_samsung", + "target_path": "hardware/samsung" + }, + { + "repository": "android_kernel_samsung_exynos7870", + "target_path": "kernel/samsung/exynos7870" + }, + { + "repository": "android_packages_resources_devicesettings", + "target_path": "packages/resources/devicesettings" + } +] diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..320cf41 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,422 @@ + + + android.hardware.audio + hwbinder + 5.0 + + IDevicesFactory + default + + @5.0::IDevicesFactory/default + + + android.hardware.audio.effect + hwbinder + 5.0 + + IEffectsFactory + default + + @5.0::IEffectsFactory/default + + + android.hardware.biometrics.fingerprint + hwbinder + 2.1 + + IBiometricsFingerprint + default + + @2.1::IBiometricsFingerprint/default + + + android.hardware.bluetooth + hwbinder + 1.0 + + IBluetoothHci + default + + @1.0::IBluetoothHci/default + + + android.hardware.camera.provider + hwbinder + 2.4 + + ICameraProvider + legacy/0 + + @2.4::ICameraProvider/legacy/0 + + + android.hardware.configstore + hwbinder + 1.1 + + ISurfaceFlingerConfigs + default + + @1.1::ISurfaceFlingerConfigs/default + + + android.hardware.drm + hwbinder + 1.0 + + ICryptoFactory + default + + + IDrmFactory + default + + @1.0::ICryptoFactory/default + @1.0::IDrmFactory/default + @1.1::ICryptoFactory/widevine + @1.1::IDrmFactory/widevine + @1.2::ICryptoFactory/clearkey + @1.2::IDrmFactory/clearkey + + + android.hardware.gatekeeper + passthrough + 1.0 + + IGatekeeper + default + + @1.0::IGatekeeper/default + + + android.hardware.gnss + hwbinder + 1.1 + + IGnss + default + + @1.1::IGnss/default + + + android.hardware.graphics.allocator + hwbinder + 2.0 + + IAllocator + default + + @2.0::IAllocator/default + + + android.hardware.graphics.composer + hwbinder + 2.1 + + IComposer + default + + @2.1::IComposer/default + + + android.hardware.graphics.mapper + passthrough + 2.0 + + IMapper + default + + @2.0::IMapper/default + + + android.hardware.health + hwbinder + 2.0 + + IHealth + default + + @2.0::IHealth/default + + + android.hardware.keymaster + hwbinder + 3.0 + + IKeymasterDevice + default + + @3.0::IKeymasterDevice/default + + + android.hardware.light + hwbinder + 2.0 + + ILight + default + + @2.0::ILight/default + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + @1.0::IOmx/default + @1.0::IOmxStore/default + + + android.hardware.memtrack + hwbinder + 1.0 + + IMemtrack + default + + @1.0::IMemtrack/default + + + android.hardware.nfc + hwbinder + 1.1 + + INfc + default + + @1.1::INfc/default + + + android.hardware.power + hwbinder + 1.0 + + IPower + default + + @1.0::IPower/default + + + android.hardware.radio + hwbinder + + + android.hardware.radio + hwbinder + @1.2::ISap/slot1 + @1.2::ISap/slot2 + @1.4::IRadio/slot1 + @1.4::IRadio/slot2 + + + android.hardware.radio.config + hwbinder + 1.1 + + IRadioConfig + default + + @1.1::IRadioConfig/default + + + android.hardware.radio.deprecated + hwbinder + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + @1.0::IDevice/default + + + android.hardware.sensors + hwbinder + 1.0 + + ISensors + default + + @1.0::ISensors/default + + + android.hardware.soundtrigger + hwbinder + 2.1 + + ISoundTriggerHw + default + + @2.1::ISoundTriggerHw/default + + + android.hardware.tetheroffload.config + hwbinder + 1.0 + + IOffloadConfig + default + + @1.0::IOffloadConfig/default + + + android.hardware.tetheroffload.control + hwbinder + 1.0 + + IOffloadControl + default + + @1.0::IOffloadControl/default + + + android.hardware.thermal + hwbinder + 1.0 + + IThermal + default + + @1.0::IThermal/default + + + android.hardware.usb + hwbinder + 1.0 + + IUsb + default + + @1.0::IUsb/default + + + android.hardware.vibrator + hwbinder + 1.0 + + IVibrator + default + + @1.0::IVibrator/default + + + android.hardware.wifi + hwbinder + 1.3 + + IWifi + default + + @1.3::IWifi/default + + + android.hardware.wifi.hostapd + hwbinder + 1.1 + + IHostapd + default + + @1.1::IHostapd/default + + + android.hardware.wifi.supplicant + hwbinder + 1.2 + + ISupplicant + default + + @1.2::ISupplicant/default + + + com.qualcomm.qti.ant + hwbinder + 1.0 + + IAntHci + default + + @1.0::IAntHci/default + + + vendor.samsung.hardware.biometrics.fingerprint + hwbinder + 2.1 + + ISecBiometricsFingerprint + default + + @2.1::ISecBiometricsFingerprint/default + + + vendor.samsung.hardware.gnss + hwbinder + 1.0 + + ISecGnss + default + + @1.0::ISecGnss/default + + + vendor.samsung.hardware.nfc + hwbinder + 1.1 + + ISecNfc + default + + @1.1::ISecNfc/default + + + vendor.samsung.hardware.radio + hwbinder + 2.0 + + ISehRadio + slot1 + slot2 + + @2.0::ISehRadio/slot1 + @2.0::ISehRadio/slot2 + + + vendor.samsung.hardware.radio.bridge + hwbinder + 2.0 + + ISehBridge + slot1 + slot2 + + @2.0::ISehBridge/slot1 + @2.0::ISehBridge/slot2 + + + vendor.samsung.hardware.radio.channel + hwbinder + 2.0 + + ISehChannel + epdgd + epdgd2 + imsd + imsd2 + + @2.0::ISehChannel/epdgd + @2.0::ISehChannel/epdgd2 + @2.0::ISehChannel/imsd + @2.0::ISehChannel/imsd2 + + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..533e990 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,634 @@ + + + + + + + true + + + + 2 + 7 + 15 + 50 + 100 + 200 + 400 + 1000 + 2000 + 3000 + 5000 + 10000 + + + + + 12 + 22 + 32 + 42 + 52 + 62 + 72 + 82 + 96 + 134 + 178 + 225 + 255 + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 25 + 30 + 35 + 40 + 45 + 50 + 55 + 60 + 65 + 70 + 75 + 80 + 85 + 90 + 95 + 100 + 105 + 110 + 115 + 120 + 125 + 130 + 135 + 140 + 145 + 150 + 155 + 160 + 165 + 170 + 175 + 180 + 185 + 190 + 195 + 200 + 205 + 210 + 215 + 220 + 225 + 230 + 235 + 240 + 245 + 250 + 255 + + + + + 6 + + + 184 + + + 1 + + + 2px + + + false + + + 255 + + + + rndis\\d + + + + + "wlan0" + "swlan0" + "softap.*" + + + + + bt-pan + + + + + + 0 + 1 + 4 + 5 + 7 + 9 + + + + rmnet0 + + + true + + + true + + + true + + + true + + + true + + + -82 + -85 + + + -79 + -82 + + + false + + + + + + + "wifi,1,1,1,-1,true" + "mobile,0,0,0,-1,true" + "mobile_mms,2,0,4,60000,true" + "mobile_supl,3,0,2,60000,true" + "mobile_dun,4,0,2,60000,true" + "mobile_hipri,5,0,3,60000,true" + "mobile_fota,10,0,2,60000,true" + "mobile_ims,11,0,2,60000,true" + "mobile_cbs,12,0,2,60000,true" + "mobile_ia,14,0,2,-1,true" + "bluetooth,7,7,2,-1,true" + "ethernet,9,9,9,-1,true" + "mobile_emergency,15,0,5,-1,true + + + + + + 192.168.42.2 + 192.168.42.254 + 192.168.43.2 + 192.168.43.254 + 192.168.44.2 + 192.168.44.254 + 192.168.45.2 + 192.168.45.254 + 192.168.46.2 + 192.168.46.254 + 192.168.47.2 + 192.168.47.254 + 192.168.48.2 + 192.168.48.254 + 192.168.49.2 + 192.168.49.254 + 192.168.50.2 + 192.168.50.254 + 192.168.51.2 + 192.168.51.254 + + + + + + "1,1" + "0,1" + "7,1" + "9,1" + + + + + true + + + false + + + true + + + Android-Mms/2.0 + + + http://www.google.com/oha/rdf/ua-profile-kila.xml + + false + + + 18 + + + true + + + false + + + + true + + + true + + + true + + + true + + + /system/priv-app/DeviceParts/DeviceParts.apk + + org.omnirom.device.KeyHandler + + + true + + + true + + + 4 + + true + + + 20 + + + com.android.systemui/com.android.systemui.doze.DozeService + true + + + true + + + false + + + true + + + 0 + + + true + + + true + + + true + + + 2 + + + + + + true + + + true + + + 5gnr:2097152,6291456,16777216,512000,2097152,8388608 + lte:2097152,4194304,8388608,262144,524288,1048576 + lte_ca:4096,6291456,12582912,4096,1048576,2097152 + umts:4094,87380,1220608,4096,16384,1220608 + hspa:4094,87380,1220608,4096,16384,1220608 + hsupa:4094,87380,1220608,4096,16384,1220608 + hsdpa:4094,87380,1220608,4096,16384,1220608 + hspap:4094,87380,1220608,4096,16384,1220608 + edge:4093,26280,35040,4096,16384,35040 + gprs:4092,8760,11680,4096,8760,11680 + evdo:4094,87380,524288,4096,16384,262144 + + + + + SUPL_HOST=supl.google.com + SUPL_PORT=7275 + SUPL_VER=0x20000 + SUPL_MODE=1 + SUPL_ES=1 + LPP_PROFILE=2 + USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1 + A_GLONASS_POS_PROTOCOL_SELECT=0 + GPS_LOCK=0 + + + + 524288,1048576,4194304,524288,1048576,4194304 + + + true + + + true + + + true + + + true + + + true + + + false + + + + 0 + 10 + 5 + + + + + 0 + 10 + 5 + + + + + 10 + + + + true + + + 1 + + + 4 + + + 3300 + + + + + + false + false + + + com.qualcomm.location + com.qualcomm.location + com.qualcomm.location + + + true + + + + + true + + + 680 + + true + org.codeaurora.ims + + + true + + + true + + 1 + + true + + + true + + + false + + + true + + + + 308203e5308202cda003020102020900ca7f2ef3e2f1842e300d06092a864886f70d0101050500308188310b300906035504061302434e3112301006035504080c094775616e67646f6e673111300f06035504070c085368656e7a68656e3110300e060355040a0c074f6e65506c7573310b3009060355040b0c0253573110300e06035504030c074f6e65506c75733121301f06092a864886f70d01090116126f6e65706c7573406f6e65706c75732e636e301e170d3135303530373037323332335a170d3432303932323037323332335a308188310b300906035504061302434e3112301006035504080c094775616e67646f6e673111300f06035504070c085368656e7a68656e3110300e060355040a0c074f6e65506c7573310b3009060355040b0c0253573110300e06035504030c074f6e65506c75733121301f06092a864886f70d01090116126f6e65706c7573406f6e65706c75732e636e30820122300d06092a864886f70d01010105000382010f003082010a0282010100ce24d23c2044f698476fe8f79388fa901520142424b58d10a5656a27bf1fa5ca4e381d8bc5773f29271e892bf25b06357c0cab9a06a93beb3c9eced9928c938f2829fbc63bc045dcfac0660f747dfe325ed5a8c7b785ccca472bc51afa823c1c0d8dd088aa8ef3ead6053f0020fee55b6c450b0c90f9a19f8f60808d1e0eb24309216f39bccb58991c4c1656aed444a5a0652e84587ae44e7c60101190d8d0d92a37407fc6da5432a8f20fe6414cf0ce2257edf76a7d2eb34d0d31e183867b552030beaf8e6e7ade37668d87c2bd52b8c29d3d30437058a31003f3dbbe8943db602feb71c7af51388234a0ea713a9fdd17ebc89463ff1065ee970edd3969d4110203010001a350304e301d0603551d0e04160414e24ca18e47f2c07476f9d37ce0d85a9f2fdf4456301f0603551d23041830168014e24ca18e47f2c07476f9d37ce0d85a9f2fdf4456300c0603551d13040530030101ff300d06092a864886f70d01010505000382010100a682431bd6bd9d99dc267686842fe3e2d6979798ec565314dcbede7b921ba78e210e9682dc72c07c09b0882b65df2a366007f3e4a594d0a85d04644b8e0f3e13cf16f2e764716625fe8dcf93e3936d496a86d0cc4c0aa2f7d46d904eec834c604dd1c5ad2fd1ad599d6ab3375f36382303685edca5078e931977679a4f4c8a532294fd7dbc0c55ffb33e3aa064b628b8083def2ad60ba0abf8a777d69e38fe18bc2e4c63e94d05c2081b947b7caf919f272157ba90ea83a306fd2941c1d6380cc55abf7983125d4d60ac1463bdbf9baf41a6fef117b37d03d086cf754f4f3ef3b5cb054f5d2f26115b221818c785b3de1be552bb1decdf4f3d373bdd5022d150 + + + + true + + + true + + + true + + + diff --git a/overlay/frameworks/base/packages/Keyguard/res/values/config.xml b/overlay/frameworks/base/packages/Keyguard/res/values/config.xml new file mode 100644 index 0000000..1901603 --- /dev/null +++ b/overlay/frameworks/base/packages/Keyguard/res/values/config.xml @@ -0,0 +1,26 @@ + + + + + + + + 0 + + diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml new file mode 100644 index 0000000..1c5ecc6 --- /dev/null +++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -0,0 +1,24 @@ + + + + + true + + + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml new file mode 100644 index 0000000..d5be1a1 --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -0,0 +1,30 @@ + + + + + + + + true + + + true + diff --git a/overlay/lineage-sdk/lineage/res/res/values/config.xml b/overlay/lineage-sdk/lineage/res/res/values/config.xml new file mode 100755 index 0000000..42103f5 --- /dev/null +++ b/overlay/lineage-sdk/lineage/res/res/values/config.xml @@ -0,0 +1,154 @@ + + + + + 0 + + + 83 + + + 65 + + + + + + + + + + + + + + diff --git a/overlay/packages/apps/Settings/res/values/arrays.xml b/overlay/packages/apps/Settings/res/values/arrays.xml new file mode 100755 index 0000000..bfa3ef0 --- /dev/null +++ b/overlay/packages/apps/Settings/res/values/arrays.xml @@ -0,0 +1,31 @@ + + + + + + + 0 + -1 + -1 + + + diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml new file mode 100644 index 0000000..ff14921 --- /dev/null +++ b/overlay/packages/apps/Settings/res/values/config.xml @@ -0,0 +1,25 @@ + + + + + + true + + + true + + diff --git a/overlay/packages/services/Telephony/res/values/config.xml b/overlay/packages/services/Telephony/res/values/config.xml new file mode 100644 index 0000000..55ea7ce --- /dev/null +++ b/overlay/packages/services/Telephony/res/values/config.xml @@ -0,0 +1,22 @@ + + + + + + + true + diff --git a/proprietary-files.txt b/proprietary-files.txt new file mode 100644 index 0000000..0e3c485 --- /dev/null +++ b/proprietary-files.txt @@ -0,0 +1,170 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + + +# Bluetooth (aptX) +product/lib64/libaptX_encoder.so +product/lib64/libaptXHD_encoder.so + +# Camera +vendor/lib/hw/camera.universal7870.so +vendor/lib64/hw/camera.universal7870.so +vendor/lib/libcamera_client.so + +# DRM +vendor/lib/liboemcrypto.so +vendor/lib/mediadrm/libwvdrmengine.so + +# DRM - Widevine +vendor/bin/hw/android.hardware.drm@1.1-service.widevine +vendor/etc/init/android.hardware.drm@1.1-service.widevine.rc +vendor/lib/libwvhidl.so + +# GPS +vendor/bin/hw/gpsd +vendor/bin/hw/vendor.samsung.hardware.gnss@1.0-service +vendor/etc/gnss/ca.pem +vendor/etc/gnss/gps.cfg +vendor/etc/init/init.gps.rc +vendor/etc/init/vendor.samsung.hardware.gnss@1.0-service.rc +vendor/lib/libwrappergps.so +vendor/lib/vendor.samsung.hardware.gnss@1.0.so +vendor/lib64/hw/android.hardware.gnss@1.1-impl.so +vendor/lib64/hw/gps.default.so +vendor/lib64/hw/vendor.samsung.hardware.gnss@1.0-impl.so +vendor/lib64/libwrappergps.so +vendor/lib64/vendor.samsung.hardware.gnss@1.0.so + +# Graphics +vendor/lib/egl/libGLES_mali.so +vendor/lib64/egl/libGLES_mali.so + +# HWC +vendor/bin/hw/android.hardware.graphics.composer@2.1-service +vendor/lib/hw/gralloc.default.so +vendor/lib/hw/gralloc.exynos5.so +vendor/lib/hw/hwcomposer.exynos5.so +vendor/lib/libexynosdisplay.so +vendor/lib/libexynosgscaler.so +vendor/lib/libExynosHWCService.so +vendor/lib/libexynosscaler.so +vendor/lib/libexynosutils.so +vendor/lib/libexynosv4l2.so +vendor/lib/libGrallocWrapper.so +vendor/lib/libhdmi.so +vendor/lib/libhwc2on1adapter.so +vendor/lib/libhwc2onfbadapter.so +vendor/lib/libhwcutils.so +vendor/lib/libion_exynos.so +vendor/lib/libmpp.so +vendor/lib/libstainkiller.so +vendor/lib/libvirtualdisplay.so +vendor/lib64/hw/gralloc.default.so +vendor/lib64/hw/gralloc.exynos5.so +vendor/lib64/hw/hwcomposer.exynos5.so +vendor/lib64/libexynosdisplay.so +vendor/lib64/libexynosgscaler.so +vendor/lib64/libExynosHWCService.so +vendor/lib64/libexynosscaler.so +vendor/lib64/libexynosutils.so +vendor/lib64/libexynosv4l2.so +vendor/lib64/libGrallocWrapper.so +vendor/lib64/libhdmi.so +vendor/lib64/libhwc2on1adapter.so +vendor/lib64/libhwc2onfbadapter.so +vendor/lib64/libhwcutils.so +vendor/lib64/libion_exynos.so +vendor/lib64/libmpp.so +vendor/lib64/libvirtualdisplay.so + +# Lpm +vendor/bin/lpm + +# Memtrack +vendor/bin/hw/android.hardware.memtrack@1.0-service +vendor/lib/hw/memtrack.exynos5.so +vendor/lib64/hw/memtrack.exynos5.so + +# Misc +vendor/bin/sswap +vendor/lib/libcsc.so +vendor/lib/libsecnativefeature.so +vendor/lib/libuniplugin.so +vendor/lib64/libcsc.so +vendor/lib64/libsecnativefeature.so +vendor/lib64/libuniplugin.so + +# OMX +vendor/lib/libExynosOMX_Core.so +vendor/lib/libExynosOMX_Resourcemanager.so +vendor/lib/libstagefrighthw.so +vendor/lib/omx/libOMX.Exynos.AVC.Decoder.so +vendor/lib/omx/libOMX.Exynos.AVC.Encoder.so +vendor/lib/omx/libOMX.Exynos.HEVC.Decoder.so +vendor/lib/omx/libOMX.Exynos.HEVC.Encoder.so +vendor/lib/omx/libOMX.Exynos.MPEG4.Decoder.so +vendor/lib/omx/libOMX.Exynos.MPEG4.Encoder.so +vendor/lib/omx/libOMX.Exynos.VP8.Decoder.so +vendor/lib/omx/libOMX.Exynos.VP8.Encoder.so +vendor/lib/omx/libOMX.Exynos.VP9.Decoder.so +vendor/lib/omx/libOMX.Exynos.WMV.Decoder.so +vendor/lib64/libExynosOMX_Core.so +vendor/lib64/libExynosOMX_Resourcemanager.so +vendor/lib64/libstagefrighthw.so +vendor/lib64/omx/libOMX.Exynos.AVC.Decoder.so +vendor/lib64/omx/libOMX.Exynos.AVC.Encoder.so +vendor/lib64/omx/libOMX.Exynos.HEVC.Decoder.so +vendor/lib64/omx/libOMX.Exynos.HEVC.Encoder.so +vendor/lib64/omx/libOMX.Exynos.MPEG4.Decoder.so +vendor/lib64/omx/libOMX.Exynos.MPEG4.Encoder.so +vendor/lib64/omx/libOMX.Exynos.VP8.Decoder.so +vendor/lib64/omx/libOMX.Exynos.VP8.Encoder.so +vendor/lib64/omx/libOMX.Exynos.VP9.Decoder.so +vendor/lib64/omx/libOMX.Exynos.WMV.Decoder.so + +# RIL +vendor/bin/cbd +vendor/bin/hw/rild +vendor/etc/plmn_delta.bin +vendor/etc/plmn_delta_attaio.bin +vendor/etc/plmn_delta_hktw.bin +vendor/etc/plmn_delta_usacdma.bin +vendor/etc/plmn_delta_usagsm.bin +vendor/etc/plmn_se13.bin +vendor/lib/libfloatingfeature.so +vendor/lib64/libfloatingfeature.so +vendor/lib64/libreference-ril.so +vendor/lib64/libril.so +vendor/lib64/librilutils.so +vendor/lib64/libsec-ril.so +vendor/lib64/libsec-ril-dsds.so +vendor/lib64/libvndsecril-client.so +vendor/lib64/libvkmanager_vendor.so +vendor/lib64/vendor.samsung.hardware.radio.bridge@2.0.so +vendor/lib64/vendor.samsung.hardware.radio.channel@2.0.so +vendor/lib64/vendor.samsung.hardware.radio@2.0.so + +# Sensors +vendor/bin/hw/android.hardware.sensors@1.0-service +vendor/etc/init/android.hardware.sensors@1.0-service.rc +vendor/lib/libsensorlistener.so +vendor/lib/libsensorndkbridge.so +vendor/lib64/libsensorlistener.so +vendor/lib64/libsensorndkbridge.so + +# Thermal +vendor/bin/hw/android.hardware.thermal@1.0-service +vendor/etc/init/android.hardware.thermal@1.0-service.rc +vendor/lib/hw/thermal.universal7870.so +vendor/lib64/hw/thermal.universal7870.so diff --git a/rootdir/Android.mk b/rootdir/Android.mk new file mode 100644 index 0000000..a87e463 --- /dev/null +++ b/rootdir/Android.mk @@ -0,0 +1,88 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := fstab.samsungexynos7870 +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/fstab.samsungexynos7870 +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.baseband.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.baseband.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.rilchip.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.rilchip.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.rilcommon.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.rilcommon.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.samsung.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.samsung.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.samsungexynos7870.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.samsungexynos7870.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.samsungexynos7870.usb.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.samsungexynos7870.usb.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.wifi.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.wifi.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := ueventd.samsungexynos7870.rc +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_STEM := ueventd.rc +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/ueventd.samsungexynos7870.rc +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) +include $(BUILD_PREBUILT) diff --git a/rootdir/etc/fstab.recovery b/rootdir/etc/fstab.recovery new file mode 100644 index 0000000..c4280c6 --- /dev/null +++ b/rootdir/etc/fstab.recovery @@ -0,0 +1,21 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + + +/dev/block/platform/13540000.dwmmc0/by-name/BOOT /boot emmc defaults defaults +/dev/block/platform/13540000.dwmmc0/by-name/RECOVERY /recovery emmc defaults defaults +/dev/block/platform/13540000.dwmmc0/by-name/SYSTEM /system ext4 ro,errors=panic wait,recoveryonly +/dev/block/platform/13540000.dwmmc0/by-name/VENDOR /vendor ext4 ro,errors=panic wait,recoveryonly +/dev/block/platform/13540000.dwmmc0/by-name/CACHE /cache ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check +/dev/block/platform/13540000.dwmmc0/by-name/CACHE /cache f2fs nosuid,nodev,noatime,rw,inline_xattr wait,check,formattable +/dev/block/platform/13540000.dwmmc0/by-name/USERDATA /data ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,formattable,encryptable=footer,length=-16384 +/dev/block/platform/13540000.dwmmc0/by-name/USERDATA /data f2fs nosuid,nodev,noatime,rw,inline_xattr wait,check,formattable,encryptable=footer,length=-16384 +/dev/block/platform/13540000.dwmmc0/by-name/EFS /efs ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check +/dev/block/platform/13540000.dwmmc0/by-name/CPEFS /cpefs ext4 noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check + +# VOLD +/dev/block/platform/13540000.dwmmc0/by-name/HIDDEN /preload ext4 defaults voldmanaged=preload:auto +/devices/13560000.dwmmc2/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata +/devices/13600000.usb/13600000.dwc3/xhci-hcd.2.auto/usb* auto auto defaults voldmanaged=usb:auto diff --git a/rootdir/etc/fstab.samsungexynos7870 b/rootdir/etc/fstab.samsungexynos7870 new file mode 100644 index 0000000..01ef8f7 --- /dev/null +++ b/rootdir/etc/fstab.samsungexynos7870 @@ -0,0 +1,21 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + + +# /dev/block/platform/13540000.dwmmc0/by-name/BOOT /boot emmc defaults defaults +# /dev/block/platform/13540000.dwmmc0/by-name/RECOVERY /recovery emmc defaults defaults +# /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM /system ext4 ro,errors=panic wait,recoveryonly +# /dev/block/platform/13540000.dwmmc0/by-name/VENDOR /vendor ext4 ro,errors=panic wait,recoveryonly +/dev/block/platform/13540000.dwmmc0/by-name/CACHE /cache ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check +/dev/block/platform/13540000.dwmmc0/by-name/CACHE /cache f2fs nosuid,nodev,noatime,rw,inline_xattr wait,check,formattable +/dev/block/platform/13540000.dwmmc0/by-name/USERDATA /data ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,formattable,encryptable=footer,length=-16384 +/dev/block/platform/13540000.dwmmc0/by-name/USERDATA /data f2fs nosuid,nodev,noatime,rw,inline_xattr wait,check,formattable,encryptable=footer,length=-16384 +/dev/block/platform/13540000.dwmmc0/by-name/EFS /efs ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check +/dev/block/platform/13540000.dwmmc0/by-name/CPEFS /cpefs ext4 noatime,nosuid,nodev,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check + +# VOLD +/dev/block/platform/13540000.dwmmc0/by-name/HIDDEN /preload ext4 defaults voldmanaged=preload:auto +/devices/13560000.dwmmc2/mmc_host/mmc* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata +/devices/13600000.usb/13600000.dwc3/xhci-hcd.2.auto/usb* auto auto defaults voldmanaged=usb:auto diff --git a/rootdir/etc/init.baseband.rc b/rootdir/etc/init.baseband.rc new file mode 100644 index 0000000..7ba22c5 --- /dev/null +++ b/rootdir/etc/init.baseband.rc @@ -0,0 +1,63 @@ +on init + symlink /dev/block/platform/13540000.dwmmc0/by-name/RADIO /dev/mbin0 + restorecon /dev/mbin0 + write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 6 + write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 6 + +on fs + chown radio system /efs + chmod 0771 /efs + chown radio radio sys/devices/virtual/misc/multipdp/waketime + chmod 0660 /sys/devices/virtual/misc/umts_dm0/dm_state + chown radio system /sys/devices/virtual/misc/umts_dm0/dm_state + + # /efs/factory.prop for Dual / Single SIM settings + chown radio radio /efs/factory.prop + chmod 0600 /efs/factory.prop + +on property:ril.clatd.v4-rmnet0=up + write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet0/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet1=up + write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet1/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet2=up + write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet2/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet3=up + write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet3/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet4=up + write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet4/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet5=up + write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet5/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet6=up + write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet6/queues/rx-0/rps_cpus 2 + +on property:ril.clatd.v4-rmnet7=up + write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 4 + write /sys/class/net/v4-rmnet7/queues/rx-0/rps_cpus 2 + +service cpboot-daemon /vendor/bin/cbd -d -tss310 -bm -mm -P platform/13540000.dwmmc0/by-name/RADIO + class main + user root + group radio cache inet misc audio sdcard_rw log sdcard_r shell +# seclabel u:r:cbd:s0 + +on property:ro.multisim.simslotcount=* + write /sys/module/modem_ctrl_ss310ap/parameters/ds_detect ${ro.multisim.simslotcount} diff --git a/rootdir/etc/init.rilchip.rc b/rootdir/etc/init.rilchip.rc new file mode 100755 index 0000000..38f13e0 --- /dev/null +++ b/rootdir/etc/init.rilchip.rc @@ -0,0 +1,22 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# IMPORTANT: Do not create world writable files or directories. +# This is a common source of Android security bugs. +# + +service ril-daemon /vendor/bin/hw/rild -l /vendor/lib64/libsec-ril.so + class main + user radio + group radio cache inet misc audio sdcard_r sdcard_rw log vpn system readproc wakelock + capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW SYS_ADMIN CHOWN SYS_TIME + socket sap_uim_socket1 stream 660 bluetooth bluetooth + onrestart restart cpboot-daemon + onrestart restart DIAG-daemon + +service ril-daemon1 /vendor/bin/hw/rild -c 2 -l /vendor/lib64/libsec-ril-dsds.so + class main + user radio + group radio cache inet misc audio sdcard_r sdcard_rw log vpn system readproc wakelock + capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW SYS_ADMIN CHOWN SYS_TIME + onrestart restart cpboot-daemon + onrestart restart DIAG-daemon diff --git a/rootdir/etc/init.rilcommon.rc b/rootdir/etc/init.rilcommon.rc new file mode 100755 index 0000000..9e4da92 --- /dev/null +++ b/rootdir/etc/init.rilcommon.rc @@ -0,0 +1,20 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# IMPORTANT: Do not create world writable files or directories. +# This is a common source of Android security bugs. +# + +# service can not be overwritten except SPRINT +# Thus, rilcarrier is imported before common rc, like init.rilchip.rc + +on post-fs-data + mkdir /data/vendor/secradio 0770 radio radio + +on property:ro.vendor.multisim.simslotcount=1 + stop ril-daemon1 + +on property:hwservicemanager.ready=false + restart ril-daemon + +on property:hwservicemanager.ready=false && property:ro.vendor.multisim.simslotcount=2 + restart ril-daemon1 diff --git a/rootdir/etc/init.samsung.rc b/rootdir/etc/init.samsung.rc new file mode 100644 index 0000000..90ad587 --- /dev/null +++ b/rootdir/etc/init.samsung.rc @@ -0,0 +1,1892 @@ +on post-fs-data +# [ SEC_SELINUX_PORTING_COMMON + # for audit message + chown system system /proc/avc_msg + chmod 0660 /proc/avc_msg +# ] SEC_SELINUX_PORTING_COMMON + + # Mix device-specific information into the entropy pool + copy /proc/cmdline /dev/urandom + copy /default.prop /dev/urandom + + # MirrorLink permission + mkdir /dev/socket/mlaudio 0770 audioserver system + + # sdcard ramdump + chown system system /sys/module/sec_debug/parameters/dump_sink + chmod 0600 /sys/module/sec_debug/parameters/dump_sink + + # Create energy-aware scheduler tuning nodes + mkdir /dev/stune + mount cgroup none /dev/stune nodev noexec nosuid schedtune + mkdir /dev/stune/foreground + mkdir /dev/stune/background + mkdir /dev/stune/top-app + mkdir /dev/stune/rt + chown system system /dev/stune + chown system system /dev/stune/foreground + chown system system /dev/stune/background + chown system system /dev/stune/top-app + chown system system /dev/stune/rt + chown system system /dev/stune/tasks + chown system system /dev/stune/foreground/tasks + chown system system /dev/stune/background/tasks + chown system system /dev/stune/top-app/tasks + chown system system /dev/stune/rt/tasks + chmod 0664 /dev/stune/tasks + chmod 0664 /dev/stune/foreground/tasks + chmod 0664 /dev/stune/background/tasks + chmod 0664 /dev/stune/top-app/tasks + chmod 0664 /dev/stune/rt/tasks + +# System Intelligence + chown system system /proc/intelligence/state + chown system system /proc/intelligence/task_state + chmod 0444 /proc/intelligence/state + chmod 0664 /proc/intelligence/task_state + + restorecon_recursive /mnt + + mount configfs none /config nodev noexec nosuid + chmod 0770 /config/sdcardfs + chown system package_info /config/sdcardfs + + mkdir /mnt/secure 0700 root root + # Samsung ODE >>> + # Create private mountpoint so we can MS_MOVE from staging + mount tmpfs tmpfs /mnt/secure mode=0700,uid=0,gid=0 + # Directory for staging bindmounts + mkdir /mnt/secure/staging 0700 root root + restorecon_recursive /mnt/secure/staging + # Samsung ODE <<< + + # Directory-target for where the secure container + # imagefile directory will be bind-mounted + mkdir /mnt/secure/asec 0700 root root + mount tmpfs tmpfs /mnt/secure/asec mode=0700,uid=0,gid=0 + restorecon_recursive /mnt/secure/asec + + mkdir /mnt/asec 0755 root system + mkdir /mnt/obb 0755 root system + mkdir /mnt/media_rw 0750 root media_rw + mkdir /mnt/user 0755 root root + mkdir /mnt/user/0 0755 root root + mkdir /mnt/expand 0771 system system + mkdir /mnt/appfuse 0711 root root + + # Storage views to support runtime permissions + mkdir /storage 0755 root root + mkdir /mnt/runtime 0700 root root + mkdir /mnt/runtime/default 0755 root root + mkdir /mnt/runtime/default/self 0755 root root + mkdir /mnt/runtime/read 0755 root root + mkdir /mnt/runtime/read/self 0755 root root + mkdir /mnt/runtime/write 0755 root root + mkdir /mnt/runtime/write/self 0755 root root + + # Symlink to keep legacy apps working in multi-user world + symlink /storage/self/primary /sdcard + symlink /storage/self/primary /mnt/sdcard + symlink /mnt/user/0/primary /mnt/runtime/default/self/primary + + write /proc/sys/kernel/panic_on_oops 1 + write /proc/sys/kernel/hung_task_timeout_secs 0 + write /proc/cpu/alignment 4 + + # scheduler tunables + # Disable auto-scaling of scheduler tunables with hotplug. The tunables + # will vary across devices in unpredictable ways if allowed to scale with + # cpu cores. + write /proc/sys/kernel/sched_tunable_scaling 0 + write /proc/sys/kernel/sched_latency_ns 10000000 + write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000 + write /proc/sys/kernel/sched_child_runs_first 0 + + write /proc/sys/kernel/randomize_va_space 2 + write /proc/sys/vm/mmap_min_addr 32768 + write /proc/sys/net/ipv4/ping_group_range "0 2147483647" + write /proc/sys/net/unix/max_dgram_qlen 600 + write /proc/sys/kernel/sched_rt_runtime_us 950000 + write /proc/sys/kernel/sched_rt_period_us 1000000 + + # Assign reasonable ceiling values for socket rcv/snd buffers. + # These should almost always be overridden by the target per the + # the corresponding technology maximums. + write /proc/sys/net/core/rmem_max 262144 + write /proc/sys/net/core/wmem_max 262144 + + # reflect fwmark from incoming packets onto generated replies + write /proc/sys/net/ipv4/fwmark_reflect 1 + write /proc/sys/net/ipv6/fwmark_reflect 1 + + # set fwmark on accepted sockets + write /proc/sys/net/ipv4/tcp_fwmark_accept 1 + + # disable icmp redirects + write /proc/sys/net/ipv4/conf/all/accept_redirects 0 + write /proc/sys/net/ipv6/conf/all/accept_redirects 0 + + # /proc/net/fib_trie leaks interface IP addresses + chmod 0400 /proc/net/fib_trie + + # Create cgroup mount points for process groups + mkdir /dev/cpuctl + mount cgroup none /dev/cpuctl nodev noexec nosuid cpu + chown system system /dev/cpuctl + chown system system /dev/cpuctl/tasks + chmod 0666 /dev/cpuctl/tasks + write /dev/cpuctl/cpu.rt_period_us 1000000 + write /dev/cpuctl/cpu.rt_runtime_us 950000 + + # sets up initial cpusets for ActivityManager + mkdir /dev/cpuset + mount cpuset none /dev/cpuset nodev noexec nosuid + + # this ensures that the cpusets are present and usable, but the device's + # init.rc must actually set the correct cpus + mkdir /dev/cpuset/foreground + copy /dev/cpuset/cpus /dev/cpuset/foreground/cpus + copy /dev/cpuset/mems /dev/cpuset/foreground/mems + mkdir /dev/cpuset/background + copy /dev/cpuset/cpus /dev/cpuset/background/cpus + copy /dev/cpuset/mems /dev/cpuset/background/mems + + # system-background is for system tasks that should only run on + # little cores, not on bigs + # to be used only by init, so don't change system-bg permissions + mkdir /dev/cpuset/system-background + copy /dev/cpuset/cpus /dev/cpuset/system-background/cpus + copy /dev/cpuset/mems /dev/cpuset/system-background/mems + + # restricted is for system tasks that are being throttled + # due to screen off. + mkdir /dev/cpuset/restricted + copy /dev/cpuset/cpus /dev/cpuset/restricted/cpus + copy /dev/cpuset/mems /dev/cpuset/restricted/mems + + mkdir /dev/cpuset/top-app + copy /dev/cpuset/cpus /dev/cpuset/top-app/cpus + copy /dev/cpuset/mems /dev/cpuset/top-app/mems + + # change permissions for all cpusets we'll touch at runtime + chown system system /dev/cpuset + chown system system /dev/cpuset/foreground + chown system system /dev/cpuset/background + chown system system /dev/cpuset/system-background + chown system system /dev/cpuset/top-app + chown system system /dev/cpuset/restricted + chown system system /dev/cpuset/tasks + chown system system /dev/cpuset/foreground/tasks + chown system system /dev/cpuset/background/tasks + chown system system /dev/cpuset/system-background/tasks + chown system system /dev/cpuset/top-app/tasks + chown system system /dev/cpuset/restricted/tasks + + # set system-background to 0775 so SurfaceFlinger can touch it + chmod 0775 /dev/cpuset/system-background + + chmod 0664 /dev/cpuset/foreground/tasks + chmod 0664 /dev/cpuset/background/tasks + chmod 0664 /dev/cpuset/system-background/tasks + chmod 0664 /dev/cpuset/top-app/tasks + chmod 0664 /dev/cpuset/restricted/tasks + chmod 0664 /dev/cpuset/tasks + + + # qtaguid will limit access to specific data based on group memberships. + # net_bw_acct grants impersonation of socket owners. + # net_bw_stats grants access to other apps' detailed tagged-socket stats. + chown root net_bw_acct /proc/net/xt_qtaguid/ctrl + chown root net_bw_stats /proc/net/xt_qtaguid/stats + + # Allow everybody to read the xt_qtaguid resource tracking misc dev. + # This is needed by any process that uses socket tagging. + chmod 0644 /dev/xt_qtaguid + + mkdir /dev/cg2_bpf + mount cgroup2 cg2_bpf /dev/cg2_bpf nodev noexec nosuid + chown root root /dev/cg2_bpf + chmod 0600 /dev/cg2_bpf + mount bpf bpf /sys/fs/bpf nodev noexec nosuid + + # Create location for fs_mgr to store abbreviated output from filesystem + # checker programs. + mkdir /dev/fscklogs 0770 root system + + # pstore/ramoops previous console log + mount pstore pstore /sys/fs/pstore nodev noexec nosuid + chown system log /sys/fs/pstore/console-ramoops + chmod 0440 /sys/fs/pstore/console-ramoops + chown system log /sys/fs/pstore/console-ramoops-0 + chmod 0440 /sys/fs/pstore/console-ramoops-0 + chown system log /sys/fs/pstore/pmsg-ramoops-0 + chmod 0440 /sys/fs/pstore/pmsg-ramoops-0 + + # enable armv8_deprecated instruction hooks + write /proc/sys/abi/swp 1 + + # Linux's execveat() syscall may construct paths containing /dev/fd + # expecting it to point to /proc/self/fd + symlink /proc/self/fd /dev/fd + + export DOWNLOAD_CACHE /data/cache + + # set RLIMIT_NICE to allow priorities from 19 to -20 + setrlimit nice 40 40 + + # Allow up to 32K FDs per process + setrlimit nofile 32768 32768 + + # reset_reason + chown system system /proc/reset_reason + chmod 0600 /proc/reset_reason + chown system system /proc/reset_reason_extra_info + chmod 0600 /proc/reset_reason_extra_info + chown system system /proc/store_lastkmsg + chmod 0600 /proc/store_lastkmsg + chown system system /proc/auto_comment + chmod 0600 /proc/auto_comment + chown system system /proc/reset_rwc + chmod 0600 /proc/reset_rwc + chown system system /proc/debug_history + chmod 0600 /proc/debug_history + + # ap hw param data + chown system system /sys/class/sec/sec_hw_param/ap_info + chmod 0600 /sys/class/sec/sec_hw_param/ap_info + chown system system /sys/class/sec/sec_hw_param/ddr_info + chmod 0600 /sys/class/sec/sec_hw_param/ddr_info + chown system system /sys/class/sec/sec_hw_param/extra_info + chmod 0600 /sys/class/sec/sec_hw_param/extra_info + chown system system /sys/class/sec/sec_hw_param/extrb_info + chmod 0600 /sys/class/sec/sec_hw_param/extrb_info + chown system system /sys/class/sec/sec_hw_param/extrc_info + chmod 0600 /sys/class/sec/sec_hw_param/extrc_info + chown system system /sys/class/sec/sec_hw_param/extrm_info + chmod 0600 /sys/class/sec/sec_hw_param/extrm_info + chown system system /sys/class/sec/sec_hw_param/extrf_info + chmod 0600 /sys/class/sec/sec_hw_param/extrf_info + chown system radio /sys/class/sec/sec_hw_param/pcb_info + chmod 0660 /sys/class/sec/sec_hw_param/pcb_info + chown system radio /sys/class/sec/sec_hw_param/smd_info + chmod 0660 /sys/class/sec/sec_hw_param/smd_info + chown system system /sys/class/sec/sec_hw_param/thermal_info + + # eRR.p + chown system system /proc/pwrsrc + chmod 0600 /proc/pwrsrc + chown system system /proc/extra + chmod 0600 /proc/extra + + # This allows the ledtrig-transient properties to be created here so + # that they can be chown'd to system:system later on boot + write /sys/class/leds/vibrator/trigger "transient" + +# Healthd can trigger a full boot from charger mode by signaling this +# property when the power button is held. +on property:sys.boot_from_charger_mode=1 + class_stop charger + trigger late-init + +on load_persist_props_action + load_persist_props + start logd + start logd-reinit + +# Indicate to fw loaders that the relevant mounts are up. +on firmware_mounts_complete + rm /dev/.booting + +on post-fs + # Load properties from + # /system/build.prop, + # /odm/build.prop, + # /vendor/build.prop and + # /factory/factory.prop + load_system_props + # start essential services + start logd + start servicemanager + start hwservicemanager + start vndservicemanager + + # mobicore + setprop sys.mobicoredaemon.enable stopped + + # Once everything is setup, no need to modify /. + # The bind+ro combination avoids modifying any other mount flags. + mount rootfs rootfs / remount bind ro + # Mount shared so changes propagate into child namespaces + mount rootfs rootfs / shared rec + # Mount default storage into root namespace + mount none /mnt/runtime/default /storage bind rec + mount none none /storage slave rec + # Samsung ODE >>> + mount tmpfs tmpfs /mnt/secure private rec + # Samsung ODE <<< + + # VOLD for move to sdcard. + mount tmpfs tmpfs /mnt/secure/asec shared rec + + # Make sure /sys/kernel/debug (if present) is labeled properly + # Note that tracefs may be mounted under debug, so we need to cross filesystems + restorecon --recursive --cross-filesystems /sys/kernel/debug + + # We chown/chmod /cache again so because mount is run as root + defaults + chown system cache /cache + chmod 0770 /cache + # We restorecon /cache in case the cache partition has been reset. + restorecon_recursive /cache + + # Create /cache/recovery in case it's not there. It'll also fix the odd + # permissions if created by the recovery system. + mkdir /cache/recovery 0770 system cache + + # Backup/restore mechanism uses the cache partition + mkdir /cache/backup_stage 0700 system system + mkdir /cache/backup 0700 system system + + #change permissions on vmallocinfo so we can grab it from bugreports + chown root log /proc/vmallocinfo + chmod 0440 /proc/vmallocinfo + + chown root log /proc/slabinfo + chmod 0440 /proc/slabinfo + + # Bluetooth + chown root log /proc/bluetooth/uart/log + + #change permissions on kmsg & sysrq-trigger so bugreports can grab kthread stacks + chown root system /proc/kmsg + chmod 0440 /proc/kmsg + chown root system /proc/sysrq-trigger + chmod 0220 /proc/sysrq-trigger + chown system log /proc/last_kmsg + chmod 0440 /proc/last_kmsg + chown system log /proc/sec_log + + # make the selinux kernel policy world-readable + chmod 0444 /sys/fs/selinux/policy + + # create the lost+found directories, so as to enforce our permissions + mkdir /cache/lost+found 0770 root root + + # Samsung ODE. /metadata is needless. + # restorecon_recursive /metadata + # mkdir /metadata/vold + # chmod 0700 /metadata/vold + + # make fsdbg on /dev for filesystem debug info. + mkdir /dev/fsdbg 0775 root system + + start scs + +on late-fs + # Ensure that tracefs has the correct permissions. + # This does not work correctly if it is called in post-fs. + chmod 0755 /sys/kernel/debug/tracing + + # HALs required before storage encryption can get unlocked (FBE/FDE) + class_start early_hal + + # For kperfmond. + chown system log /data/log/remaining_olog + chmod 0440 /data/log/remaining_olog + +on post-fs-data + chmod 0755 /sys/kernel/debug/tracing + restorecon /sys/kernel/debug/tracing/trace_marker + + # We chown/chmod /data again so because mount is run as root + defaults + chown system system /data + chmod 0771 /data + # We restorecon /data in case the userdata partition has been reset. + restorecon /data + + chown system radio /efs + chmod 0771 /efs + restorecon /efs + + chown system system /carrier + chmod 0771 /carrier + restorecon /carrier + + chown system system /spu + chmod 0771 /spu + restorecon /spu + + chown system system /dqmdbg + chmod 0770 /dqmdbg + restorecon /dqmdbg + + # Samsung ODE + chown system system /keydata + chmod 0771 /keydata + restorecon /keydata + + chown system system /keyrefuge + chmod 0771 /keyrefuge + restorecon /keyrefuge + +# [ SEC_SELINUX_PORTING_COMMON + # sec_efs_file + mkdir /efs/sec_efs 0775 radio system +# ] SEC_SELINUX_PORTING_COMMON + + # mobicore + export MC_AUTH_TOKEN_PATH /efs + mkdir /efs/TEE 0770 radio system + chmod 0660 /dev/t-base-tui + chown system system /dev/t-base-tui + start mobicore + + # tzic + chown system net_bt_admin /dev/tzic + chmod 0660 /dev/tzic + + # SideSync DeXonPC P OS + chown system system /dev/android_ssusbcon + chmod 0660 /dev/android_ssusbcon + + # Stork Daemon socket + mkdir /dev/socket/stork 0770 system system + + # Start Stork Daemon + start storkd + + #start CASS + start cass + + # Make sure we have the device encryption key. + start vold + installkey /data + + # CAS key data + mkdir /data/.cas 0771 + chown media system /data/.cas + chmod 0771 /data/.cas + + # Start bootcharting as soon as possible after the data partition is + # mounted to collect more data. + mkdir /data/bootchart 0755 shell shell + bootchart start + + # Avoid predictable entropy pool. Carry over entropy from previous boot. + copy /data/system/entropy.dat /dev/urandom + + # barnswallow Daemon socket + mkdir /dev/socket/bsd 0770 system system + + # eRR.p + chown root system /efs/lpm_boot.log + chmod 0660 /efs/lpm_boot.log + + chown system system /efs/lpm/lpm_info.log + chmod 0660 /efs/lpm/lpm_info.log + + # create basic filesystem structure + mkdir /data/misc 01771 system misc + mkdir /data/misc/recovery 0770 system log + copy /data/misc/recovery/ro.build.fingerprint /data/misc/recovery/ro.build.fingerprint.1 + chmod 0440 /data/misc/recovery/ro.build.fingerprint.1 + chown system log /data/misc/recovery/ro.build.fingerprint.1 + write /data/misc/recovery/ro.build.fingerprint ${ro.build.fingerprint} + chmod 0440 /data/misc/recovery/ro.build.fingerprint + chown system log /data/misc/recovery/ro.build.fingerprint + mkdir /data/misc/recovery/proc 0770 system log + copy /data/misc/recovery/proc/version /data/misc/recovery/proc/version.1 + chmod 0440 /data/misc/recovery/proc/version.1 + chown system log /data/misc/recovery/proc/version.1 + copy /proc/version /data/misc/recovery/proc/version + chmod 0440 /data/misc/recovery/proc/version + chown system log /data/misc/recovery/proc/version + mkdir /data/misc/bluedroid 02770 bluetooth bluetooth + # Fix the access permissions and group ownership for 'bt_config.conf' + chmod 0660 /data/misc/bluedroid/bt_config.conf + chown bluetooth bluetooth /data/misc/bluedroid/bt_config.conf + mkdir /data/misc/bluetooth 0770 bluetooth bluetooth + mkdir /data/misc/bluetooth/logs 0770 bluetooth bluetooth + mkdir /data/log 0775 system log + mkdir /data/log/bt 0770 bluetooth bluetooth + mkdir /data/misc/keystore 0700 keystore keystore + mkdir /data/misc/gatekeeper 0700 system system + mkdir /data/misc/keychain 0771 system system + mkdir /data/misc/net 0750 root shell + mkdir /data/misc/radio 0770 system radio + mkdir /data/misc/sms 0770 system radio + mkdir /data/misc/carrierid 0770 system radio + mkdir /data/misc/apns 0770 system radio + mkdir /data/misc/zoneinfo 0775 system system + mkdir /data/misc/network_watchlist 0774 system system + mkdir /data/misc/textclassifier 0771 system system + mkdir /data/misc/vpn 0770 system vpn + mkdir /data/misc/shared_relro 0771 shared_relro shared_relro + mkdir /data/misc/systemkeys 0700 system system + mkdir /data/misc/ethernet 0770 system system + mkdir /data/misc/dhcp 0770 dhcp dhcp + mkdir /data/misc/user 0771 root root + mkdir /data/misc/perfprofd 0775 root root + mkdir /data/local 0751 root root + mkdir /data/local/dsms 0710 dsms dsms + rm /data/local/dsms/preboot.log + write /data/local/dsms/preboot.log "" + chown dsms dsms /data/local/dsms/preboot.log + chmod 0620 /data/local/dsms/preboot.log + mkdir /data/misc/media 0700 media media + mkdir /data/misc/audioserver 0700 audioserver audioserver + mkdir /data/misc/cameraserver 0700 cameraserver cameraserver + mkdir /data/misc/vold 0700 root root + mkdir /data/misc/boottrace 0771 system shell + mkdir /data/misc/update_engine 0700 root root + mkdir /data/misc/update_engine_log 02750 root log + mkdir /data/misc/trace 0700 root root + # create location to store surface and window trace files + mkdir /data/misc/wmtrace 0700 system system + # profile file layout + mkdir /data/misc/profiles 0771 system system + mkdir /data/misc/profiles/cur 0771 system system + mkdir /data/misc/profiles/ref 0771 system system + mkdir /data/misc/profman 0770 system shell + mkdir /data/misc/gcov 0770 root root + + #lpnetConfig AppSync + mkdir /data/misc/lpnet 0700 system system + + #MCPS + #ARGOS with MCPS + chown system system /sys/module/modem_argos_notifier/parameters/big_clat_rps + chown system system /sys/module/modem_argos_notifier/parameters/big_rmnet_clat_rps + chown system system /sys/module/modem_argos_notifier/parameters/big_rmnet_rps + chown system system /sys/module/modem_argos_notifier/parameters/lit_clat_rps + chown system system /sys/module/modem_argos_notifier/parameters/lit_rmnet_clat_rps + chown system system /sys/module/modem_argos_notifier/parameters/lit_rmnet_rps + chown system system /sys/module/modem_argos_notifier/parameters/mif_rps_thresh + chown system system /sys/module/mcps/parameters/mcps_arps_activate_pps_threshold + chown system system /sys/module/mcps/parameters/mcps_arps_config + chown system system /sys/module/mcps/parameters/mcps_arps_cpu + chown system system /sys/module/mcps/parameters/mcps_big2lit_load_thresh + chown system system /sys/module/mcps/parameters/mcps_big2lit_pps_thresh + chown system system /sys/module/mcps/parameters/mcps_dynamic_cpu + chown system system /sys/module/mcps/parameters/mcps_enable + chown system system /sys/module/mcps/parameters/mcps_flush + chown system system /sys/module/mcps/parameters/mcps_gro_flush_time + chown system system /sys/module/mcps/parameters/mcps_gro_pantry_max_capability + chown system system /sys/module/mcps/parameters/mcps_gro_pantry_quota + chown system system /sys/module/mcps/parameters/mcps_heavy_flows + chown system system /sys/module/mcps/parameters/mcps_lit2big_load_thresh + chown system system /sys/module/mcps/parameters/mcps_lit2big_pps_thresh + chown system system /sys/module/mcps/parameters/mcps_light_flows + chown system system /sys/module/mcps/parameters/mcps_mode + chown system system /sys/module/mcps/parameters/mcps_move + chown system system /sys/module/mcps/parameters/mcps_oamask_util_threshold + chown system system /sys/module/mcps/parameters/mcps_pantry_max_capability + chown system system /sys/module/mcps/parameters/mcps_pantry_quota + chown system system /sys/module/mcps/parameters/mcps_print_BBB + chown system system /sys/module/mcps/parameters/mcps_rfs_buckets + chown system system /sys/module/mcps/parameters/mcps_rps_config + chown system system /sys/module/mcps/parameters/mcps_set_cluster_for_hotplug + chown system system /sys/module/mcps/parameters/mcps_set_cluster_for_newflow + chown system system /sys/module/mcps/parameters/mcps_stat_distributed + chown system system /sys/module/mcps/parameters/mcps_stat_dropped + chown system system /sys/module/mcps/parameters/mcps_stat_enqueued + chown system system /sys/module/mcps/parameters/mcps_stat_ignored + chown system system /sys/module/mcps/parameters/mcps_stat_processed + chown system system /sys/module/mcps/parameters/mcps_stat_sauron_flow + chown system system /sys/module/mcps/parameters/mcps_stat_sauron_target_flow + chown system system /sys/module/mcps/parameters/num_mcps_dev + chown system system /sys/module/mcps/version + + # [ Wi-Fi init + # Create directory for hostapd + mkdir /data/hostapd 0770 system wifi + + # give system access to wpa_supplicant.conf for backup and restore + mkdir /data/misc/wifi 0770 wifi system + mkdir /data/misc/wifi_share_profile 0771 wifi system + mkdir /data/misc/wifi_hostapd 0771 wifi system + + mkdir /data/log/wifi/ 0775 system root + mkdir /data/misc/dhcp 0775 dhcp dhcp + mkdir /data/misc/reboot 0700 system system + chown dhcp dhcp /data/misc/dhcp + chown system system /sys/kernel/ipv4/tcp_delack_seg + + # Wi-Fi temporary log Directory for Android Global DE policy + mkdir /data/wifi/ 0770 system root + + # for WIFI Antenna + write /data/misc/conn/.wificable.info E + chown system root /data/misc/conn/.wificable.info + chmod 0666 /data/misc/conn/.wificable.info + + # Permissions for Filesystem + # change owner f2fs bigdata node for hqm write + chown system system /sys/fs/f2fs/userdata/sec_gc_stat + chown system system /sys/fs/f2fs/userdata/sec_io_stat + chown system system /sys/fs/f2fs/userdata/sec_fsck_stat + + # change owner background io bigdata node for hqm write + chown system system /sys/fs/fsio/bgiostat/sec_stat + +# [ SEC_PRODUCT_FEATURE_SECURITY_SUPPORT_FIVE + mkdir /data/misc/integrity 0775 vendor_audit system +# ] SEC_PRODUCT_FEATURE_SECURITY_SUPPORT_FIVE + +# [ SEC_SELINUX_PORTING_COMMON + mkdir /data/misc/audit 0775 system system + chown vendor_audit vendor_audit /data/misc/audit/audit.log + chown vendor_audit vendor_audit /data/misc/audit/audit.old + + # arcounter + mkdir /data/misc/arcounter 0700 system system + + # start auditd + start auditd +# ] SEC_SELINUX_PORTING_COMMON + +# [ SEC_AASA_ASKS_PORTING + # Seperate location for storing security policy files on data + mkdir /data/security 0701 system system +# ] SEC_AASA_ASKS_PORTING + + mkdir /data/vendor 0771 root root + mkdir /data/vendor_ce 0771 root root + mkdir /data/vendor_de 0771 root root + mkdir /data/vendor/hardware 0771 root root + + # create mediacodec folder + mkdir /data/vendor/media 0770 mediacodec mediacodec + + # For security reasons, /data/local/tmp should always be empty. + # Do not place files or directories in /data/local/tmp + mkdir /data/local/tmp 0771 shell shell + mkdir /data/local/traces 0777 shell shell + mkdir /data/data 0771 system system + mkdir /data/app-private 0771 system system + mkdir /data/app-ephemeral 0771 system system + mkdir /data/app-asec 0700 root root + mkdir /data/app-lib 0771 system system + mkdir /data/app 0771 system system + mkdir /data/property 0700 root root + mkdir /data/tombstones 0771 system system + mkdir /data/vendor/tombstones 0771 root root + mkdir /data/vendor/tombstones/wifi 0771 wifi wifi + + # create dalvik-cache, so as to enforce our permissions + mkdir /data/dalvik-cache 0771 root root + # create the A/B OTA directory, so as to enforce our permissions + mkdir /data/ota 0771 root root + + # create the OTA package directory. It will be accessed by GmsCore (cache + # group), update_engine and update_verifier. + mkdir /data/ota_package 0770 system cache + + # create resource-cache and double-check the perms + mkdir /data/resource-cache 0771 system system + chown system system /data/resource-cache + chmod 0771 /data/resource-cache + + # create the lost+found directories, so as to enforce our permissions + mkdir /data/lost+found 0770 root root + + # create directory for DRM plug-ins - give drm the read/write access to + # the following directory. + mkdir /data/drm 0770 drm drm + + # create directory for MediaDrm plug-ins - give drm the read/write access to + # the following directory. + mkdir /data/mediadrm 0770 mediadrm mediadrm + + mkdir /data/anr 0775 system system + + # Samsung Pay + # mkdir /efs/pfw_data 0760 spay spay + + # Linux On Dex + mkdir /data/lxd 0770 root vendor_lod + + # MST/NFC Switch + # chown spay system /dev/mst_ctrl + # chmod 0660 /dev/mst_ctrl + + # MST Factory Test + chown system system /sys/class/mstldo/mst_drv/transmit + chmod 0770 /sys/class/mstldo/mst_drv/transmit + + # MST-MFC Support + chown system system /sys/class/mstldo/mst_drv/mfc + chmod 0770 /sys/class/mstldo/mst_drv/mfc + + # MST Check Support + chown system system /sys/class/mstldo/mst_drv/support + chmod 0444 /sys/class/mstldo/mst_drv/support + + # Downloadable Filter + mkdir /data/DownFilters 0775 system system + mkdir /data/DownFilters/Lib 0775 system system + mkdir /data/DownFilters/Lib64 0775 system system + mkdir /data/DownFilters/Res 0775 system system + mkdir /data/DownFilters/Tex 0775 system system + + # Open Theme + mkdir /data/overlays 0745 system system + + # NFC: create data/nfc for nv storage + mkdir /data/nfc 0770 nfc nfc + mkdir /data/nfc/param 0770 nfc nfc + + # NFC: create /efs/sec_efs/nfc and /efs/nfc for nv storage + mkdir /efs/sec_efs/nfc 0700 nfc nfc + mkdir /efs/nfc 0700 nfc nfc + + # NFC KEY + mkdir /data/vendor/nfc 0770 nfc nfc + mkdir /data/nfc_log 0750 nfc system + copy /system/etc/nfc_key /data/nfc/Key + chmod 660 /data/nfc/Key + chown nfc nfc /data/nfc/Key + + # Create all remaining /data root dirs so that they are made through init + # and get proper encryption policy installed + mkdir /data/backup 0700 system system + mkdir /data/ss 0700 system system + + # TAD + mkdir /data/tad 0770 system system + + # FIDO + mkdir /data/.fido 0700 system system + + mkdir /data/system 0775 system system + mkdir /data/system/heapdump 0700 system system + mkdir /data/system/users 0775 system system + + mkdir /data/system_de 0770 system system + mkdir /data/system_ce 0770 system system + + mkdir /data/misc_de 01771 system misc + mkdir /data/misc_ce 01771 system misc + + mkdir /data/user 0711 system system + mkdir /data/user_de 0711 system system + symlink /data/data /data/user/0 + + mkdir /data/media 0770 media_rw media_rw + mkdir /data/media/obb 0770 media_rw media_rw + + mkdir /data/cache 0770 system cache + mkdir /data/cache/recovery 0770 system cache + mkdir /data/cache/backup_stage 0700 system system + mkdir /data/cache/backup 0700 system system + + # Samsung font + mkdir /data/app_fonts 0775 system system + + init_user0 + + # Set SELinux security contexts on upgrade or policy update. + restorecon --recursive --skip-ce /data + + # Check any timezone data in /data is newer than the copy in /system, delete if not. + exec - system system -- /system/bin/tzdatacheck /system/usr/share/zoneinfo /data/misc/zoneinfo + + # smart switch mobile + mkdir /efs/ssm 0770 system system + +# Magnetic sensor YAS539 lib + mkdir /data/vendor/yas_lib 0770 system system + + # super slow motion + mkdir /data/vendor/mediacodec 0700 mediacodec mediacodec + mkdir /data/vendor/mediacodec/fruc_files 0700 mediacodec mediacodec + mkdir /data/vendor/mediacodec/fruc_assets 0700 mediacodec mediacodec + copy /system/media/fruc_kernels.s9.slsi.bin /data/vendor/mediacodec/fruc_assets/fruc_kernels.s9.slsi.bin + copy /system/media/fruc_kernels.exynos9820.bin /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos9820.bin + copy /system/media/fruc_kernels.exynos9610.bin /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos9610.bin + copy /system/media/fruc_kernels.exynos7885.bin /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos7885.bin + chown mediacodec mediacodec /data/vendor/mediacodec/fruc_assets/fruc_kernels.s9.slsi.bin + chown mediacodec mediacodec /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos9820.bin + chown mediacodec mediacodec /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos9610.bin + chown mediacodec mediacodec /data/vendor/mediacodec/fruc_assets/fruc_kernels.exynos7885.bin + + # FINGERPRINT + mkdir /data/vendor/biometrics 0770 system system + mkdir /data/vendor/fpSnrTest 0770 system system + restorecon_recursive /data/vendor/biometrics + + # If there is no post-fs-data action in the init..rc file, you + # must uncomment this line, otherwise encrypted filesystems + # won't work. + # Set indication (checked by vold) that we have finished this action + #setprop vold.post_fs_data_done 1 + +on boot + # basic network init + ifup lo + hostname localhost + domainname localdomain + + # IPsec SA default expiration length + write /proc/sys/net/core/xfrm_acq_expires 3600 + + # MSP: FactoryApp directory generation + mkdir /efs/FactoryApp 0775 system system + + mkdir /efs/afc 0700 system system + + # sec abc + chown system radio /sys/class/sec/sec_abc/enabled + chmod 0664 /sys/class/sec/sec_abc/enabled + chown system radio /sys/class/sec/sec_abc/log + chmod 0664 /sys/class/sec/sec_abc/log + chown system radio /sys/class/sec/sec_abc_hub/enable + chmod 0664 /sys/class/sec/sec_abc_hub/enable + chown system radio /sys/class/sec/sec_abc_hub/bootc_offset + chmod 0664 /sys/class/sec/sec_abc_hub/bootc_offset + + # labo + chown system radio /sys/class/sec/sec_labo/cmd + chmod 0664 /sys/class/sec/sec_labo/cmd + + # Memory management. Basic kernel parameters, and allow the high + # level system server to be able to adjust the kernel OOM driver + # parameters to match how it is managing things. + write /proc/sys/vm/overcommit_memory 1 + write /proc/sys/vm/min_free_order_shift 4 + chown root system /sys/module/lowmemorykiller/parameters/adj + chmod 0664 /sys/module/lowmemorykiller/parameters/adj + chown root system /sys/module/lowmemorykiller/parameters/minfree + chmod 0664 /sys/module/lowmemorykiller/parameters/minfree + chmod 0664 /sys/kernel/mm/vmscan/am_app_launch + chown system system /sys/kernel/mm/vmscan/am_app_launch + + # terminal mode + chmod 0660 /sys/class/android_usb/android0/terminal_version + chown system system /sys/class/android_usb/android0/terminal_version + + # Tweak background writeout + write /proc/sys/vm/dirty_expire_centisecs 200 + # write /proc/sys/vm/dirty_background_ratio 5 + + # Permissions for recovery_cause + chown system system /sys/class/sec/sec_debug/recovery_cause + + # Permissions for fmm_lock + chown system system /sys/class/sec/sec_debug/FMM_lock + + # Permissions for pwdt + chown system system /sys/module/sec_debug/parameters/pwdt_start_ms + chmod 0660 /sys/module/sec_debug/parameters/pwdt_start_ms + chown system system /sys/module/sec_debug/parameters/pwdt_end_ms + chmod 0660 /sys/module/sec_debug/parameters/pwdt_end_ms + chown system system /sys/module/sec_debug/parameters/pwdt_pid + chmod 0660 /sys/module/sec_debug/parameters/pwdt_pid + chown system system /sys/module/sec_debug/parameters/pwdt_sync_cnt + chmod 0660 /sys/module/sec_debug/parameters/pwdt_sync_cnt + + # svcled + chown system system /sys/class/sec/led/led_lowpower + chown system system /sys/class/sec/led/led_pattern + chown system system /sys/class/sec/led/led_blink + chown system system /sys/class/sec/led/led_control + chown system system /sys/class/sec/led/led_r + chown system system /sys/class/sec/led/led_g + chown system system /sys/class/sec/led/led_b + + # Switch Device + chown system radio /sys/class/sec/switch/usb_sel + chown system radio /sys/class/sec/switch/uart_sel + chown system radio /sys/class/sec/switch/uart_en + chown system radio /sys/class/sec/switch/otg_test + chown system radio /sys/class/sec/switch/apo_factory + chown system radio /sys/class/sec/switch/afc_disable + chown system radio /sys/class/sec/switch/hiccup + chown system radio /sys/class/sec/switch/jig_disable + chown system radio /sys/class/sec/switch/factory_uart + + # OTG Test + chown system radio /sys/class/host_notify/usb_otg/booster + chmod 0664 /sys/class/host_notify/usb_otg/booster + + # Permission for CCIC + chown system radio /sys/class/sec/ccic/lpm_mode + chmod 0664 /sys/class/sec/ccic/lpm_mode + chown system system /sys/class/sec/ccic/control_gpio + chmod 0660 /sys/class/sec/ccic/control_gpio + chown system radio /sys/class/sec/ccic/fw_update + chmod 0220 /sys/class/sec/ccic/fw_update + chown system radio /sys/class/sec/ccic/role_swap + chmod 0220 /sys/class/sec/ccic/role_swap + chown system usb /sys/class/sec/ccic/dex_fan_uvdm + chown system usb /sys/class/sec/ccic/samsung_uvdm + chown system radio /sys/class/sec/ccic/ccic_control_option + chown system usb /dev/ccic_misc + chmod 0664 /dev/ccic_misc + chown system radio /sys/class/sec/ccic/cc_sbu_adc + chown system radio /sys/class/sec/ccic/vsafe0v_status + chmod 0444 /sys/class/sec/ccic/vsafe0v_status + + # usb disable + chown system usb /sys/class/usb_notify/usb_control/disable + chmod 0664 /sys/class/usb_notify/usb_control/disable + + # usb hw param + chown system usb /sys/class/usb_notify/usb_control/usb_hw_param + chmod 0664 /sys/class/usb_notify/usb_control/usb_hw_param + chown system usb /sys/class/usb_notify/usb_control/hw_param + chmod 0664 /sys/class/usb_notify/usb_control/hw_param + + # usb whitelist + chown system usb /sys/class/usb_notify/usb_control/whitelist_for_mdm + chmod 0664 /sys/class/usb_notify/usb_control/whitelist_for_mdm + + # ccic UVDM permission + chown system usb /dev/ccic_misc + chmod 0664 /dev/ccic_misc + + # Permissions for System Server and daemons. + chown radio system /sys/android_power/state + chown radio system /sys/android_power/request_state + chown radio system /sys/android_power/acquire_full_wake_lock + chown radio system /sys/android_power/acquire_partial_wake_lock + chown radio system /sys/android_power/release_wake_lock + chown system system /sys/power/autosleep + chown system system /sys/power/state + chown system system /sys/power/wakeup_count + chown radio wakelock /sys/power/wake_lock + chown radio wakelock /sys/power/wake_unlock + chmod 0660 /sys/power/state + chmod 0660 /sys/power/wake_lock + chmod 0660 /sys/power/wake_unlock + + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/boost + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration + chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + + # Assume SMP uses shared cpufreq policy for all CPUs + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + + # Permission for DVFS helper + chown system radio /sys/power/cpufreq_min_limit + chmod 0664 /sys/power/cpufreq_min_limit + chown system radio /sys/power/cpufreq_max_limit + chmod 0664 /sys/power/cpufreq_max_limit + + # permission for CHARGING + mkdir /efs/Battery 0775 radio system + chown radio system /efs/Battery + chmod 0775 /efs/Battery + copy /system/vendor/firmware/battery_data.dat /efs/Battery/battery_data.dat + chmod 0400 /efs/Battery/battery_data.dat + write /sys/class/power_supply/battery/batt_update_data "/efs/Battery/battery_data.dat" + chown system radio /sys/class/power_supply/battery/batt_ext_dev_chg + chown system radio /efs/Battery/fg_full_voltage + chown system radio /sys/class/power_supply/battery/fg_full_voltage + chown system radio /sys/class/power_supply/battery/batt_self_discharging_control + chown system radio /sys/class/power_supply/battery/batt_inbat_wireless_cs100 + chown system radio /sys/class/power_supply/battery/batt_swelling_control + chown system radio /sys/class/power_supply/battery/batt_temp_control_test + chmod 0664 /efs/Battery/fg_full_voltage + chmod 0664 /sys/class/power_supply/battery/fg_full_voltage + chown system radio /sys/class/power_supply/battery/batt_reset_soc + chown system radio /sys/class/power_supply/battery/batt_slate_mode + chown system radio /sys/class/power_supply/battery/factory_mode + chown system radio /sys/class/power_supply/battery/siop_level + chown system radio /sys/class/power_supply/battery/siop_event + chown system radio /sys/class/power_supply/battery/batt_temp + chown system radio /sys/class/power_supply/battery/wc_enable + chown system nfc /sys/class/power_supply/battery/wc_control + chown system nfc /sys/class/power_supply/battery/wc_control_cnt + chown system nfc /sys/class/power_supply/battery/led_cover + chown system radio /sys/class/power_supply/battery/update + chown system radio /sys/class/power_supply/battery/batt_wdt_control + chown system radio /sys/class/power_supply/battery/factory_mode_relieve + chown system radio /sys/class/power_supply/battery/factory_mode_bypass + chown system radio /sys/class/power_supply/battery/normal_mode_bypass + chown system radio /sys/class/power_supply/battery/factory_voltage_regulation + chown system radio /sys/class/power_supply/battery/factory_mode_disable + chown system sdcard_rw /sys/class/power_supply/battery/store_mode + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/call + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/video + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/music + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/browser + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/hotspot + chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/camera + chown system radio /sys/class/power_supply/battery/talk_wcdma + chown system radio /sys/class/power_supply/battery/talk_gsm + chown system radio /sys/class/power_supply/battery/call + chown system radio /sys/class/power_supply/battery/data_call + chown system radio /sys/class/power_supply/battery/gps + chown system radio /sys/class/power_supply/battery/wifi + chown system radio /sys/class/power_supply/battery/lte + chown system radio /sys/class/power_supply/battery/lcd + chown system radio /sys/class/power_supply/ps/status + chmod 0664 /sys/class/power_supply/battery/wc_control + chmod 0664 /sys/class/power_supply/battery/wc_control_cnt + chmod 0664 /sys/class/power_supply/battery/led_cover + chmod 0664 /sys/class/power_supply/ps/status + chmod 0664 /sys/class/power_supply/battery/batt_temp_table + chown system radio /sys/class/power_supply/battery/batt_temp_table + chown system radio /sys/class/power_supply/battery/batt_high_current_usb + chown system radio /sys/class/power_supply/battery/batt_inbat_voltage + chmod 0664 /sys/class/power_supply/battery/batt_high_current_usb + chown system radio /sys/class/power_supply/battery/hmt_ta_connected + chown system radio /sys/class/power_supply/battery/hmt_ta_charge + chown system radio /sys/class/power_supply/battery/battery_cycle + chown system radio /sys/class/power_supply/battery/batt_after_manufactured + chown system radio /sys/class/power_supply/otg/online + chmod 0664 /sys/class/power_supply/otg/online + chown system radio /sys/class/power_supply/max77833-charger/charge_otg_control + chown system radio /sys/class/power_supply/battery/charge_otg_control + chown system radio /sys/class/power_supply/battery/charge_uno_control + chown system radio /sys/class/power_supply/battery/batt_wireless_firmware_update + chown system radio /sys/class/power_supply/battery/otp_firmware_result + chown system radio /sys/class/power_supply/battery/wc_ic_grade + chown system radio /sys/class/power_supply/battery/wc_ic_chip_id + chown system radio /sys/class/power_supply/battery/otp_firmware_ver_bin + chown system radio /sys/class/power_supply/battery/otp_firmware_ver + chown system radio /sys/class/power_supply/battery/tx_firmware_result + chown system radio /sys/class/power_supply/battery/batt_tx_firmware + chown system radio /sys/class/power_supply/battery/batt_hv_wireless_status + chown system radio /sys/class/power_supply/battery/batt_hv_wireless_pad_ctrl + chmod 0664 /sys/class/power_supply/max77833-charger/charge_otg_control + chmod 0664 /sys/class/power_supply/battery/charge_otg_control + chmod 0664 /sys/class/power_supply/battery/charge_uno_control + chmod 0664 /sys/class/power_supply/battery/batt_wireless_firmware_update + chmod 0664 /sys/class/power_supply/battery/otp_firmware_result + chmod 0664 /sys/class/power_supply/battery/wc_ic_grade + chmod 0664 /sys/class/power_supply/battery/wc_ic_chip_id + chmod 0664 /sys/class/power_supply/battery/otp_firmware_ver_bin + chmod 0664 /sys/class/power_supply/battery/otp_firmware_ver + chmod 0664 /sys/class/power_supply/battery/tx_firmware_result + chmod 0664 /sys/class/power_supply/battery/tx_firmware_ver + chmod 0664 /sys/class/power_supply/battery/batt_tx_firmware + chmod 0664 /sys/class/power_supply/battery/batt_hv_wireless_status + chmod 0664 /sys/class/power_supply/battery/batt_hv_wireless_pad_ctrl + chown system radio /sys/class/power_supply/battery/tx_firmware_result + chown system radio /sys/class/power_supply/battery/batt_tune_chg_limit_cur + chown system radio /sys/class/power_supply/battery/batt_tune_chg_temp_high + chown system radio /sys/class/power_supply/battery/batt_tune_chg_temp_rec + chown system radio /sys/class/power_supply/battery/batt_tune_coil_limit_cur + chown system radio /sys/class/power_supply/battery/batt_tune_coil_temp_high + chown system radio /sys/class/power_supply/battery/batt_tune_coil_temp_rec + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_temp_high + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_temp_high_rec + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_batt_temp_high + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_batt_temp_high_rec + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_limit_input_cur + chown system radio /sys/class/power_supply/battery/batt_tune_dchg_limit_chg_cur + chown system radio /sys/class/power_supply/battery/batt_tune_wpc_temp_high + chown system radio /sys/class/power_supply/battery/batt_tune_wpc_temp_high_rec + chown system radio /sys/class/power_supply/battery/batt_tune_fast_charge_current + chown system radio /sys/class/power_supply/battery/batt_tune_float_voltage + chown system radio /sys/class/power_supply/battery/batt_tune_intput_charge_current + chown system radio /sys/class/power_supply/battery/batt_tune_temp_high_event + chown system radio /sys/class/power_supply/battery/batt_tune_temp_high_normal + chown system radio /sys/class/power_supply/battery/batt_tune_temp_high_rec_event + chown system radio /sys/class/power_supply/battery/batt_tune_temp_high_rec_normal + chown system radio /sys/class/power_supply/battery/batt_tune_temp_low_event + chown system radio /sys/class/power_supply/battery/batt_tune_temp_low_normal + chown system radio /sys/class/power_supply/battery/batt_tune_temp_low_rec_event + chown system radio /sys/class/power_supply/battery/batt_tune_temp_low_rec_normal + chown system radio /sys/class/power_supply/battery/batt_tune_ui_term_cur_1st + chown system radio /sys/class/power_supply/battery/batt_tune_ui_term_cur_2nd + chown system radio /sys/class/power_supply/battery/batt_misc_event + chown system radio /sys/class/power_supply/battery/batt_tx_event + chmod 0664 /sys/class/power_supply/battery/batt_tune_chg_limit_cur + chmod 0664 /sys/class/power_supply/battery/batt_tune_chg_temp_high + chmod 0664 /sys/class/power_supply/battery/batt_tune_chg_temp_rec + chmod 0664 /sys/class/power_supply/battery/batt_tune_coil_limit_cur + chmod 0664 /sys/class/power_supply/battery/batt_tune_coil_temp_high + chmod 0664 /sys/class/power_supply/battery/batt_tune_coil_temp_rec + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_temp_high + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_temp_high_rec + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_batt_temp_high + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_batt_temp_high_rec + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_limit_input_cur + chmod 0664 /sys/class/power_supply/battery/batt_tune_dchg_limit_chg_cur + chmod 0664 /sys/class/power_supply/battery/batt_tune_wpc_temp_high + chmod 0664 /sys/class/power_supply/battery/batt_tune_wpc_temp_high_rec + chmod 0664 /sys/class/power_supply/battery/batt_tune_fast_charge_current + chmod 0664 /sys/class/power_supply/battery/batt_tune_float_voltage + chmod 0664 /sys/class/power_supply/battery/batt_tune_intput_charge_current + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_high_event + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_high_normal + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_high_rec_event + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_high_rec_normal + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_low_event + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_low_normal + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_low_rec_event + chmod 0664 /sys/class/power_supply/battery/batt_tune_temp_low_rec_normal + chmod 0664 /sys/class/power_supply/battery/batt_tune_ui_term_cur_1st + chmod 0664 /sys/class/power_supply/battery/batt_tune_ui_term_cur_2nd + chmod 0664 /sys/class/power_supply/battery/batt_misc_event + chmod 0664 /sys/class/power_supply/battery/batt_tx_event + chown system radio /sys/class/power_supply/battery/batt_filter_cfg + chown system radio /sys/class/power_supply/battery/batt_current_ua_avg + chown system radio /sys/class/power_supply/battery/batt_current_ua_now + chown system radio /sys/class/power_supply/battery/voltage_avg + chown system radio /sys/class/power_supply/battery/voltage_now + chown system radio /sys/class/power_supply/battery/mode + chown system radio /sys/class/power_supply/battery/safety_timer_set + chown system radio /sys/class/power_supply/battery/safety_timer_info + chmod 0664 /sys/class/power_supply/battery/mode + chown system radio /sys/class/power_supply/battery/wc_op_freq + chmod 0664 /sys/class/power_supply/battery/wc_op_freq + chown system radio /sys/class/power_supply/battery/wc_cmd_info + chmod 0664 /sys/class/power_supply/battery/wc_cmd_info + chown system radio /sys/class/power_supply/battery/batt_chip_id + chmod 0660 /sys/class/power_supply/battery/batt_chip_id + chown system radio /sys/class/power_supply/battery/error_cause + chmod 0440 /sys/class/power_supply/battery/error_cause + chown system radio /sys/class/power_supply/battery/cisd_fullcaprep_max + chmod 0660 /sys/class/power_supply/battery/cisd_fullcaprep_max + chown system radio /sys/class/power_supply/battery/cisd_wire_count + chmod 0660 /sys/class/power_supply/battery/cisd_wire_count + chown system radio /sys/class/power_supply/battery/batt_type + chmod 0660 /sys/class/power_supply/battery/batt_type + chown system radio /sys/class/power_supply/battery/cisd_data + chmod 0660 /sys/class/power_supply/battery/cisd_data + chown system radio /sys/class/power_supply/battery/cisd_data_json + chmod 0660 /sys/class/power_supply/battery/cisd_data_json + chown system radio /sys/class/power_supply/battery/cisd_data_d_json + chmod 0660 /sys/class/power_supply/battery/cisd_data_d_json + chown system system /efs/FactoryApp/cisd_fullcaprep_max + chmod 0640 /efs/FactoryApp/cisd_fullcaprep_max + chown system radio /sys/class/power_supply/battery/cisd_data_efs_path + chmod 0660 /sys/class/power_supply/battery/cisd_data_efs_path + chown system system /efs/FactoryApp/cisd_data + chmod 0660 /efs/FactoryApp/cisd_data + chown system radio /sys/class/power_supply/battery/cisd_wc_data + chmod 0660 /sys/class/power_supply/battery/cisd_wc_data + chown system radio /sys/class/power_supply/battery/cisd_wc_data_json + chmod 0660 /sys/class/power_supply/battery/cisd_wc_data_json + chown system system /efs/FactoryApp/cisd_wc_data + chmod 0660 /efs/FactoryApp/cisd_wc_data + chown system radio /sys/class/power_supply/battery/cisd_power_data + chmod 0660 /sys/class/power_supply/battery/cisd_power_data + chown system radio /sys/class/power_supply/battery/cisd_power_data_json + chmod 0660 /sys/class/power_supply/battery/cisd_power_data_json + chown system system /efs/FactoryApp/cisd_power_data + chmod 0660 /efs/FactoryApp/cisd_power_data + chown system radio /sys/class/power_supply/battery/cisd_cable_data + chmod 0660 /sys/class/power_supply/battery/cisd_cable_data + chown system radio /sys/class/power_supply/battery/cisd_cable_data_json + chmod 0660 /sys/class/power_supply/battery/cisd_cable_data_json + chown system system /efs/FactoryApp/cisd_cable_data + chmod 0660 /efs/FactoryApp/cisd_cable_data + chown system radio /sys/class/power_supply/battery/cisd_tx_data + chmod 0660 /sys/class/power_supply/battery/cisd_tx_data + chown system radio /sys/class/power_supply/battery/cisd_tx_data_json + chmod 0660 /sys/class/power_supply/battery/cisd_tx_data_json + chown system system /efs/FactoryApp/cisd_tx_data + chmod 0660 /efs/FactoryApp/cisd_tx_data + chown system radio /sys/class/power_supply/battery/batt_capacity_max + chmod 0660 /sys/class/power_supply/battery/batt_capacity_max + chown system system /efs/Battery/batt_capacity_max + chmod 0660 /efs/Battery/batt_capacity_max + chown system system /efs/FactoryApp/batt_after_manufactured + chmod 0640 /efs/FactoryApp/batt_after_manufactured + chown system system /efs/FactoryApp/batt_discharge_level + chmod 0640 /efs/FactoryApp/batt_discharge_level + chown system radio /sys/class/power_supply/battery/wc_tx_en + chmod 0664 /sys/class/power_supply/battery/wc_tx_en + chown system system /dev/batt_misc + chmod 0664 /dev/batt_misc + chown system radio /sys/class/power_supply/battery/wc_tx_stop_capacity + chmod 0664 /sys/class/power_supply/battery/wc_tx_stop_capacity + chown system radio /sys/class/power_supply/battery/wc_tx_vout + chmod 0664 /sys/class/power_supply/battery/wc_tx_vout + chown system radio /sys/class/power_supply/battery/batt_tx_status + chmod 0664 /sys/class/power_supply/battery/batt_tx_status + chown system radio /sys/class/power_supply/battery/wc_rx_connected + chmod 0660 /sys/class/power_supply/battery/wc_rx_connected + chown system radio /sys/class/power_supply/battery/wc_tx_mfc_vin_from_uno + chmod 0660 /sys/class/power_supply/battery/wc_tx_mfc_vin_from_uno + chown system radio /sys/class/power_supply/battery/wc_tx_mfc_iin_from_uno + chmod 0660 /sys/class/power_supply/battery/wc_tx_mfc_iin_from_uno + chown system radio /sys/class/power_supply/battery/wc_tx_avg_curr + chmod 0660 /sys/class/power_supply/battery/wc_tx_avg_curr + chown system radio /sys/class/power_supply/battery/wc_tx_total_pwr + chmod 0660 /sys/class/power_supply/battery/wc_tx_total_pwr + chown system radio /sys/class/power_supply/battery/wc_tx_id + chmod 0664 /sys/class/power_supply/battery/wc_tx_id + chown system radio /sys/class/power_supply/battery/wc_auth_adt_sent + chmod 0660 /sys/class/power_supply/battery/wc_auth_adt_sent + chown system radio /sys/class/power_supply/battery/wc_duo_rx_power + chmod 0660 /sys/class/power_supply/battery/wc_duo_rx_power + chown system radio /sys/class/power_supply/battery/ext_event + chmod 0660 /sys/class/power_supply/battery/ext_event + chown system system /sys/class/power_supply/battery/batt_shipmode_test + chmod 0664 /sys/class/power_supply/battery/batt_shipmode_test + chown system system /sys/class/power_supply/battery/batt_jig_gpio + chmod 0664 /sys/class/power_supply/battery/batt_jig_gpio + chown system system /sys/class/power_supply/battery/dchg_adc_mode_ctrl + chmod 0664 /sys/class/power_supply/battery/dchg_adc_mode_ctrl + chown system system /sys/class/power_supply/battery/direct_charging_status + chmod 0664 /sys/class/power_supply/battery/direct_charging_status + chown system radio /sys/class/power_supply/battery/boot_complete + chmod 0660 /sys/class/power_supply/battery/boot_complete + + # set file permission for boot + chown radio system /efs/usb_hw_param + chmod 771 /efs/usb_hw_param + chown system system /efs/usb_hw_param/usb_hw_param.log + chmod 0660 /efs/usb_hw_param/usb_hw_param.log + + chown system system /sys/class/leds/vibrator/trigger + chown system system /sys/class/leds/vibrator/activate + chown system system /sys/class/leds/vibrator/brightness + chown system system /sys/class/leds/vibrator/duration + chown system system /sys/class/leds/vibrator/state + chown system system /sys/class/timed_output/vibrator/enable + chown system system /sys/class/timed_output/vibrator/intensity + chown system system /sys/class/timed_output/vibrator/multi_freq + chown system system /sys/class/timed_output/vibrator/haptic_engine + chown system system /sys/class/timed_output/vibrator/force_touch_intensity + chown system system /sys/class/timed_output/vibrator/motor_type + chown system system /sys/class/leds/keyboard-backlight/brightness + chown system system /sys/class/leds/lcd-backlight/brightness + chown system system /sys/class/leds/button-backlight/brightness + chown system system /sys/class/leds/jogball-backlight/brightness + chown system system /sys/class/leds/red/brightness + chown system system /sys/class/leds/green/brightness + chown system system /sys/class/leds/blue/brightness + chown system system /sys/class/leds/red/device/grpfreq + chown system system /sys/class/leds/red/device/grppwm + chown system system /sys/class/leds/red/device/blink + chown system system /sys/module/sco/parameters/disable_esco + chown system system /sys/kernel/ipv4/tcp_wmem_min + chown system system /sys/kernel/ipv4/tcp_wmem_def + chown system system /sys/kernel/ipv4/tcp_wmem_max + chown system system /sys/kernel/ipv4/tcp_rmem_min + chown system system /sys/kernel/ipv4/tcp_rmem_def + chown system system /sys/kernel/ipv4/tcp_rmem_max + chown root radio /proc/cmdline + + # UFS + chown system system /sys/block/sda/device/model + chmod 444 /sys/block/sda/device/model + chown system system /sys/block/sda/device/rev + chmod 444 /sys/block/sda/device/rev + chown system system /sys/class/scsi_host/host0/lt + chmod 444 /sys/class/scsi_host/host0/lt + chown system system /sys/class/scsi_host/host0/SEC_UFS_err_sum + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_err_sum + chown system system /sys/class/scsi_host/host0/SEC_UFS_op_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_op_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_query_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_query_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_uic_cmd_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_uic_cmd_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_uic_err_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_uic_err_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_utp_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_utp_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_fatal_cnt + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_fatal_cnt + chown system system /sys/class/scsi_host/host0/SEC_UFS_TW_info + chmod 444 /sys/class/scsi_host/host0/SEC_UFS_TW_info + chown system system /sys/block/sda/diskios + chmod 660 /sys/block/sda/diskios + chown system system /sys/class/scsi_host/host0/unique_number + chmod 440 /sys/class/scsi_host/host0/unique_number + chown system system /sys/class/scsi_host/host0/lc + chmod 444 /sys/class/scsi_host/host0/lc + chown system system /sys/block/sda/iomon + chown system system /sys/block/sda/hiotime + chown system system /sys/block/sda/iobd + chown system system /sys/block/sda/queue/io_volume_stats + chown system system /sys/block/sda/queue/tw_stats + + # eMMC/SD + chown system system /sys/block/mmcblk0/device/unique_number + chmod 440 /sys/block/mmcblk0/device/unique_number + chown system system /sys/block/mmcblk0/device/cid + chmod 444 /sys/block/mmcblk0/device/cid + chown system system /sys/block/mmcblk1/device/cid + chmod 444 /sys/block/mmcblk1/device/cid + chown system system /sys/class/sec/sdcard/cd_cnt + chmod 444 /sys/class/sec/sdcard/cd_cnt + chown system system /sys/class/sec/sddata/sd_data + chmod 444 /sys/class/sec/sddata/sd_data + chown system system /sys/class/sec/mmc/mmc_data + chmod 444 /sys/class/sec/mmc/mmc_data + chown system system /sys/class/sec/mmc/mmc_summary + chmod 444 /sys/class/sec/mmc/mmc_summary + chown system system /sys/class/sec/sdcard/sdcard_summary + chmod 444 /sys/class/sec/sdcard/sdcard_summary + chown system system /sys/class/sec/sdinfo/sd_count + chmod 444 /sys/class/sec/sdinfo/sd_count + + # h2k + mkdir /efs/cpk 0771 radio system + chmod 0644 /efs/redata.bin + chmod 0644 /efs/cpk/redata.bin + chown radio radio /efs/h2k.dat + chown radio radio /efs/cpk/h2k.dat + chmod 0644 /efs/h2k.dat + chmod 0644 /efs/cpk/h2k.dat + chown system system /efs/drm/h2k + + # mldap + mkdir /efs/prov_data 0770 radio system + + # SSU (Samsung SIM Unlock) + mkdir /efs/mb_po 0700 system system + + # HMT relay mode + chown radio system /sys/devices/virtual/relay_on + chown radio system /sys/devices/virtual/data_on + + # Permissions for Touchscreen + chown system radio /sys/class/sec/tsp/cmd + chown system system /sys/class/sec/tsp/input/enabled + chmod 0660 /sys/class/sec/tsp/input/enabled + chown root system /proc/tsp_msg + chmod 0440 /proc/tsp_msg + chown system radio /sys/class/sec/tsp/pressure_enable + chown system system /sys/class/sec/tsp/multi_count + chown system system /sys/class/sec/tsp/wet_mode + chown system system /sys/class/sec/tsp/noise_mode + chown system system /sys/class/sec/tsp/comm_err_count + chown system system /sys/class/sec/tsp/checksum + chown system system /sys/class/sec/tsp/holding_time + chown system system /sys/class/sec/tsp/all_touch_count + chown system system /sys/class/sec/tsp/z_value + chown system system /sys/class/sec/tsp/sensitivity_mode + chown system system /sys/class/sec/tsp/prox_power_off + chown system system /sys/class/sec/tsp/irq_recovery_count + chown system system /sys/class/sec/tsp/ic_reset_count + chown system system /sys/class/sec/tsp/mode_change_failed_count + chown system system /sys/class/sec/sec_key/key_pressed_count + chown system system /dev/tspio + chown system system /sys/class/sec/tsp/ear_detect_enable + chown system system /sys/class/sec/tsp/ta_mode + + # Permissions for Touchkey + chmod 0660 /sys/class/sec_touchkey/input/enabled + chown system system /sys/class/sec/sec_touchkey/input/enabled + chown system radio /sys/class/sec/sec_touchkey/brightness + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_update + chown system radio /sys/class/sec/sec_touchkey/touch_sensitivity + chown system radio /sys/class/sec/sec_touchkey/glove_mode + chown system radio /sys/class/sec/sec_touchkey/flip_mode + chown system radio /sys/class/sec/sec_touchkey/sar_enable + chown system radio /sys/class/sec/sec_touchkey/sw_reset + chown system radio /sys/class/sec/sec_touchkey/touchkey_earjack + chown system radio /sys/class/sec/sec_touchkey/grip_irq_count + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_version + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_update + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_id_compare + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_table_write + + # Permissions for Wacom + chown system radio /sys/class/sec/sec_epen/cmd + chown system system /sys/class/sec/sec_epen/input/enabled + chmod 0660 /sys/class/sec/sec_epen/input/enabled + chown system radio /sys/class/sec/sec_epen/epen_firm_update + chown system radio /sys/class/sec/sec_epen/epen_reset + chown system radio /sys/class/sec/sec_epen/epen_reset_result + chown system radio /sys/class/sec/sec_epen/epen_checksum + chown system radio /sys/class/sec/sec_epen/epen_checksum_result + chown system radio /sys/class/sec/sec_epen/epen_saving_mode + chown system radio /sys/class/sec/sec_epen/epen_wcharging_mode + chown system radio /sys/class/sec/sec_epen/epen_ble_charging_mode + chown system radio /sys/class/sec/sec_epen/keyboard_mode + chown system radio /sys/class/sec/sec_epen/epen_disable_mode + chown system radio /sys/class/sec/sec_epen/aod_enable + chown system radio /sys/class/sec/sec_epen/aod_lcd_onoff_status + chown system radio /sys/class/sec/sec_epen/screen_off_memo_enable + chown system radio /sys/class/sec/sec_epen/dex_enable + chown system radio /sys/class/sec/sec_epen/epen_fac_garage_mode + chown system radio /sys/class/sec/sec_epen/epen_fac_select_firmware + chown system system /sys/class/sec/sec_epen/abnormal_reset_count + chown system system /sys/class/sec/sec_epen/i2c_fail_count + chown system system /sys/class/sec/sec_epen/pen_out_count + + # Key + chown system radio /sys/class/sec/sec_key/wakeup_keys + write /sys/class/sec/sec_key/wakeup_keys 116,172 + chown system system /sys/class/sec/sec_key/key_pressed_count + chown system radio /sys/class/sec/sec_sidekey/cmd + chown system system /sys/class/sec/sec_sidekey/input/enabled + chmod 0660 /sys/class/sec/sec_sidekey/input/enabled + + # Permissions for Auto Input + chown system system /sys/class/sec/sec_auto_input/enable + chown system system /sys/class/sec/sec_auto_input/tsp_event + + # Permissions for Edtbo + chown system system /sys/class/sec/sec_sysup/edtbo_update + chown system system /sys/class/sec/sec_sysup/edtbo_version + +# Permissions for DMV data + chown system system /sys/kernel/alta_bigdata/dmv_info + + # MTP device permission + chmod 0660 /dev/usb_mtp_gadget + chown system mtp /dev/usb_mtp_gadget + mkdir /dev/socket/mtp 0770 system mtp + + # Define default initial receive window size in segments. + setprop net.tcp.default_init_rwnd 60 + + # Start standard binderized HAL daemons + class_start hal + + class_start core + +# sem_daemon permission + chown system system /efs/sec_efs/ssp_data + chmod 0644 /efs/sec_efs/ssp_data + +# Permissions for SENSORS +# Flush + chown system radio /sys/class/sensors/sensor_dev/flush +# sensor dump + chown system system /sys/class/sensors/ssc_core/sensor_dump + +# Magnetic Sensor + chown system radio /sys/class/sensors/magnetic_sensor/name + chown system radio /sys/class/sensors/magnetic_sensor/vendor + chown system radio /sys/class/sensors/magnetic_sensor/raw_data + chown system radio /sys/class/sensors/magnetic_sensor/adc + chown system radio /sys/class/sensors/magnetic_sensor/asa + chown system radio /sys/class/sensors/magnetic_sensor/dac + chown system radio /sys/class/sensors/magnetic_sensor/chk_registers + chown system radio /sys/class/sensors/magnetic_sensor/selftest + chown system system /sys/class/sensors/magnetic_sensor/dhr_sensor_info + +# Grip_sensor + chown system radio /sys/class/sensors/grip_sensor/name + chown system radio /sys/class/sensors/grip_sensor/vendor + chown system radio /sys/class/sensors/grip_sensor/raw_data + chown system radio /sys/class/sensors/grip_sensor/threshold + chown system radio /sys/class/sensors/grip_sensor/calibration + chown system radio /sys/class/sensors/grip_sensor/onoff + chown system radio /sys/class/sensors/grip_sensor/reset + chown system radio /sys/class/sensors/grip_sensor/mode + chown system radio /sys/class/sensors/grip_sensor/gain + chown system radio /sys/class/sensors/grip_sensor/start + chown system radio /sys/class/sensors/grip_sensor/normal_threshold + chown system radio /sys/class/sensors/grip_sensor/gain_ch2 + chown system radio /sys/class/sensors/grip_sensor/raw_data_ch2 + chown system radio /sys/class/sensors/grip_sensor/diff_avg_ch2 + chown system radio /sys/class/sensors/grip_sensor/normal_threshold_ch2 + chown system radio /sys/class/sensors/grip_sensor/ch_state + chown system radio /sys/class/sensors/grip_sensor/body_threshold + chown system radio /sys/class/sensors/grip_sensor/grip_flush + chown system radio /sys/class/sensors/grip_sensor/irq_count + chown system radio /sys/class/sensors/grip_sensor/resolution + chown system radio /sys/class/sensors/grip_sensor/adc_filt + chown system radio /sys/class/sensors/grip_sensor/useful_filt + +# Grip_sensor + chown system radio /sys/class/sensors/grip_sensor/name + chown system radio /sys/class/sensors/grip_sensor/grip_firm_update_status + chown system radio /sys/class/sensors/grip_sensor/grip_firm_update + chown system radio /sys/class/sensors/grip_sensor/grip_firm_version_phone + chown system radio /sys/class/sensors/grip_sensor/grip_firm_version_panel + chown system radio /sys/class/sensors/grip_sensor/grip_sar_enable + chown system radio /sys/class/sensors/grip_sensor/grip_sar_only_mode + chown system radio /sys/class/sensors/grip_sensor/grip_sar_press_threshold + chown system radio /sys/class/sensors/grip_sensor/grip_sar_release_threshold + chown system radio /sys/class/sensors/grip_sensor/grip_earjack + chown system radio /sys/class/sensors/grip_sensor/grip_gain + chown system radio /sys/class/sensors/grip_sensor/grip_raw + chown system radio /sys/class/sensors/grip_sensor/grip_raw_d + chown system radio /sys/class/sensors/grip_sensor/grip_sw_reset + chown system radio /sys/class/sensors/grip_sensor/grip_threshold + chown system radio /sys/class/sensors/grip_sensor/grip_total_cap + chown system radio /sys/class/sensors/grip_sensor/grip_check + chown system radio /sys/class/sensors/grip_sensor/grip + chown system radio /sys/class/sensors/grip_sensor/grip_diff_d + chown system radio /sys/class/sensors/grip_sensor/grip_baseline + chown system radio /sys/class/sensors/grip_sensor/grip_irq_count + +# Grip_sensor_sub + chown system radio /sys/class/sensors/grip_sensor_sub/name + chown system radio /sys/class/sensors/grip_sensor_sub/vendor + chown system radio /sys/class/sensors/grip_sensor_sub/raw_data + chown system radio /sys/class/sensors/grip_sensor_sub/threshold + chown system radio /sys/class/sensors/grip_sensor_sub/calibration + chown system radio /sys/class/sensors/grip_sensor_sub/onoff + chown system radio /sys/class/sensors/grip_sensor_sub/reset + chown system radio /sys/class/sensors/grip_sensor_sub/mode + chown system radio /sys/class/sensors/grip_sensor_sub/gain + chown system radio /sys/class/sensors/grip_sensor_sub/start + chown system radio /sys/class/sensors/grip_sensor_sub/normal_threshold + chown system radio /sys/class/sensors/grip_sensor_sub/gain_ch2 + chown system radio /sys/class/sensors/grip_sensor_sub/raw_data_ch2 + chown system radio /sys/class/sensors/grip_sensor_sub/diff_avg_ch2 + chown system radio /sys/class/sensors/grip_sensor_sub/normal_threshold_ch2 + chown system radio /sys/class/sensors/grip_sensor_sub/ch_state + chown system radio /sys/class/sensors/grip_sensor_sub/body_threshold + chown system radio /sys/class/sensors/grip_sensor_sub/grip_flush + chown system radio /sys/class/sensors/grip_sensor_sub/irq_count + chown system radio /sys/class/sensors/grip_sensor_sub/ch_count + chown system radio /sys/class/sensors/grip_sensor_sub/resolution + chown system radio /sys/class/sensors/grip_sensor_sub/adc_filt + chown system radio /sys/class/sensors/grip_sensor_sub/useful_filt + +# WIFI Grip sensor + chown system radio /sys/class/sensors/grip_sensor_wifi/name + chown system radio /sys/class/sensors/grip_sensor_wifi/vendor + chown system radio /sys/class/sensors/grip_sensor_wifi/raw_data + chown system radio /sys/class/sensors/grip_sensor_wifi/threshold + chown system radio /sys/class/sensors/grip_sensor_wifi/calibration + chown system radio /sys/class/sensors/grip_sensor_wifi/onoff + chown system radio /sys/class/sensors/grip_sensor_wifi/reset + chown system radio /sys/class/sensors/grip_sensor_wifi/mode + chown system radio /sys/class/sensors/grip_sensor_wifi/gain + chown system radio /sys/class/sensors/grip_sensor_wifi/start + chown system radio /sys/class/sensors/grip_sensor_wifi/normal_threshold + chown system radio /sys/class/sensors/grip_sensor_wifi/gain_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi/raw_data_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi/diff_avg_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi/normal_threshold_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi/ch_state + chown system radio /sys/class/sensors/grip_sensor_wifi/body_threshold + chown system radio /sys/class/sensors/grip_sensor_wifi/grip_flush + chown system radio /sys/class/sensors/grip_sensor_wifi/irq_count + chown system radio /sys/class/sensors/grip_sensor_wifi/resolution + chown system radio /sys/class/sensors/grip_sensor_wifi/adc_filt + chown system radio /sys/class/sensors/grip_sensor_wifi/useful_filt + +# WIFI SUB Grip sensor + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/name + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/vendor + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/raw_data + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/threshold + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/calibration + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/onoff + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/reset + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/mode + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/gain + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/start + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/normal_threshold + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/gain_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/raw_data_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/diff_avg_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/normal_threshold_ch2 + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/ch_state + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/body_threshold + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/grip_flush + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/irq_count + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/resolution + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/adc_filt + chown system radio /sys/class/sensors/grip_sensor_wifi_sub/useful_filt + +# Accelerometer Sensor + chown system radio /sys/class/sensors/accelerometer_sensor/name + chown system radio /sys/class/sensors/accelerometer_sensor/vendor + chown system radio /sys/class/sensors/accelerometer_sensor/raw_data + chown system radio /sys/class/sensors/accelerometer_sensor/calibration + chown system radio /sys/class/sensors/accelerometer_sensor/selftest + chown system radio /sys/class/sensors/accelerometer_sensor/reactive_alert + chown system radio /sys/class/sensors/accelerometer_sensor/lowpassfilter + chown system system /sys/class/sensors/accelerometer_sensor/dhr_sensor_info + +# Gyro Sensor + chown system radio /sys/class/sensors/gyro_sensor/name + chown system radio /sys/class/sensors/gyro_sensor/vendor + chown system radio /sys/class/sensors/gyro_sensor/selftest_revised + chown system radio /sys/class/sensors/gyro_sensor/power_on + chown system radio /sys/class/sensors/gyro_sensor/power_off + chown system radio /sys/class/sensors/gyro_sensor/selftest + chown system media /sys/class/sensors/gyro_sensor/temperature + +# Magnetic Sensor + chown system radio /sys/class/sensors/magnetic_sensor/name + chown system radio /sys/class/sensors/magnetic_sensor/vendor + chown system radio /sys/class/sensors/magnetic_sensor/raw_data + chown system radio /sys/class/sensors/magnetic_sensor/adc + chown system radio /sys/class/sensors/magnetic_sensor/asa + chown system radio /sys/class/sensors/magnetic_sensor/dac + chown system radio /sys/class/sensors/magnetic_sensor/chk_registers + chown system radio /sys/class/sensors/magnetic_sensor/selftest + chown system system /sys/class/sensors/magnetic_sensor/dhr_sensor_info + +# Proximity Sensor + chown system radio /sys/class/sensors/proximity_sensor/name + chown system radio /sys/class/sensors/proximity_sensor/vendor + chown system radio /sys/class/sensors/proximity_sensor/state + chown system radio /sys/class/sensors/proximity_sensor/raw_data + chown system radio /sys/class/sensors/proximity_sensor/barcode_emul_en + chown system radio /sys/class/sensors/proximity_sensor/prox_avg + chown system radio /sys/class/sensors/proximity_sensor/prox_cal + chown system radio /sys/class/sensors/proximity_sensor/thresh_high + chown system radio /sys/class/sensors/proximity_sensor/thresh_low + chown system radio /sys/class/sensors/proximity_sensor/prox_offset_pass + chown system radio /sys/class/sensors/proximity_sensor/prox_trim + chown system radio /sys/class/sensors/proximity_sensor/thresh_detect_high + chown system radio /sys/class/sensors/proximity_sensor/thresh_detect_low + chown system radio /sys/class/sensors/proximity_sensor/prox_alert_thresh + chown system system /sys/class/sensors/proximity_sensor/dhr_sensor_info + +# barometer_sensor + chown system radio /sys/class/sensors/barometer_sensor/name + chown system radio /sys/class/sensors/barometer_sensor/vendor + chown system radio /sys/class/sensors/barometer_sensor/poll_period_ms + chown system radio /sys/class/sensors/barometer_sensor/pressure_threshold + chown system radio /sys/class/sensors/barometer_sensor/calibration + chown system radio /sys/class/sensors/barometer_sensor/sea_level_pressure + chown system radio /sys/class/sensors/barometer_sensor/temperature + chown system radio /sys/class/sensors/barometer_sensor/selftest + +# Light Sensor + chown system radio /sys/class/sensors/light_sensor/name + chown system radio /sys/class/sensors/light_sensor/vendor + chown system radio /sys/class/sensors/light_sensor/lux + chown system radio /sys/class/sensors/light_sensor/raw_data + chown system radio /sys/class/sensors/light_sensor/brightness + chown system radio /sys/class/sensors/light_sensor/light_circle + chown system radio /sys/class/sensors/light_sensor/algo_mode + +# Hidden Hole + chown system radio /sys/class/sensors/hidden_hole/hh_ver + chown system radio /sys/class/sensors/hidden_hole/hh_write_all_data + chown system radio /sys/class/sensors/hidden_hole/hh_is_exist_efs + chown system radio /sys/class/sensors/hidden_hole/hh_ext_prox_th + +on nonencrypted + # mobicore mcRegistry + mkdir /data/vendor/mcRegistry 0775 system system + mkdir /data/misc/mcRegistry 0775 system system + class_start main + class_start late_start + +on property:sys.init_log_level=* + loglevel ${sys.init_log_level} + +on charger + chmod 0664 /sys/class/power_supply/battery/batt_temp_table + chown system radio /sys/class/power_supply/battery/batt_temp_table + chmod 0664 /sys/class/power_supply/battery/batt_capacity_max + chown system radio /sys/class/power_supply/battery/batt_capacity_max + chmod 0664 /sys/class/power_supply/battery/battery_cycle + chown system radio /sys/class/power_supply/battery/battery_cycle + chmod 0664 /sys/class/power_supply/battery/batt_after_manufactured + chown system radio /sys/class/power_supply/battery/batt_after_manufactured + chown system radio /sys/class/power_supply/battery/cisd_fullcaprep_max + chmod 0660 /sys/class/power_supply/battery/cisd_fullcaprep_max + chown system radio /sys/class/power_supply/battery/cisd_data + chmod 0660 /sys/class/power_supply/battery/cisd_data + chown system system /efs/FactoryApp/cisd_fullcaprep_max + chmod 0640 /efs/FactoryApp/cisd_fullcaprep_max + chown system radio /sys/class/power_supply/battery/cisd_data_efs_path + chmod 0660 /sys/class/power_supply/battery/cisd_data_efs_path + chown system system /efs/FactoryApp/cisd_data + chmod 0640 /efs/FactoryApp/cisd_data + chown system system /efs/FactoryApp/cisd_tx_data + chmod 0640 /efs/FactoryApp/cisd_tx_data + chown radio system /efs + chmod 0771 /efs + mkdir /efs/Battery 0775 radio system + chown radio system /efs/Battery + chmod 0775 /efs/Battery + chown radio system /efs/Battery/batt_capacity_max + chmod 0664 /efs/Battery/batt_capacity_max + copy /system/vendor/firmware/battery_data.dat /efs/Battery/battery_data.dat + chmod 0400 /efs/Battery/battery_data.dat + write /sys/class/power_supply/battery/batt_update_data "/efs/Battery/battery_data.dat" + class_start charger + +# BATTERY +on property:sys.boot_completed=1 + write /sys/class/power_supply/battery/boot_completed "1" + +#@VOLD Emergency reset +on property:vold.emergency_reset=1 + start installd + +on property:vold.decrypt=trigger_reset_main + stop surfaceflinger + stop vendor.hwcomposer-2-1 + stop vendor.hwcomposer-2-2 + start vendor.hwcomposer-2-1 + start vendor.hwcomposer-2-2 + start surfaceflinger + class_reset main + +on property:vold.decrypt=trigger_load_persist_props + load_persist_props + start scs + start logd + start logd-reinit + +on property:vold.decrypt=trigger_post_fs_data + trigger post-fs-data + trigger zygote-start + +on property:vold.decrypt=trigger_restart_min_framework + # A/B update verifier that marks a successful boot. + exec_start update_verifier + class_start main + +on property:vold.decrypt=trigger_restart_framework + # mobicore mcRegistry + mkdir /data/vendor/mcRegistry 0775 system system + mkdir /data/misc/mcRegistry 0775 system system + # A/B update verifier that marks a successful boot. + exec_start update_verifier + class_start main + class_start late_start + +on property:vold.decrypt=trigger_shutdown_framework + class_reset late_start + class_reset main + +on property:ro.crypto.type=file && property:vold.post_fs_data_done=1 + start scs + +on property:vold.post_fs_data_done=1 + chown root system /dev/kmsg + chmod 0660 /dev/kmsg + +on property:sys.boot_completed=1 + bootchart stop + +# system server cannot write to /proc/sys files, +# and chown/chmod does not work for /proc/sys/ entries. +# So proxy writes through init. +on property:sys.sysctl.extra_free_kbytes=* + write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes} + +on property:sys.sysctl.swappiness=* + write /proc/sys/vm/swappiness ${sys.sysctl.swappiness} + +on property:sys.sysctl.mmap_readaround_limit=* + write /proc/sys/vm/mmap_readaround_limit ${sys.sysctl.mmap_readaround_limit} + +on property:sys.sysctl.fault_around_bytes=* + write /sys/kernel/debug/fault_around_bytes ${sys.sysctl.fault_around_bytes} + +# "tcp_default_init_rwnd" Is too long! +on property:sys.sysctl.tcp_def_init_rwnd=* + write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd} + +on property:security.perf_harden=0 + write /proc/sys/kernel/perf_event_paranoid 1 + +on property:security.perf_harden=1 + write /proc/sys/kernel/perf_event_paranoid 3 + +# on shutdown +# In device's init.rc, this trigger can be used to do device-specific actions +# before shutdown. e.g disable watchdog and mask error handling + +## Daemon processes to be run by init. +## +service ueventd /sbin/ueventd + class core + critical + seclabel u:r:ueventd:s0 + shutdown critical + +service console /system/bin/sh + class core + console + disabled + user shell + group shell log readproc + seclabel u:r:shell:s0 + setenv HOSTNAME console + +on property:ro.debuggable=1 + # Give writes to anyone for the trace folder on debug builds. + # The folder is used to store method traces. + chmod 0773 /data/misc/trace + # Give reads to anyone for the window trace folder on debug builds. + chmod 0775 /data/misc/wmtrace + start console + +# LPM +service lpm /vendor/bin/lpm + class sec-charger + user root + group system radio input + critical + +# MobiCore startup +service mobicore /vendor/bin/mcDriverDaemon -r /vendor/app/mcRegistry/FFFFFFFF000000000000000000000001.drbin -r /vendor/app/mcRegistry/ffffffffd0000000000000000000000a.tlbin -r /vendor/app/mcRegistry/ffffffffd00000000000000000000016.tlbin -r /vendor/app/mcRegistry/ffffffffd0000000000000000000001c.tlbin + class core + user system + group system + disabled + +service flash_recovery /system/bin/install-recovery.sh + class main + oneshot + +on property:security.ucm_ese_applet_installed=1 + start esecomm + setprop security.ucm_ese_applet_installed 0 + +# Pageboostd +on property:sys.boot_completed=1 + mkdir /data/misc/pageboost 0771 system system + +# HWC data + mkdir /data/vendor/log/hwc 0771 system graphics + +## Filesystem defragment daemon +service defrag_service /system/bin/idledefrag + user root + group root + oneshot + disabled + +on property:vold.should_defrag=1 + start defrag_service + +service SIDESYNC_service /system/bin/ss_conn_daemon + class main + socket ss_conn_daemon stream 0666 system system + user system + group inet net_raw + +on property:persist.security.tlc.ccm=1 + start ccm + setprop persist.security.tlc.ccm 0 + +on property:persist.security.ccmextra=1 + setprop persist.security.ccmextra 0 + write /proc/sysrq-trigger "c" + +# package_fw +on property:sys.do_restorecon_user=* + restorecon --recursive --force /data/media/${sys.do_restorecon_user} + +# s.fan - hide carrier apps +on property:ro.csc.sales_code=* + mount none /system/carrier/${ro.csc.sales_code} /system/carrier bind + +# Network packet dropdump +on property:sys.dropdump.on=On + write /proc/sys/net/core/support_dropdump 1 + +on property:sys.dropdump.on=Off + write /proc/sys/net/core/support_dropdump 0 diff --git a/rootdir/etc/init.samsungexynos7870.rc b/rootdir/etc/init.samsungexynos7870.rc new file mode 100755 index 0000000..9492d56 --- /dev/null +++ b/rootdir/etc/init.samsungexynos7870.rc @@ -0,0 +1,566 @@ +import /vendor/etc/init/hw/init.samsungexynos7870.usb.rc +import /vendor/etc/init/hw/init.baseband.rc +import /vendor/etc/init/hw/init.wifi.rc +import /vendor/etc/init/hw/init.wifi_device.rc +import /vendor/etc/init/hw/init.rilchip.rc +import /vendor/etc/init/hw/init.rilcommon.rc + +# Samsung stock init.rc additions +import /vendor/etc/init/hw/init.samsung.rc + +on early-init + mount debugfs /sys/kernel/debug /sys/kernel/debug +on init + start watchdogd + + # See storage config details at http://source.android.com/tech/storage/ + mkdir /mnt/shell/emulated 0700 shell shell + mkdir /storage/emulated 0555 root root + + # Support legacy paths + symlink /sdcard /mnt/sdcard + + export EXTERNAL_STORAGE /sdcard + symlink /data/app /factory + symlink /dev/block/platform/13540000.dwmmc0/by-name/PERSISTENT /dev/block/persistent + symlink /dev/block/platform/13540000.dwmmc0/by-name/STEADY /dev/block/steady + +on post-fs-data +# Log data folder +# mkdir /data/log 0771 radio system + +# C-STATE + chown system system /sys/module/cpuidle/parameters/off + chmod 0660 /sys/module/cpuidle/parameters/off + +# CPU Idle + chown system system /sys/module/cpuidle_exynos64/parameters/enable_mask + +# Audio I2C node for TFA amp + chmod 0660 /dev/i2c-20 + chown audio audio /dev/i2c-20 + + setprop vold.post_fs_data_done 1 + +# /efs/factory.prop for Dual / Single SIM settings + chown radio radio /efs/factory.prop + chmod 0600 /efs/factory.prop + + restorecon /sys/kernel/debug/tracing/trace_marker + +on boot + # override init.rc to keep plenty of large order chunks around + # to improve allocation times +# write /proc/sys/vm/min_free_kbytes 32768 +# write /proc/sys/vm/min_free_order_shift 1 + +# SSWAP + write /proc/sys/vm/swappiness 130 + +# mount debugfs /sys/kernel/debug /sys/kernel/debug + # Allow to access debugfs for system:system + chmod 755 /sys/kernel/debug + chown system system /sys/kernel/debug +# setprop ro.radio.noril yes + + # Assign TCP buffer thresholds to be ceiling value of technology maximums + # Increased technology maximums should be reflected here. + write /proc/sys/net/core/rmem_max 4194304 + write /proc/sys/net/core/wmem_max 4194304 + + # Set up kernel tracing, but disable it by default + chmod 0222 /sys/kernel/debug/tracing/trace_marker + write /sys/kernel/debug/tracing/tracing_on 0 + + # sec_log + chown system log /proc/sec_log + + # EFS permissions + chown system radio /efs/nv_data.bin + chown system radio /efs/nv_data.bin.md5 + chown system radio /cpefs/.nv_core.bak + chown system radio /efs/.nv_core.bak + + # Permissions for NAD + symlink /dev/block/platform/13540000.dwmmc0/by-name/NAD_REFER /dev/block/NAD_REFER + chown system radio /sys/class/sec/sec_nad/nad_stat + chmod 0664 /sys/class/sec/sec_nad/nad_stat + chown system radio /sys/class/sec/sec_nad/nad_erase + chmod 0664 /sys/class/sec/sec_nad/nad_erase + chown system radio /sys/class/sec/sec_nad/nad_acat + chmod 0664 /sys/class/sec/sec_nad/nad_acat + chown system radio /sys/class/sec/sec_nad/nad_dram + chmod 0664 /sys/class/sec/sec_nad/nad_dram + chown system radio /sys/class/sec/sec_nad/nad_all + chmod 0664 /sys/class/sec/sec_nad/nad_all + chown system radio /dev/block/NAD_REFER + chmod 0664 /dev/block/NAD_REFER + + # 1-key hard reset + chown system system /sys/power/reset_enabled + chmod 0660 /sys/power/reset_enabled + + # CPU hotplug + chown system system /sys/power/cpuhotplug/enabled + chmod 0660 /sys/power/cpuhotplug/enabled + chown system system /sys/power/cpuhotplug/min_online_cpu + chmod 0664 /sys/power/cpuhotplug/min_online_cpu + chown system system /sys/power/cpuhotplug/max_online_cpu + chmod 0664 /sys/power/cpuhotplug/max_online_cpu + + # GPU dvfs node + chown radio system /sys/devices/11400000.mali/dvfs_table + chmod 0664 /sys/devices/11400000.mali/dvfs_table + chown radio system /sys/devices/11400000.mali/dvfs_min_lock + chmod 0664 /sys/devices/11400000.mali/dvfs_min_lock + chown radio system /sys/devices/11400000.mali/dvfs_max_lock + chmod 0664 /sys/devices/11400000.mali/dvfs_max_lock + + # mif, int + chown radio system /sys/class/devfreq/17000010.devfreq_mif/min_freq + chmod 0664 /sys/class/devfreq/17000010.devfreq_mif/min_freq + chown radio system /sys/class/devfreq/17000010.devfreq_mif/max_freq + chmod 0664 /sys/class/devfreq/17000010.devfreq_mif/max_freq + chown radio system /sys/class/devfreq/17000010.devfreq_mif/available_frequencies + chmod 0644 /sys/class/devfreq/17000010.devfreq_mif/available_frequencies + chown radio system /sys/class/devfreq/17000020.devfreq_int/min_freq + chmod 0664 /sys/class/devfreq/17000020.devfreq_int/min_freq + chown radio system /sys/class/devfreq/17000020.devfreq_int/max_freq + chmod 0664 /sys/class/devfreq/17000020.devfreq_int/max_freq + chown radio system /sys/class/devfreq/17000020.devfreq_int/available_frequencies + chmod 0664 /sys/class/devfreq/17000020.devfreq_int/available_frequencies + + # Change permission for interactive governor + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_slack + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/boost + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/input_boost + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/input_boost + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/boostpulse_duration + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy + chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy + + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_slack + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_slack + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/boost + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/input_boost + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/input_boost + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/boostpulse_duration + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/boostpulse_duration + chown system system /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy + chmod 0660 /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy + + # RTC status + chown system system /sys/power/rtc_status + chmod 0444 /sys/power/rtc_status + chown system system /efs/FactoryApp/rtc_status + chmod 0664 /efs/FactoryApp/rtc_status + + chown bluetooth bluetooth /dev/ttySAC0 + chmod 0660 /dev/ttySAC0 + +# sem_daemon permission + chown system system /efs/sec_efs/ssp_data + chmod 0644 /efs/sec_efs/ssp_data + +#MST HW Support + setprop ro.mst.support 1 + +#Secure OS migration + chown radio system /sys/devices/system/sec_os_ctrl/migrate_os + chmod 664 /sys/devices/system/sec_os_ctrl/migrate_os + +# permissions for bluetooth. + setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" + chown bluetooth bluetooth ro.bt.bdaddr_path + chown radio bluetooth /efs/bluetooth/bt_addr + chmod 0640 /efs/bluetooth/bt_addr + chmod 0660 /sys/class/rfkill/rfkill0/state + chmod 0660 /sys/class/rfkill/rfkill0/device/extldo + chown bluetooth net_bt /sys/class/rfkill/rfkill0/state + chown bluetooth net_bt /sys/class/rfkill/rfkill0/type + chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo + + # MOBEAM + chown system radio /sys/class/sec/sec_barcode_emul/vendor + chown system radio /sys/class/sec/sec_barcode_emul/name + chown system radio /sys/class/sec/sec_barcode_emul/barcode_send + chown system radio /sys/class/sec/sec_barcode_emul/barcode_led_status + chown system radio /sys/class/sec/sec_barcode_emul/barcode_ver_check + +#Meta event + chown system radio /sys/class/sensors/sensor_dev/flush + +# Permission for USB SELECT + chown system system /sys/class/android_usb/android0/enable + chmod 0660 /sys/class/android_usb/android0/enable + chown system system /sys/class/android_usb/android0/idVendor + chmod 0660 /sys/class/android_usb/android0/idVendor + chown system system /sys/class/android_usb/android0/idProduct + chmod 0660 /sys/class/android_usb/android0/idProduct + chown system system /sys/class/android_usb/android0/f_diag/clients + chmod 0660 /sys/class/android_usb/android0/f_diag/clients + chown system system /sys/class/android_usb/android0/functions + chmod 0660 /sys/class/android_usb/android0/functions + chown system system /sys/class/android_usb/android0/bDeviceClass + chmod 0660 /sys/class/android_usb/android0/bDeviceClass + +# Support DM logging +# chmod 0770 /system/bin/dmd + +# Support DM logging + chmod 0770 /system/bin/diagexe + +# terminal mode + chmod 0660 /sys/class/android_usb/android0/terminal_version + chown system system /sys/class/android_usb/android0/terminal_version + +# for datarouter + chown system system /dev/dun + chown system system /dev/ttyGS0 + chown system system /dev/ttyGS1 + chown system system /dev/ttyGS2 + chown system system /dev/ttyGS3 + +# Support Virtual Com + chmod 0770 /system/bin/vcd + +# Support AP/CP log dump + chmod 0770 /system/bin/sced + +# Switch Device + chown system radio /sys/class/sec/switch/vbus_value + +# LPM mode for ccic + chown system radio /sys/class/sec/ccic/lpm_mode + chown system radio /sys/class/sec/ccic/ccic_control_option + +# IPSec for VOLTE + chown root system /dev/socket + chmod 0775 /dev/socket + +on fs + mount_all /vendor/etc/fstab.samsungexynos7870 + setprop ro.crypto.fuse_sdcard true + chown radio system /efs + +# Permissions for ION + chmod 0660 /sys/class/ion_cma/ion_video_ext/isolated + chown system system /sys/class/ion_cma/ion_video_ext/isolated + +# Permissions for backlight + chown system system /sys/class/backlight/panel/brightness + +# Permissions for LCD + chown system radio /sys/class/lcd/panel/manufacture_code + chown system radio /sys/class/lcd/panel/lcd_type + chown system system /sys/class/lcd/panel/siop_enable + chown system system /sys/class/lcd/panel/temperature + chown system radio /sys/class/lcd/panel/power_reduce + chown system system /sys/class/lcd/panel/lux + chown system system /sys/class/lcd/panel/adaptive_control + chown system system /sys/class/lcd/panel/alpm + chown system system /sys/class/lcd/panel/dpui + chown system system /sys/class/lcd/panel/dpui_dbg + chown system system /sys/devices/svc/OCTA/SVC_OCTA + +# Permissions for MDNIE + chown system media_rw /sys/class/mdnie/mdnie/mode + chown system media_rw /sys/class/mdnie/mdnie/scenario + chown system media_rw /sys/class/mdnie/mdnie/outdoor + chown system system /sys/class/mdnie/mdnie/accessibility + chown system media_rw /sys/class/mdnie/mdnie/rgb_adj_enable + chown system media_rw /sys/class/mdnie/mdnie/r_adj + chown system media_rw /sys/class/mdnie/mdnie/g_adj + chown system media_rw /sys/class/mdnie/mdnie/b_adj + chown system media_rw /sys/class/mdnie/mdnie/tuning + chown system system /sys/class/mdnie/mdnie/sensorRGB + chown system system /sys/class/mdnie/mdnie/mdnie_ldu + chown system system /sys/class/mdnie/mdnie/night_mode + chown system system /sys/class/mdnie/mdnie/whiteRGB + write /sys/class/mdnie/mdnie/scenario 0 + write /sys/class/mdnie/mdnie/outdoor 0 + write /sys/class/mdnie/mdnie/mode 1 + write /sys/class/mdnie/mdnie/accessibility 0 + write /sys/class/mdnie/mdnie/rgb_adj_enable 1 + write /sys/class/mdnie/mdnie/r_adj 255 + write /sys/class/mdnie/mdnie/g_adj 255 + write /sys/class/mdnie/mdnie/b_adj 255 + write /sys/class/mdnie/mdnie/tuning 0 + + chown system system /sys/class/lcd/panel/hmt_on + chmod 0660 /sys/class/lcd/panel/hmt_on + chown system system /sys/class/lcd/panel/hmt_bright + chmod 0660 /sys/class/lcd/panel/hmt_bright + chown system system /sys/class/mdnie/mdnie/hmt_color_temperature + chmod 0660 /sys/class/mdnie/mdnie/hmt_color_temperature + +# Copy DRM Key + copy /system/app/wv.keys /factory/wv.keys + +# Permission for DRM Key + chmod 0644 /factory/wv.keys + +# Permissions for System LSI NFC +# NFC : Permissions for NFC + chmod 0660 /dev/sec-nfc + chown nfc nfc /dev/sec-nfc +# Permissions for S.LSI ESE + chmod 0660 /dev/p3 + chown system system /dev/p3 + +# Permission for flashlight control for HAL3.3 + chmod 0660 /sys/class/camera/flash/rear_torch_flash + chown media system /sys/class/camera/flash/rear_torch_flash + chmod 0660 /sys/class/camera/flash/front_torch_flash + chown media system /sys/class/camera/flash/front_torch_flash + +# Permissions for TouchScreen + chown system radio /sys/class/sec/tsp/cmd + chown system system /sys/class/sec/tsp/input/enabled + chown system system /sys/class/sec/tsp/ito_check + chown system system /sys/class/sec/tsp/raw_check + chown system system /sys/class/sec/tsp/module_id + chown system system /sys/class/sec/tsp/multi_count + chown system system /sys/class/sec/tsp/wet_mode + chown system system /sys/class/sec/tsp/comm_err_count + +# Permissions for Touchkey + chown system radio /sys/class/sec/sec_touchkey/brightness + chown system radio /sys/class/sec/sec_touchkey/touchkey_firm_update + chown system radio /sys/class/sec/sec_touchkey/touch_sensitivity + chown system radio /sys/class/sec/sec_touchkey/glove_mode + chown system radio /sys/class/sec/sec_touchkey/flip_mode + chown system radio /sys/class/sec/sec_touchkey/sar_enable + chown system radio /sys/class/sec/sec_touchkey/sw_reset + chown system radio /sys/class/sec/sec_touchkey/touchkey_earjack + chown system system /sys/class/sec/sec_touchkey/input/enabled + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_version + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_update + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_id_compare + chown system radio /sys/class/sec/sec_touchkey/touchkey_light_table_write + +# Permissions for gpio_keys + chown radio system /sys/class/sec/sec_key/wakeup_keys + write /sys/class/sec/sec_key/wakeup_keys 116,172 + +# Permissions Camera + mkdir /data/camera 0770 cameraserver system + chown system radio /sys/class/camera/rear/rear_camfw + chown system radio /sys/class/camera/rear/rear_camfw_full + chown system radio /sys/class/camera/rear/rear_checkfw_user + chown system radio /sys/class/camera/rear/rear_checkfw_factory + chown system radio /sys/class/camera/rear/rear_sensor_standby + chown system radio /sys/class/camera/rear/rear_camtype + chown system radio /sys/class/camera/rear/rear_companionfw + chown system radio /sys/class/camera/rear/rear_companionfw_full + chown system radio /sys/class/camera/rear/rear_calcheck + chown system radio /sys/class/camera/rear/rear_caminfo + chown system radio /sys/class/camera/rear/rear_sensorid + chown system radio /sys/class/camera/rear/from_write + chown system radio /sys/class/camera/rear/isp_core + chown system radio /sys/class/camera/rear/fw_update + chown system radio /sys/class/camera/flash/rear_flash + chown system radio /sys/class/camera/flash/front_flash + chown cameraserver system /sys/class/camera/flash/rear_torch_flash + chown cameraserver system /sys/class/camera/flash/front_torch_flash + chown system radio /sys/class/camera/front/front_camfw + chown system radio /sys/class/camera/front/front_camfw_full + chown system radio /sys/class/camera/front/front_checkfw_factory + chown system radio /sys/class/camera/front/front_camtype + chown system radio /sys/class/camera/front/front_moduleid + chown system radio /sys/class/camera/front/front_caminfo + chown system radio /sys/class/camera/front/front_sensorid + chown system radio /sys/class/camera/ois/selftest + chown system radio /sys/class/camera/ois/ois_power + chown system radio /sys/class/camera/ois/ois_rawdata + chown system radio /sys/class/camera/ois/oisfw + chown system radio /sys/class/camera/ois/ois_diff + chown system radio /sys/class/camera/ois/fw_update + chown system radio /sys/class/camera/ois/ois_exif + chown system system /sys/devices/svc/Camera/SVC_rear_module + chown system system /sys/devices/svc/Camera/SVC_front_module + +# FM Radio + chown system audio /dev/radio0 + chmod 0660 /dev/radio0 + +#ARGOSD network_throughput + chown system system /dev/network_throughput +# ARGOSD +service argos-daemon /system/bin/argosd + class main + user system + group system radio + +# LPM +service lpm /vendor/bin/lpm + class charger + critical + seclabel u:r:charger:s0 + +# Bluetooth +on property:wc_transport.start_hci=true + start start_hci_filter + +on property:wc_transport.start_hci=false + stop start_hci_filter + +service start_hci_filter /vendor/bin/wcnss_filter + class late_start + user bluetooth + group bluetooth + disabled + +# RPMB daemon +service rpmbd /system/bin/rpmbd + user root + group drmrpc + class main + +on property:sys.mobicoredaemon.enable=true + start cs_service + write /proc/iccc_ready 1 + +on property:ro.multisim.simslotcount=1 + setprop persist.radio.multisim.config ss + +on property:ro.multisim.simslotcount=2 + setprop persist.radio.multisim.config dsds + +# Modem boot daemon +# service cpboot-daemon /system/bin/cbd -d +# class main +# user root +# group radio cache inet misc audio sdcard_rw log + +# DM daemon +# service DM-daemon /system/bin/dmd +# class main +# user root +# group system + +# SCE daemon +# service SCE-daemon /system/bin/sced +# class main +# user root +# group system + +# diag daemon +# service DM-daemon /system/bin/diagexe +# class main +# user root +# group system + +service fuse_sdcard /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard /storage/sdcard + class late_start + disabled +service fuse_usb1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/usb1 /storage/usb1 + class late_start + disabled + +# IPSec for VOLTE +service ipsec-daemon /system/bin/IPSecService + class main + socket ipsec_socket stream 660 system net_admin + user system + group system net_raw inet net_admin + +# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin +service watchdogd /sbin/watchdogd 10 20 + class core + seclabel u:r:watchdogd:s0 + +# on userdebug and eng builds, enable kgdb on the serial console +on property:ro.debuggable=1 + write /sys/module/kgdboc/parameters/kgdboc ttyFIQ1 + write /sys/module/fiq_debugger/parameters/kgdb_enable 1 + +service prepare_param /system/bin/prepare_param.sh /dev/block/platform/13540000.dwmmc0/by-name/PARAM + class core + user root + group root + seclabel u:r:prepare_param:s0 + oneshot + +# Secure Storage startup +service secure_storage /system/bin/secure_storage_daemon + class core + user system + group system + disabled +on property:ro.securestorage.knox=true + mkdir /dev/.secure_storage + chmod 0711 /dev/.secure_storage + chown system system /dev/.secure_storage + restorecon -R /dev/.secure_storage + start secure_storage +on property:ro.securestorage.support=true + mkdir /dev/.secure_storage + chmod 0711 /dev/.secure_storage + chown system system /dev/.secure_storage + restorecon -R /dev/.secure_storage + start secure_storage + +# umount service +service umount_service /system/bin/umount -D /preload + disabled + oneshot + +# Support Preload install apks +on property:persist.sys.storage_preload=1 + mount ext4 /dev/block/platform/13540000.dwmmc0/by-name/HIDDEN /preload nosuid nodev ro barrier=1 + setprop storage.preload.complete 1 + +on property:persist.sys.storage_preload=0 + start umount_service + +# SSWAP +service sswap /vendor/bin/sswap -s + class core + user root + group root + oneshot + +# sem_daemon +service sem_daemon /system/bin/sem_daemon + class core + user system + group system nfc + disabled + +on property:sys.boot_completed=1 + setprop security.semdaemonfinish 0 + start sem_daemon + +on property:security.semdaemonfinish=1 + stop sem_daemon diff --git a/rootdir/etc/init.samsungexynos7870.usb.rc b/rootdir/etc/init.samsungexynos7870.usb.rc new file mode 100644 index 0000000..057daa0 --- /dev/null +++ b/rootdir/etc/init.samsungexynos7870.usb.rc @@ -0,0 +1,302 @@ +on init + write /sys/class/android_usb/android0/iSerial $ro.serialno + write /sys/class/android_usb/android0/f_rndis/manufacturer Samsung + write /sys/class/android_usb/android0/f_rndis/vendorID 04e8 + write /sys/class/android_usb/android0/f_rndis/wceis 1 + +on post-fs + mkdir /dev/usb-ffs 0770 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + write /sys/class/android_usb/android0/f_ffs/aliases adb + +on boot + write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer} + write /sys/class/android_usb/android0/iProduct ${ro.product.model} + write /sys/class/android_usb/android0/iSerial ${ro.serialno} + write /sys/class/android_usb/android0/f_mass_storage/inquiry_string "Samsung" + +on property:sys.usb.config=mtp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=midi + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 686C + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=midi,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 686C + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/functions ncm + write /sys/class/android_usb/android0/bDeviceClass 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ncm,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ncm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/functions ncm,adb + write /sys/class/android_usb/android0/bDeviceClass 2 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6863 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/bDeviceClass 224 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6865 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=ptp,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6866 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,dm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,acm,dm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,acm,dm,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,acm,dm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=acm,dm,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=acm,dm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=acm,dm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=sec_charging + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=sec_charging,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=sec_charging,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp,adb + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=vzw_charging + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=vzw_charging,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=vzw_charging,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions mtp,adb + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685B + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685e + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mass_storage,acm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 685e + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +# rndis,acm,diag and diag,acm,adb used for Hidden Menu + +on property:sys.usb.config=rndis,diag + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6862 + write /sys/class/android_usb/android0/f_diag/clients diag_mdm + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=dm,acm,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=dm,acm,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/f_diag/clients diag_mdm + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,acm + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 685d + write /sys/class/android_usb/android0/f_diag/clients diag_mdm + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + + +on property:sys.usb.config=rndis,acm,diag + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04E8 + write /sys/class/android_usb/android0/idProduct 6864 + write /sys/class/android_usb/android0/f_diag/clients diag_mdm + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,conn_gadget + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,conn_gadget,adb + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,conn_gadget,adb + write /sys/class/android_usb/android0/enable 0 + write /sys/class/android_usb/android0/idVendor 04e8 + write /sys/class/android_usb/android0/idProduct 6860 + write /sys/class/android_usb/android0/functions ${sys.usb.config} + write /sys/class/android_usb/android0/bDeviceClass 0 + write /sys/class/android_usb/android0/enable 1 + setprop sys.usb.state ${sys.usb.config} + diff --git a/rootdir/etc/init.wifi.rc b/rootdir/etc/init.wifi.rc new file mode 100644 index 0000000..09a9a39 --- /dev/null +++ b/rootdir/etc/init.wifi.rc @@ -0,0 +1,57 @@ +# Wi-Fi init file +on post-fs-data + mkdir /data/vendor/conn 0771 wifi root + mkdir /data/vendor/wifi 0771 wifi wifi + mkdir /data/vendor/wifi/wpa 0770 wifi wifi + mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi + mkdir /data/vendor/log/wifi 0770 wifi system + + # for WIFI TRP/TIS + chown wifi root /data/vendor/conn/.psm.info + chmod 0660 /data/vendor/conn/.psm.info + + # for WIFI Antenna Selection + chown wifi root /data/vendor/conn/.ant.info + chmod 0660 /data/vendor/conn/.ant.info + + # for WIFI Version + chown wifi root /data/vendor/conn/.wifiver.info + chmod 0664 /data/vendor/conn/.wifiver.info + + # for WIFI MEMDUMP + # The default value of below memdump file is set in SecProductFeature + #write /data/vendor/conn/.memdump.info 2 + chown wifi root /data/vendor/conn/.memdump.info + chmod 0660 /data/vendor/conn/.memdump.info + + # for WIFI hotspot + chown wifi root /data/vendor/conn/.softap.info + chmod 0664 /data/vendor/conn/.softap.info + chown system wifi /vendor/etc/wifi/indoorchannel.info + chmod 0664 /vendor/etc/wifi/indoorchannel.info + + # for WIFI MAC + chown wifi root /sys/wifi/mac_addr + chmod 0660 /sys/wifi/mac_addr + +on boot + setprop wifi.interface wlan0 + +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ + -O/data/vendor/wifi/wpa/sockets \ + -g@android:wpa_wlan0 + interface android.hardware.wifi.supplicant@1.0::ISupplicant default + interface android.hardware.wifi.supplicant@1.1::ISupplicant default + interface android.hardware.wifi.supplicant@1.2::ISupplicant default + interface android.hardware.wifi.supplicant@1.3::ISupplicant default + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +service macloader /vendor/bin/hw/macloader + class main + oneshot + +# end of WiFi MFG (TestMode) + diff --git a/rootdir/etc/twrp.fstab b/rootdir/etc/twrp.fstab new file mode 100644 index 0000000..28ccd9c --- /dev/null +++ b/rootdir/etc/twrp.fstab @@ -0,0 +1,14 @@ +/boot emmc /dev/block/platform/13540000.dwmmc0/by-name/BOOT +/recovery emmc /dev/block/platform/13540000.dwmmc0/by-name/RECOVERY flags=backup=1 +/system ext4 /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM +/data ext4 /dev/block/platform/13540000.dwmmc0/by-name/USERDATA flags=encryptable=footer;length=-20480 +/cache ext4 /dev/block/platform/13540000.dwmmc0/by-name/CACHE +/modem emmc /dev/block/platform/13540000.dwmmc0/by-name/RADIO flags=backup=1;display="Modem" +/modem-cdma emmc /dev/block/platform/13540000.dwmmc0/by-name/CDMA-RADIO flags=backup=1;display="CDMA Modem";subpartitionof=/modem +/efs ext4 /dev/block/platform/13540000.dwmmc0/by-name/EFS flags=backup=1;display="EFS" +/cpefs emmc /dev/block/platform/13540000.dwmmc0/by-name/CPEFS flags=backup=1;display="CPEFS";subpartitionof=/efs +/m9kefs1 emmc /dev/block/platform/13540000.dwmmc0/by-name/m9kefs1 flags=backup=1;subpartitionof=/efs +/m9kefs2 emmc /dev/block/platform/13540000.dwmmc0/by-name/m9kefs2 flags=backup=1;subpartitionof=/efs +/m9kefs3 emmc /dev/block/platform/13540000.dwmmc0/by-name/m9kefs3 flags=backup=1;subpartitionof=/efs +/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDcard";storage;wipeingui;removable +/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable diff --git a/rootdir/etc/ueventd.samsungexynos7870.rc b/rootdir/etc/ueventd.samsungexynos7870.rc new file mode 100644 index 0000000..896388b --- /dev/null +++ b/rootdir/etc/ueventd.samsungexynos7870.rc @@ -0,0 +1,268 @@ +# ueventd can only set permissions on device nodes and their associated +# sysfs attributes, not on arbitrary paths. +# +# format for /dev rules: devname mode uid gid +# format for /sys rules: nodename attr mode uid gid +# shortcut: "mtd@NN" expands to "/dev/mtd/mtdNN" + +/dev/null 0666 root root +/dev/zero 0666 root root +/dev/full 0666 root root +/dev/ptmx 0666 root root +/dev/tty 0666 root root +/dev/random 0666 root root +/dev/urandom 0666 root root +# Make HW RNG readable by group system to let EntropyMixer read it. +/dev/hw_random 0440 root system +/dev/ashmem 0666 root root +/dev/binder 0666 root root +/dev/hwbinder 0666 root root +/dev/vndbinder 0666 root root +/dev/ovr* 0664 root system +/dev/tvr* 0664 root system +/dev/pmsg0 0222 root log + +# the msm hw3d client device node is world writable/readable. +/dev/msm_hw3dc 0666 root root + +# gpu driver for adreno200 is globally accessible +/dev/kgsl 0666 root root + +# kms driver for drm based gpu +/dev/dri/* 0666 root graphics + +# these should not be world writable +/dev/diag 0660 radio radio +/dev/diag_arm9 0660 radio radio +/dev/ttyMSM0 0600 bluetooth bluetooth +/dev/uhid 0660 uhid uhid +/dev/uinput 0660 system bluetooth +/dev/alarm 0664 system radio +/dev/power_on_alarm 0660 system radio +/dev/rtc0 0660 system system +/dev/tty0 0660 root system +/dev/ttySAC0 0660 root radio +/dev/graphics/* 0660 root graphics +/dev/msm_hw3dm 0660 system graphics +/dev/input/* 0660 root input +/dev/v4l-touch* 0660 root input +/dev/eac 0660 root audio +/dev/cam 0660 root camera +/dev/pmem 0660 system graphics +/dev/pmem_adsp* 0660 system audio +/dev/pmem_camera* 0660 system camera +/dev/oncrpc/* 0660 root system +/dev/adsp/* 0660 system audio +/dev/snd/* 0660 system audio +/dev/mt9t013 0660 system system +/dev/msm_camera/* 0660 system system +/dev/akm8976_daemon 0640 compass system +/dev/akm8976_aot 0640 compass system +/dev/akm8973_daemon 0640 compass system +/dev/akm8973_aot 0640 compass system +/dev/bma150 0640 compass system +/dev/cm3602 0640 compass system +/dev/akm8976_pffd 0640 compass system +/dev/lightsensor 0640 system system +/dev/msm_pcm_out* 0660 system audio +/dev/msm_pcm_in* 0660 system audio +/dev/msm_pcm_ctl* 0660 system audio +/dev/msm_snd* 0660 system audio +/dev/msm_mp3* 0660 system audio +/dev/audience_a1026* 0660 system audio +/dev/tpa2018d1* 0660 system audio +/dev/msm_audpre 0660 system audio +/dev/msm_audio_ctl 0660 system audio +/dev/htc-acoustic 0660 system audio +/dev/vdec 0660 system audio +/dev/q6venc 0660 system audio +/dev/snd/dsp 0660 system audio +/dev/snd/dsp1 0660 system audio +/dev/snd/mixer 0660 system audio +/dev/smd0 0640 radio radio +/dev/qmi 0640 radio radio +/dev/qmi0 0640 radio radio +/dev/qmi1 0640 radio radio +/dev/qmi2 0640 radio radio +/dev/bus/usb/* 0660 root usb +/dev/mtp_usb 0660 root mtp +/dev/usb_accessory 0660 root usb +/dev/tun 0660 system vpn +/dev/input/event* 0660 system input + +# CDMA radio interface MUX +/dev/ts0710mux* 0640 radio radio +/dev/ppp 0660 radio vpn + +# sysfs properties +/sys/devices/platform/trusty.* trusty_version 0440 root log +/sys/devices/virtual/input/input* enable 0660 system input +/sys/devices/virtual/input/input* poll_delay 0660 system input +/sys/devices/virtual/usb_composite/* enable 0664 root system +/sys/devices/system/cpu/cpu* cpufreq/scaling_max_freq 0664 system system +/sys/devices/system/cpu/cpu* cpufreq/scaling_min_freq 0664 system system + +# MobiCore +/dev/mobicore 0700 system system +/dev/mobicore-user 0666 radio system + +# Secure MEM driver +/dev/s5p-smem 0660 system system + +# Fingerprint Sensor +/dev/vfsspi 0660 system system +/dev/esfp0 0660 system system +/dev/goodix_fp 0660 system system +/dev/qbt2000_fd 0660 system system +/dev/qbt2000_ipc 0660 system system +/dev/qbtspi 0660 system system + +# DVB API device nodes +/dev/dvb* 0660 root system + +# USB +/dev/ttyGS* 0660 system system + +# MPSD +/dev/mpsd 0660 system system + +/dev/mali0 0666 system system +/dev/ion 0666 system system +/dev/ump 0666 system graphics +/dev/exynos-mem 0660 system graphics +/dev/video0 0660 system camera +/dev/video1 0660 system camera +/dev/video2 0660 system camera +/dev/video3 0660 system camera +/dev/video20 0660 system system +# media0 is used for GSC, DECON, etc +/dev/media0 0660 system camera +# media1 is used for DECON Ext WB +/dev/media1 0660 system graphics +# Various devices use the v4l-subdev interface +# We declare all such nodes simultaneously here +/dev/v4l-subdev0 0660 system camera +/dev/v4l-subdev1 0660 system camera +/dev/v4l-subdev2 0660 system camera +/dev/v4l-subdev3 0660 system camera +/dev/v4l-subdev4 0660 system camera +/dev/v4l-subdev5 0660 system camera +/dev/v4l-subdev6 0660 system camera +/dev/v4l-subdev7 0660 system camera +/dev/v4l-subdev8 0660 system camera +/dev/v4l-subdev9 0660 system camera +/dev/v4l-subdev10 0660 system camera +/dev/v4l-subdev11 0660 system camera +/dev/v4l-subdev12 0660 system camera +/dev/v4l-subdev13 0660 system camera +/dev/v4l-subdev14 0660 system camera +/dev/v4l-subdev15 0660 system camera +/dev/v4l-subdev16 0660 system camera +/dev/v4l-subdev17 0660 system camera +/dev/v4l-subdev18 0660 system camera +/dev/v4l-subdev19 0660 system camera +# v4l-subdev20 is used for DECON Ext WB +/dev/v4l-subdev20 0660 system graphics +/dev/v4l-subdev21 0660 system graphics + +# gscalers +/dev/video23 0660 media graphics +/dev/video26 0660 media graphics +/dev/video24 0660 media graphics +/dev/video27 0660 media graphics +/dev/video29 0660 media graphics +/dev/video30 0660 media graphics +# video31 is used for DECON Ext WB +/dev/video31 0660 media graphics + +# mscalers +/dev/video50 0660 mediacodec drmrpc +/dev/video51 0660 media graphics +/dev/m2m1shot_scaler0 0660 mediacodec drmrpc +/dev/m2m1shot_scaler1 0660 cameraserver cameraserver + +/dev/video55 0666 system graphics +/dev/fimg2d 0666 system graphics +/dev/i2c-2 0660 system system +/dev/HPD 0660 system system + +# mfc +/dev/video6 0660 mediacodec mediadrm +/dev/video7 0660 mediacodec mediadrm +/dev/video8 0660 mediacodec mediadrm +/dev/video9 0660 mediacodec mediadrm + +# camera +/dev/video100 0660 cameraserver camera +/dev/video101 0660 cameraserver camera +/dev/video102 0660 cameraserver camera +/dev/video103 0660 cameraserver camera +/dev/video104 0660 cameraserver camera +/dev/video109 0660 cameraserver camera +/dev/video110 0660 cameraserver camera +/dev/video111 0660 cameraserver camera +/dev/video112 0660 cameraserver camera +/dev/video120 0660 cameraserver camera +/dev/video121 0660 cameraserver camera +/dev/video122 0660 cameraserver camera +/dev/video130 0660 cameraserver camera +/dev/video131 0660 cameraserver camera +/dev/video132 0660 cameraserver camera +/dev/video140 0660 cameraserver camera +/dev/video141 0660 cameraserver camera +/dev/video142 0660 cameraserver camera +/dev/video150 0660 cameraserver camera +/dev/video151 0660 cameraserver camera +/dev/video152 0660 cameraserver camera +/dev/video160 0660 cameraserver camera +/dev/media2 0660 media media + +# hevc +/dev/video10 0660 media media +/dev/video11 0660 media media + +# jpeg +/dev/video12 0660 cameraserver media + +# audio +/dev/seiren 0660 system audio + +# Secure MEM driver +/dev/s5p-smem 0660 system system + +# cbd modem block +/dev/block/mmcblk0p5 0400 radio system + +# Modem Interface +/dev/block/platform/13540000.dwmmc0/by-name/RADIO 0660 system radio +/dev/block/platform/13540000.dwmmc0/by-name/CP_DEBUG 0660 radio system +/dev/umts* 0660 system radio +/dev/umts_csd 0660 system loop_radio +/dev/smd4 0660 system radio +/dev/umts_ciq* 0660 system bridge_rw + +# SIPC RIL +/dev/umts_boot0 0660 radio radio +/dev/umts_ipc0 0660 radio radio +/dev/umts_ipc1 0660 radio radio +/dev/umts_rfs0 0660 radio radio + +# interactive governor parameters +/sys/devices/system/cpu/cpu* cpufreq/interactive/timer_rate 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/timer_slack 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/min_sample_time 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/hispeed_freq 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/target_loads 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/go_hispeed_load 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/above_hispeed_delay 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boost 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse 0200 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/input_boost 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse_duration 0660 system system +/sys/devices/system/cpu/cpu* cpufreq/interactive/io_is_busy 0660 system system + +# Google FRP solution +/dev/block/platform/13540000.dwmmc0/by-name/PERSISTENT 0660 system system + +# Reactivation Lock +/dev/block/platform/13540000.dwmmc0/by-name/STEADY 0660 system system diff --git a/seccomp/mediacodec-seccomp.policy b/seccomp/mediacodec-seccomp.policy new file mode 100644 index 0000000..3bf11a3 --- /dev/null +++ b/seccomp/mediacodec-seccomp.policy @@ -0,0 +1,19 @@ +# device specific syscalls +# extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy +pselect6: 1 +eventfd2: 1 +sendto: 1 +recvfrom: 1 +_llseek: 1 +sysinfo: 1 +getcwd: 1 +getdents64: 1 +ARM_cacheflush: 1 +inotify_init1: 1 +inotify_add_watch: 1 +inotify_rm_watch: 1 +uname: 1 +ueventd: 1 +timer_create: 1 +timer_settime: 1 +rt_sigtimedwait: 1 diff --git a/seccomp/mediaextractor-seccomp.policy b/seccomp/mediaextractor-seccomp.policy new file mode 100644 index 0000000..0fcf604 --- /dev/null +++ b/seccomp/mediaextractor-seccomp.policy @@ -0,0 +1,5 @@ +# device specific syscalls. +# extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy +readlinkat: 1 +pread64: 1 +mremap: 1 diff --git a/sepolicy_minimal/file.te b/sepolicy_minimal/file.te new file mode 100644 index 0000000..e81d445 --- /dev/null +++ b/sepolicy_minimal/file.te @@ -0,0 +1,3 @@ +type sec_efs_file, file_type; + + diff --git a/sepolicy_minimal/file_contexts b/sepolicy_minimal/file_contexts new file mode 100644 index 0000000..b1cd761 --- /dev/null +++ b/sepolicy_minimal/file_contexts @@ -0,0 +1,3 @@ +/cpefs(/.*)? u:object_r:sec_efs_file:s0 + + diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100644 index 0000000..ee221e4 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Copyright (C) 2017-2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +set -e + +VENDOR=samsung +DEVICE=universal7870-common + +export INITIAL_COPYRIGHT_YEAR=2017 + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}/../../.." + +HELPER="${AOSP_ROOT}/vendor/aosp/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper +setup_vendor "${DEVICE}" "${VENDOR}" "${AOSP_ROOT}" + +# Copyright headers and guards +write_headers "universal7870-common" + +# The standard blobs +write_makefiles "${MY_DIR}/proprietary-files.txt" true + +# Finish +write_footers diff --git a/shims/Android.mk b/shims/Android.mk new file mode 100644 index 0000000..60d3a2c --- /dev/null +++ b/shims/Android.mk @@ -0,0 +1,20 @@ +# +# +# Copyright (C) 2016 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +include $(call all-subdir-makefiles,$(LOCAL_PATH)) diff --git a/shims/libexynoscamera/Android.mk b/shims/libexynoscamera/Android.mk new file mode 100644 index 0000000..058ceb2 --- /dev/null +++ b/shims/libexynoscamera/Android.mk @@ -0,0 +1,27 @@ +# +# Copyright (C) 2019 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES := CameraParameters.cpp GraphicBuffer.cpp +LOCAL_C_INCLUDES := frameworks/native/include +LOCAL_SHARED_LIBRARIES := libui libutils +LOCAL_MODULE := libexynoscamera_shim +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_VENDOR_MODULE := true + +include $(BUILD_SHARED_LIBRARY) diff --git a/shims/libexynoscamera/CameraParameters.cpp b/shims/libexynoscamera/CameraParameters.cpp new file mode 100644 index 0000000..5b4fbec --- /dev/null +++ b/shims/libexynoscamera/CameraParameters.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2018 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "CameraParameters.h" + +namespace android { + +const char CameraParameters::PIXEL_FORMAT_YUV420SP_NV21[] = "nv21"; +const char CameraParameters::EFFECT_CARTOONIZE[] = "cartoonize"; +const char CameraParameters::EFFECT_POINT_RED_YELLOW[] = "point-red-yellow"; +const char CameraParameters::EFFECT_POINT_GREEN[] = "point-green"; +const char CameraParameters::EFFECT_POINT_BLUE[] = "point-blue"; +const char CameraParameters::EFFECT_VINTAGE_COLD[] = "vintage-cold"; +const char CameraParameters::EFFECT_VINTAGE_WARM[] = "vintage-warm"; +const char CameraParameters::EFFECT_WASHED[] = "washed"; +const char CameraParameters::ISO_AUTO[] = "auto"; +const char CameraParameters::ISO_NIGHT[] = "night"; +const char CameraParameters::ISO_SPORTS[] = "sports"; +const char CameraParameters::ISO_1600[] = "1600"; +const char CameraParameters::ISO_800[] = "800"; +const char CameraParameters::ISO_400[] = "400"; +const char CameraParameters::ISO_200[] = "200"; +const char CameraParameters::ISO_100[] = "100"; +const char CameraParameters::ISO_80[] = "80"; +const char CameraParameters::ISO_50[] = "50"; +const char CameraParameters::KEY_SUPPORTED_METERING_MODE[] = "metering-values"; +const char CameraParameters::METERING_CENTER[] = "center"; +const char CameraParameters::METERING_MATRIX[] = "matrix"; +const char CameraParameters::METERING_SPOT[] = "spot"; +const char CameraParameters::METERING_OFF[] = "off"; +const char CameraParameters::KEY_DYNAMIC_RANGE_CONTROL[] = "dynamic-range-control"; +const char CameraParameters::KEY_SUPPORTED_PHASE_AF[] = "phase-af-values"; +const char CameraParameters::KEY_PHASE_AF[] = "phase-af"; +const char CameraParameters::KEY_SUPPORTED_RT_HDR[] = "rt-hdr-values"; +const char CameraParameters::KEY_RT_HDR[] = "rt-hdr"; + +}; // namespace android diff --git a/shims/libexynoscamera/CameraParameters.h b/shims/libexynoscamera/CameraParameters.h new file mode 100644 index 0000000..292723b --- /dev/null +++ b/shims/libexynoscamera/CameraParameters.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2018 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace android { + +class CameraParameters +{ +public: + static const char PIXEL_FORMAT_YUV420SP_NV21[]; + static const char EFFECT_CARTOONIZE[]; + static const char EFFECT_POINT_RED_YELLOW[]; + static const char EFFECT_POINT_GREEN[]; + static const char EFFECT_POINT_BLUE[]; + static const char EFFECT_VINTAGE_COLD[]; + static const char EFFECT_VINTAGE_WARM[]; + static const char EFFECT_WASHED[]; + static const char ISO_AUTO[]; + static const char ISO_NIGHT[]; + static const char ISO_SPORTS[]; + static const char ISO_1600[]; + static const char ISO_800[]; + static const char ISO_400[]; + static const char ISO_200[]; + static const char ISO_100[]; + static const char ISO_80[]; + static const char ISO_50[]; + static const char KEY_SUPPORTED_METERING_MODE[]; + static const char METERING_CENTER[]; + static const char METERING_MATRIX[]; + static const char METERING_SPOT[]; + static const char METERING_OFF[]; + static const char KEY_DYNAMIC_RANGE_CONTROL[]; + static const char KEY_SUPPORTED_PHASE_AF[]; + static const char KEY_PHASE_AF[]; + static const char KEY_SUPPORTED_RT_HDR[]; + static const char KEY_RT_HDR[]; +}; + +}; // namespace android diff --git a/shims/libexynoscamera/GraphicBuffer.cpp b/shims/libexynoscamera/GraphicBuffer.cpp new file mode 100644 index 0000000..85b8d8d --- /dev/null +++ b/shims/libexynoscamera/GraphicBuffer.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2018 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +extern "C" void _ZN7android5FenceD1Ev() { +} diff --git a/shims/libstagefright/Android.mk b/shims/libstagefright/Android.mk new file mode 100644 index 0000000..10050ee --- /dev/null +++ b/shims/libstagefright/Android.mk @@ -0,0 +1,46 @@ +# +# Copyright (C) 2018 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES := CameraSource.cpp + +LOCAL_C_INCLUDES := \ + $(TOP)/frameworks/av/include \ + $(TOP)/frameworks/av/media/ndk/include \ + $(TOP)/frameworks/native/include \ + $(TOP)/frameworks/native/include/gui \ + $(TOP)/frameworks/native/include/media/hardware \ + $(TOP)/frameworks/native/include/media/openmax \ + $(TOP)/frameworks/native/libs/arect/include \ + $(TOP)/frameworks/native/libs/nativebase/include \ + $(TOP)/frameworks/native/libs/nativewindow/include \ + $(TOP)/frameworks/native/opengl/include \ + $(TOP)/hardware/libhardware/include \ + $(TOP)/hardware/interfaces/graphics/bufferqueue/2.0 + +LOCAL_SHARED_LIBRARIES := \ + android.hardware.graphics.bufferqueue@1.0 \ + android.hidl.token@1.0-utils \ + libbase \ + liblog + +LOCAL_MODULE := libstagefright_shim +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_VENDOR_MODULE := true + +include $(BUILD_SHARED_LIBRARY) diff --git a/shims/libstagefright/CameraSource.cpp b/shims/libstagefright/CameraSource.cpp new file mode 100644 index 0000000..39aa076 --- /dev/null +++ b/shims/libstagefright/CameraSource.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2018 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//#define LOG_NDEBUG 0 +#define LOG_TAG "libstagefright_shim" +#include + +#include +#include +#include + +namespace android { + +static const char PIXEL_FORMAT_YUV420SP_NV21[] = "nv21"; + +static int32_t getColorFormat(const char* colorFormat) { + if (!colorFormat) { + ALOGE("Invalid color format"); + return -1; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420P)) { + return OMX_COLOR_FormatYUV420Planar; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV422SP)) { + return OMX_COLOR_FormatYUV422SemiPlanar; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420SP)) { + return OMX_COLOR_FormatYUV420SemiPlanar; + } + + if (!strcmp(colorFormat, PIXEL_FORMAT_YUV420SP_NV21)) { + static const int OMX_SEC_COLOR_FormatNV21Linear = 0x7F000011; + return OMX_SEC_COLOR_FormatNV21Linear; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV422I)) { + return OMX_COLOR_FormatYCbYCr; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_RGB565)) { + return OMX_COLOR_Format16bitRGB565; + } + + if (!strcmp(colorFormat, "OMX_TI_COLOR_FormatYUV420PackedSemiPlanar")) { + return OMX_TI_COLOR_FormatYUV420PackedSemiPlanar; + } + + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_ANDROID_OPAQUE)) { + return OMX_COLOR_FormatAndroidOpaque; + } + + if (!strcmp(colorFormat, "YVU420SemiPlanar")) { + return OMX_QCOM_COLOR_FormatYVU420SemiPlanar; + } + + ALOGE("Uknown color format (%s), please add it to " + "CameraSource::getColorFormat", colorFormat); + + //CHECK(!"Unknown color format"); + return -1; +} + + +/* + * Check whether the camera has the supported color format + * @param params CameraParameters to retrieve the information + * @return OK if no error. + */ +status_t CameraSource::isCameraColorFormatSupported( + const CameraParameters& params) { + ALOGW("SHIM: hijacking %s!", __func__); + + mColorFormat = getColorFormat(params.get( + CameraParameters::KEY_VIDEO_FRAME_FORMAT)); + if (mColorFormat == -1) { + return BAD_VALUE; + } + return OK; +} + +} // namespace android diff --git a/vendor_prop.mk b/vendor_prop.mk new file mode 100644 index 0000000..624b2ee --- /dev/null +++ b/vendor_prop.mk @@ -0,0 +1,77 @@ +# Low memory optimization +ro.config.low_ram=true + +# Audio +PRODUCT_PROPERTY_OVERRIDES += \ + af.fast_track_multiplier=1 \ + audio_hal.force_voice_config=wide + +# Bluetooth +PRODUCT_PROPERTY_OVERRIDES += \ + ro.bt.bdaddr_path=/efs/bluetooth/bt_addr + +# Dalvik/Art +PRODUCT_PROPERTY_OVERRIDES += \ + dalvik.vm.dex2oat-filter=speed \ + dalvik.vm.image-dex2oat-filter=speed \ + ro.sys.fw.dex2oat_thread_count=8 \ + dalvik.vm.boot-dex2oat-threads=8 \ + dalvik.vm.dex2oat-threads=8 \ + dalvik.vm.heapstartsize=8m \ + dalvik.vm.heapgrowthlimit=192m \ + dalvik.vm.heapsize=512m \ + dalvik.vm.heaptargetutilization=0.75 \ + dalvik.vm.heapminfree=512k \ + dalvik.vm.heapmaxfree=8m + +# Graphics +PRODUCT_PROPERTY_OVERRIDES += \ + ro.opengles.version=196610 \ + debug.hwc.skip_dma_types=0,2 \ + debug.hwc.force_gpu=1 \ + debug.sf.enable_hwc_vds=1 \ + debug.sf.latch_unsignaled=1 + +# ro.product.first_api_level indicates the first api level the device has commercially launched on. +PRODUCT_PROPERTY_OVERRIDES += \ + ro.product.first_api_level=23 + +# Nfc +PRODUCT_PROPERTY_OVERRIDES += \ + ro.nfc.port=I2C \ + ro.nfc.sec_hal=true + +# Boot directly from charger mode +PRODUCT_PROPERTY_OVERRIDES += \ + ro.enable_boot_charger_mode=1 + +# Radio +PRODUCT_PROPERTY_OVERRIDES += \ + persist.radio.sib16_support=0 \ + ro.ril.hsxpa=1 \ + ro.ril.gprsclass=10 \ + ro.ril.telephony.mqanelements=6 \ + ro.telephony.default_network=9 \ + ro.telephony.get_imsi_from_sim=true \ + ro.ril.force_eri_from_xml=true \ + persist.radio.add_power_save=1 \ + persist.radio.apm_sim_not_pwdn=1 \ + ro.smps.enable=true \ + telephony.lteOnCdmaDevice=0 \ + +# read DS/SS property +PRODUCT_PROPERTY_OVERRIDES += \ + import /efs/factory.prop + +#Treble +PRODUCT_PROPERTY_OVERRIDES += \ + persist.media.treble_omx=true + +# sdcardfs +PRODUCT_PROPERTY_OVERRIDES += \ + ro.sys.sdcardfs=true + +# Wifi +PRODUCT_PROPERTY_OVERRIDES += \ + wifi.interface=wlan0 \ + net.tethering.noprovisioning=true