msm8953-common: Initial Common tree
* based on motorola sdm632-common Co-authored-by: Jorg3Lucas <jorgelucas@pixelexperience.org>
This commit is contained in:
2
Android.bp
Normal file
2
Android.bp
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
soong_namespace {
|
||||||
|
}
|
||||||
127
Android.mk
Normal file
127
Android.mk
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
# Copyright (C) 2020 The LineageOS Project
|
||||||
|
# Copyright (C) 2020 The PixelExperience 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 ali sanders,$(TARGET_DEVICE)),)
|
||||||
|
|
||||||
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt
|
||||||
|
BT_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/bt_firmware
|
||||||
|
DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp
|
||||||
|
FSG_MOUNT_POINT := $(TARGET_OUT_VENDOR)/fsg
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) \
|
||||||
|
$(BT_FIRMWARE_MOUNT_POINT) \
|
||||||
|
$(DSP_MOUNT_POINT) \
|
||||||
|
$(FSG_MOUNT_POINT)
|
||||||
|
|
||||||
|
$(FIRMWARE_MOUNT_POINT):
|
||||||
|
@echo "Creating $(FIRMWARE_MOUNT_POINT)"
|
||||||
|
@mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt
|
||||||
|
|
||||||
|
$(BT_FIRMWARE_MOUNT_POINT):
|
||||||
|
@echo "Creating $(BT_FIRMWARE_MOUNT_POINT)"
|
||||||
|
@mkdir -p $(TARGET_OUT_VENDOR)/bt_firmware
|
||||||
|
|
||||||
|
$(DSP_MOUNT_POINT):
|
||||||
|
@echo "Creating $(DSP_MOUNT_POINT)"
|
||||||
|
@mkdir -p $(TARGET_OUT_VENDOR)/dsp
|
||||||
|
|
||||||
|
$(FSG_MOUNT_POINT):
|
||||||
|
@echo "Creating $(FSG_MOUNT_POINT)"
|
||||||
|
@mkdir -p $(TARGET_OUT_VENDOR)/fsg
|
||||||
|
|
||||||
|
DSP_SYMLINK := $(TARGET_OUT_VENDOR)/lib/dsp
|
||||||
|
$(DSP_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Creating DSP folder symlink: $@"
|
||||||
|
@rm -rf $@
|
||||||
|
$(hide) ln -sf /vendor/dsp $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(DSP_SYMLINK)
|
||||||
|
|
||||||
|
IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so
|
||||||
|
IMS_SYMLINKS := $(addprefix $(TARGET_OUT_PRODUCT_APPS_PRIVILEGED)/ims/lib/arm64/,$(notdir $(IMS_LIBS)))
|
||||||
|
$(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "IMS lib link: $@"
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@rm -rf $@
|
||||||
|
$(hide) ln -sf /system/product/lib64/$(notdir $@) $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
||||||
|
|
||||||
|
RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/
|
||||||
|
$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Creating RFS MSM ADSP folder structure: $@"
|
||||||
|
@rm -rf $@/*
|
||||||
|
@mkdir -p $(dir $@)/readonly/vendor
|
||||||
|
$(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/adsp $@/readwrite
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||||
|
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||||
|
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||||
|
|
||||||
|
RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/
|
||||||
|
$(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Creating RFS MSM SLPI folder structure: $@"
|
||||||
|
@rm -rf $@/*
|
||||||
|
@mkdir -p $(dir $@)/readonly/vendor
|
||||||
|
$(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/slpi $@/readwrite
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||||
|
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||||
|
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||||
|
|
||||||
|
RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/
|
||||||
|
$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Creating RFS MSM MPSS folder structure: $@"
|
||||||
|
@rm -rf $@/*
|
||||||
|
@mkdir -p $(dir $@)/readonly/vendor
|
||||||
|
$(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/msm/mpss $@/readwrite
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared
|
||||||
|
$(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos
|
||||||
|
$(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware
|
||||||
|
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(RFS_MSM_ADSP_SYMLINKS) $(RFS_MSM_MPSS_SYMLINKS) $(RFS_MSM_SLPI_SYMLINKS)
|
||||||
|
|
||||||
|
EGL_SYMLINK := $(TARGET_OUT_VENDOR)/lib/libGLESv2_adreno.so
|
||||||
|
$(EGL_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(hide) ln -sf egl/$(notdir $@) $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(EGL_SYMLINK)
|
||||||
|
|
||||||
|
WIFI_SYMLINKS := $(TARGET_OUT_VENDOR)/firmware/wlan/prima/
|
||||||
|
$(WIFI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Creating WCNSS Symlinks: $@"
|
||||||
|
@rm -rf $@/*
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_wlan_nv.bin $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_wlan_nv_Argentina.bin $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_wlan_nv_Brazil.bin $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_wlan_nv_India.bin $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_qcom_wlan_nv_epa.bin $(dir $@)
|
||||||
|
$(hide) ln -sf /vendor/etc/wifi/WCNSS_wlan_dictionary.dat $(dir $@)
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(WIFI_SYMLINKS)
|
||||||
|
|
||||||
|
endif
|
||||||
223
BoardConfigCommon.mk
Normal file
223
BoardConfigCommon.mk
Normal file
@@ -0,0 +1,223 @@
|
|||||||
|
# Copyright (C) 2020 The LineageOS Project
|
||||||
|
# Copyright (C) 2020 The PixelExperience 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.
|
||||||
|
|
||||||
|
COMMON_PATH := device/motorola/msm8953-common
|
||||||
|
|
||||||
|
TARGET_SPECIFIC_HEADER_PATH := $(COMMON_PATH)/include
|
||||||
|
|
||||||
|
BOARD_VENDOR := motorola
|
||||||
|
|
||||||
|
# Architecture
|
||||||
|
TARGET_ARCH := arm64
|
||||||
|
TARGET_ARCH_VARIANT := armv8-a
|
||||||
|
TARGET_CPU_ABI := arm64-v8a
|
||||||
|
TARGET_CPU_ABI2 :=
|
||||||
|
TARGET_CPU_VARIANT := generic
|
||||||
|
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 := generic
|
||||||
|
TARGET_2ND_CPU_VARIANT_RUNTIME := cortex-a53
|
||||||
|
|
||||||
|
# Platform
|
||||||
|
BOARD_USES_QCOM_HARDWARE := true
|
||||||
|
TARGET_BOOTLOADER_BOARD_NAME := msm8953
|
||||||
|
TARGET_BOARD_PLATFORM := msm8953
|
||||||
|
TARGET_BOARD_PLATFORM_GPU := qcom-adreno506
|
||||||
|
TARGET_NO_BOOTLOADER := true
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
|
||||||
|
BOARD_USES_ALSA_AUDIO := true
|
||||||
|
BOARD_SUPPORTS_SOUND_TRIGGER_HAL := true
|
||||||
|
DTS_CODEC_M_ := true
|
||||||
|
MM_AUDIO_ENABLED_FTM := true
|
||||||
|
MM_AUDIO_ENABLED_SAFX := true
|
||||||
|
TARGET_USES_QCOM_MM_AUDIO := true
|
||||||
|
USE_XML_AUDIO_POLICY_CONF := 1
|
||||||
|
|
||||||
|
# Audio Features
|
||||||
|
AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
|
||||||
|
AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE := false
|
||||||
|
AUDIO_FEATURE_ENABLED_CUSTOMSTEREO := true
|
||||||
|
AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
|
||||||
|
AUDIO_FEATURE_ENABLED_DEV_ARBI := false
|
||||||
|
AUDIO_FEATURE_ENABLED_DTS_EAGLE := false
|
||||||
|
AUDIO_FEATURE_ENABLED_DLKM := false
|
||||||
|
AUDIO_FEATURE_ENABLED_EXT_HDMI := true
|
||||||
|
AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER := true
|
||||||
|
AUDIO_FEATURE_ENABLED_EXTN_RESAMPLER := true
|
||||||
|
AUDIO_FEATURE_ENABLED_FLUENCE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
|
||||||
|
AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_HFP := true
|
||||||
|
AUDIO_FEATURE_ENABLED_HIFI_AUDIO := true
|
||||||
|
AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
|
||||||
|
AUDIO_FEATURE_ENABLED_HDMI_EDID := true
|
||||||
|
AUDIO_FEATURE_ENABLED_HDMI_SPK := true
|
||||||
|
AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
|
||||||
|
AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
|
||||||
|
AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
|
||||||
|
AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
|
||||||
|
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_SND_MONITOR := true
|
||||||
|
AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true
|
||||||
|
AUDIO_FEATURE_ENABLED_SPKR_PROTECTION := true
|
||||||
|
AUDIO_FEATURE_ENABLED_SOURCE_TRACKING := true
|
||||||
|
AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD := true
|
||||||
|
AUDIO_FEATURE_ENABLED_VBAT_MONITOR := true
|
||||||
|
AUDIO_FEATURE_ENABLED_WMA_OFFLOAD := true
|
||||||
|
|
||||||
|
# Build
|
||||||
|
BUILD_BROKEN_DUP_RULES := true
|
||||||
|
BUILD_BROKEN_PHONY_TARGETS := true
|
||||||
|
|
||||||
|
# Bluetooth
|
||||||
|
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth
|
||||||
|
BOARD_HAVE_BLUETOOTH := true
|
||||||
|
BOARD_HAVE_BLUETOOTH_QCOM := true
|
||||||
|
|
||||||
|
# Camera
|
||||||
|
USE_CAMERA_STUB := true
|
||||||
|
TARGET_USES_QTI_CAMERA_DEVICE := true
|
||||||
|
|
||||||
|
# Charger
|
||||||
|
BACKLIGHT_PATH := /sys/class/leds/lcd-backlight/brightness
|
||||||
|
BOARD_CHARGER_ENABLE_SUSPEND := true
|
||||||
|
BOARD_NO_CHARGER_LED := true
|
||||||
|
|
||||||
|
# Crypto
|
||||||
|
TARGET_HW_DISK_ENCRYPTION := true
|
||||||
|
|
||||||
|
# Display
|
||||||
|
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
|
||||||
|
TARGET_USES_ION := true
|
||||||
|
TARGET_USES_NEW_ION_API :=true
|
||||||
|
TARGET_USES_HWC2 := true
|
||||||
|
TARGET_USES_GRALLOC1 := true
|
||||||
|
|
||||||
|
USE_OPENGL_RENDERER := true
|
||||||
|
|
||||||
|
# DRM
|
||||||
|
TARGET_ENABLE_MEDIADRM_64 := true
|
||||||
|
|
||||||
|
# Enable dexpreopt to speed boot time
|
||||||
|
ifeq ($(HOST_OS),linux)
|
||||||
|
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
||||||
|
ifeq ($(WITH_DEXPREOPT),)
|
||||||
|
WITH_DEXPREOPT := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# FM
|
||||||
|
BOARD_HAVE_QCOM_FM := true
|
||||||
|
TARGET_QCOM_NO_FM_FIRMWARE := true
|
||||||
|
|
||||||
|
# GPS
|
||||||
|
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
|
||||||
|
TARGET_NO_RPC := true
|
||||||
|
USE_DEVICE_SPECIFIC_GPS := true
|
||||||
|
|
||||||
|
# HIDL
|
||||||
|
DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml
|
||||||
|
DEVICE_MATRIX_FILE := $(COMMON_PATH)/compatibility_matrix.xml
|
||||||
|
TARGET_FS_CONFIG_GEN := \
|
||||||
|
$(COMMON_PATH)/configs/config.fs \
|
||||||
|
$(COMMON_PATH)/configs/mot_aids.fs
|
||||||
|
|
||||||
|
# Kernel
|
||||||
|
TARGET_COMPILE_WITH_MSM_KERNEL := true
|
||||||
|
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci firmware_class.path=/vendor/firmware_mnt/image loop.max_part=16
|
||||||
|
BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive
|
||||||
|
BOARD_KERNEL_BASE := 0x80000000
|
||||||
|
BOARD_KERNEL_PAGESIZE := 2048
|
||||||
|
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
|
||||||
|
BOARD_RAMDISK_OFFSET := 0x01000000
|
||||||
|
TARGET_KERNEL_ARCH := arm64
|
||||||
|
TARGET_KERNEL_HEADER_ARCH := arm64
|
||||||
|
TARGET_KERNEL_SOURCE := kernel/motorola/msm8953
|
||||||
|
TARGET_KERNEL_CLANG_COMPILE := true
|
||||||
|
|
||||||
|
# Lights
|
||||||
|
TARGET_PROVIDES_LIBLIGHT := true
|
||||||
|
|
||||||
|
# Partitions
|
||||||
|
BOARD_FLASH_BLOCK_SIZE := 131072
|
||||||
|
BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
|
||||||
|
BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4
|
||||||
|
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||||
|
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||||
|
TARGET_EXFAT_DRIVER := exfat
|
||||||
|
TARGET_USERIMAGES_USE_F2FS := true
|
||||||
|
TARGET_USES_MKE2FS := true
|
||||||
|
TARGET_COPY_OUT_VENDOR := vendor
|
||||||
|
TARGET_COPY_OUT_PRODUCT := system/product
|
||||||
|
BOARD_ROOT_EXTRA_SYMLINKS := \
|
||||||
|
/mnt/vendor/persist:/persist
|
||||||
|
|
||||||
|
# Vendor Security Patch Level
|
||||||
|
VENDOR_SECURITY_PATCH := 2020-08-01
|
||||||
|
|
||||||
|
# Treble
|
||||||
|
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
|
||||||
|
PRODUCT_FULL_TREBLE_OVERRIDE := true
|
||||||
|
BOARD_VNDK_VERSION := current
|
||||||
|
BOARD_VNDK_RUNTIME_DISABLE := true
|
||||||
|
|
||||||
|
# Peripheral manager
|
||||||
|
TARGET_PER_MGR_ENABLED := true
|
||||||
|
|
||||||
|
# Power
|
||||||
|
TARGET_USES_INTERACTION_BOOST := true
|
||||||
|
|
||||||
|
# Timeservice
|
||||||
|
BOARD_USES_QC_TIME_SERVICES := true
|
||||||
|
|
||||||
|
# RIL
|
||||||
|
TARGET_PROVIDES_QTI_TELEPHONY_JAR := true
|
||||||
|
|
||||||
|
# Root
|
||||||
|
BOARD_ROOT_EXTRA_FOLDERS := persist
|
||||||
|
|
||||||
|
# SELinux
|
||||||
|
#include device/qcom/sepolicy-legacy-um/sepolicy.mk
|
||||||
|
BOARD_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
|
||||||
|
|
||||||
|
# Wifi
|
||||||
|
BOARD_HAS_QCOM_WLAN := true
|
||||||
|
BOARD_WLAN_DEVICE := qcwcn
|
||||||
|
BOARD_HOSTAPD_DRIVER := NL80211
|
||||||
|
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_qcwcn
|
||||||
|
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
||||||
|
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_qcwcn
|
||||||
|
WIFI_DRIVER_FW_PATH_AP := "ap"
|
||||||
|
WIFI_DRIVER_FW_PATH_STA := "sta"
|
||||||
|
WIFI_DRIVER_FW_PATH_P2P := "p2p"
|
||||||
|
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||||
|
TARGET_DISABLE_WCNSS_CONFIG_COPY := true
|
||||||
|
PRODUCT_VENDOR_MOVE_ENABLED := true
|
||||||
|
|
||||||
|
-include vendor/motorola/msm8953-common/BoardConfigVendor.mk
|
||||||
25
MotoActions/Android.mk
Normal file
25
MotoActions/Android.mk
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||||
|
|
||||||
|
LOCAL_PACKAGE_NAME := MotoActions
|
||||||
|
LOCAL_PRIVATE_PLATFORM_APIS := true
|
||||||
|
LOCAL_CERTIFICATE := platform
|
||||||
|
LOCAL_PRIVILEGED_MODULE := true
|
||||||
|
LOCAL_USE_AAPT2 := true
|
||||||
|
|
||||||
|
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
||||||
|
|
||||||
|
LOCAL_RESOURCE_DIR := \
|
||||||
|
$(LOCAL_PATH)/res \
|
||||||
|
$(TOP)/packages/resources/devicesettings/res \
|
||||||
|
$(TOP)/packages/resources/devicesettings-custom/res
|
||||||
|
|
||||||
|
LOCAL_PROGUARD_ENABLED := disabled
|
||||||
|
|
||||||
|
include frameworks/base/packages/SettingsLib/common.mk
|
||||||
|
|
||||||
|
include $(BUILD_PACKAGE)
|
||||||
94
MotoActions/AndroidManifest.xml
Normal file
94
MotoActions/AndroidManifest.xml
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.moto.actions"
|
||||||
|
android:sharedUserId="android.uid.system"
|
||||||
|
>
|
||||||
|
|
||||||
|
<original-package android:name="com.cyanogenmod.settings.device" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
|
||||||
|
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||||
|
|
||||||
|
<protected-broadcast android:name="com.android.systemui.doze.pulse" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:label="@string/moto_actions_title"
|
||||||
|
android:icon="@drawable/ic_gesture"
|
||||||
|
android:persistent="true">
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name=".MotoActionsSearchIndexablesProvider"
|
||||||
|
android:authorities="com.moto.actions"
|
||||||
|
android:multiprocess="false"
|
||||||
|
android:grantUriPermissions="true"
|
||||||
|
android:permission="android.permission.READ_SEARCH_INDEXABLES"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER" />
|
||||||
|
</intent-filter>
|
||||||
|
</provider>
|
||||||
|
|
||||||
|
<receiver android:name="com.moto.actions.BootCompletedReceiver">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<service android:name="ServiceWrapper" android:permission="ServiceWrapper">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="ServiceWrapper"/>
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".DozeSettingsActivity"
|
||||||
|
android:label="@string/ambient_display_title"
|
||||||
|
android:theme="@style/MotoActions">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.moto.actions.DOZE_SETTINGS" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ActionsPreferenceActivity"
|
||||||
|
android:label="@string/moto_actions_title"
|
||||||
|
android:summary="@string/device_gestures_summary"
|
||||||
|
android:theme="@style/MotoActions">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.android.settings.action.IA_SETTINGS" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data
|
||||||
|
android:name="com.android.settings.category"
|
||||||
|
android:value="com.android.settings.category.ia.homepage" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.android.settings.icon"
|
||||||
|
android:resource="@drawable/ic_settings_gestures_dashboard" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.android.settings.summary"
|
||||||
|
android:resource="@string/device_gestures_summary" />
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".GestureSettingsActivity"
|
||||||
|
android:label="@string/device_gestures_title"
|
||||||
|
android:theme="@style/MotoActions"
|
||||||
|
android:exported="true">
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".FPGestureSettingsActivity"
|
||||||
|
android:label="@string/fingerprint_gestures_title"
|
||||||
|
android:theme="@style/MotoActions"
|
||||||
|
android:exported="true">
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
BIN
MotoActions/res/drawable/ambient_png.png
Normal file
BIN
MotoActions/res/drawable/ambient_png.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
BIN
MotoActions/res/drawable/fpgesture_png.png
Normal file
BIN
MotoActions/res/drawable/fpgesture_png.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
MotoActions/res/drawable/gesture_png.png
Normal file
BIN
MotoActions/res/drawable/gesture_png.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
6
MotoActions/res/drawable/ic_actions_chop.xml
Normal file
6
MotoActions/res/drawable/ic_actions_chop.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:name="vector" android:tint="?android:attr/colorControlNormal" android:height="1600dp" android:width="1600dp" android:viewportWidth="1600" android:viewportHeight="1600">
|
||||||
|
<group android:name="group">
|
||||||
|
<path android:name="path" android:fillColor="#000" android:pathData="M 980 1360 C 929 1314 921 1310 872 1310 C 803 1310 765 1290 750 1245 C 743 1225 741 1203 743 1196 C 747 1186 736 1180 705 1175 C 649 1167 620 1134 620 1079 C 620 1040 620 1040 581 1040 C 523 1040 486 1006 486 951 C 485 911 484 910 452 910 C 411 910 364 887 350 860 C 338 837 343 711 357 687 C 381 645 645 371 667 365 C 706 356 730 368 806 437 L 878 501 L 888 471 C 904 426 935 400 974 400 C 1005 400 1029 419 1198 575 C 1428 788 1425 784 1424 960 C 1423 1062 1419 1094 1403 1131 C 1376 1192 1326 1247 1271 1275 C 1246 1288 1200 1323 1170 1354 C 1122 1404 1111 1410 1075 1410 C 1041 1409 1026 1401 980 1360 Z M 1202 1238 C 1257 1222 1325 1159 1346 1105 C 1370 1040 1372 857 1348 813 C 1332 784 1001 470 977 461 C 964 456 940 488 940 511 C 940 520 962 562 989 603 C 1045 688 1047 694 1037 731 C 1025 778 996 782 694 779 C 439 775 417 776 406 793 C 398 805 398 815 406 828 C 416 843 442 845 679 848 L 940 850 L 940 910 L 751 910 C 591 910 560 912 549 926 C 540 937 539 946 547 958 C 556 973 584 976 746 980 L 935 985 L 938 1013 L 941 1040 L 823 1040 C 758 1040 699 1044 692 1049 C 684 1053 680 1068 682 1081 C 684 1101 693 1106 730 1112 C 755 1115 812 1119 858 1119 L 941 1120 L 938 1148 C 935 1174 932 1175 874 1178 C 809 1181 791 1197 812 1234 C 820 1248 844 1250 992 1250 C 1094 1250 1178 1245 1202 1238 Z M 660 670 C 690 640 673 605 629 605 C 599 605 595 608 592 635 C 589 654 594 668 606 677 C 630 694 637 693 660 670 Z M 198 729 C 156 705 169 566 225 454 C 286 329 415 232 551 208 C 601 199 614 200 635 214 C 662 232 669 271 648 288 C 641 293 613 301 585 304 C 438 325 309 452 281 601 C 276 632 274 667 277 678 C 280 691 274 706 261 719 C 238 742 224 744 198 729 Z" android:strokeWidth="1"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
7
MotoActions/res/drawable/ic_actions_flip.xml
Normal file
7
MotoActions/res/drawable/ic_actions_flip.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:name="vector" android:tint="?android:attr/colorControlNormal" android:height="1600dp" android:width="1600dp" android:viewportWidth="1600" android:viewportHeight="1600">
|
||||||
|
<group android:name="group">
|
||||||
|
<path android:name="path" android:fillColor="#000" android:pathData="M 287 1283 C 273 1270 280 1223 298 1207 C 315 1192 365 1190 808 1190 L 1300 1190 L 1316 1214 C 1324 1228 1330 1249 1328 1262 L 1325 1285 L 809 1288 C 526 1289 290 1287 287 1283 Z M 382 1008 C 261 895 234 858 219 794 C 209 752 210 734 224 686 C 239 635 253 616 329 539 C 427 440 463 420 547 420 C 654 420 682 441 976 732 C 1189 944 1240 1000 1240 1021 C 1240 1094 1139 1125 1057 1077 C 1033 1063 1008 1044 1000 1036 C 983 1014 970 1016 970 1040 C 970 1082 939 1097 851 1097 C 755 1097 731 1084 705 1016 C 688 973 692 919 715 857 C 721 842 714 840 636 840 C 584 840 550 844 550 850 C 550 856 561 883 575 910 C 611 980 606 1034 560 1080 C 519 1121 488 1108 382 1008 Z M 532 1016 C 541 995 538 979 510 916 C 481 851 478 837 488 815 C 505 779 537 770 653 770 C 805 770 812 773 966 916 C 1084 1026 1104 1040 1135 1040 C 1157 1040 1170 1035 1170 1027 C 1170 1020 1059 903 923 768 C 663 510 626 481 547 480 C 488 480 448 504 366 590 C 280 681 262 723 281 793 C 290 827 312 854 398 937 C 457 994 508 1040 513 1040 C 517 1040 525 1029 532 1016 Z M 781 955 L 774 885 L 762 926 C 750 967 753 992 773 1018 C 788 1036 788 1032 781 955 Z M 910 987 C 910 953 904 938 882 917 C 867 902 851 890 847 890 C 843 890 840 911 840 938 C 840 991 861 1030 891 1030 C 907 1030 910 1023 910 987 Z" android:strokeWidth="1"/>
|
||||||
|
<path android:name="path_1" android:fillColor="#000" android:pathData="M 1284 1086 C 1268 1074 1264 1054 1259 933 C 1254 830 1247 780 1232 737 C 1180 593 1093 488 986 440 C 917 408 902 385 923 340 C 958 266 1133 346 1236 483 C 1339 620 1379 738 1387 926 C 1393 1051 1392 1058 1371 1079 C 1347 1103 1312 1106 1284 1086 Z" android:strokeWidth="1"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
8
MotoActions/res/drawable/ic_actions_lift.xml
Normal file
8
MotoActions/res/drawable/ic_actions_lift.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:name="vector" android:tint="?android:attr/colorControlNormal" android:height="1610dp" android:width="1610dp" android:viewportWidth="1610" android:viewportHeight="1610">
|
||||||
|
<group android:name="group">
|
||||||
|
<path android:name="path" android:fillColor="#000" android:pathData="M 592 1464 C 571 1450 570 1442 570 1311 C 570 1190 572 1171 588 1157 C 612 1135 633 1136 653 1158 C 667 1173 670 1200 670 1313 C 670 1442 669 1450 648 1464 C 636 1473 623 1480 620 1480 C 617 1480 604 1473 592 1464 Z M 720 1460 C 704 1444 700 1427 700 1377 C 700 1298 713 1277 760 1282 L 795 1285 L 798 1373 C 801 1459 800 1460 775 1470 C 741 1483 743 1483 720 1460 Z" android:strokeWidth="1"/>
|
||||||
|
<path android:name="path_1" android:fillColor="#000" android:pathData="M 1073 1437 C 1027 1394 1022 1392 946 1385 C 850 1376 820 1354 820 1292 C 820 1254 819 1252 782 1246 C 729 1238 695 1200 695 1149 C 695 1111 694 1110 662 1110 C 612 1110 570 1064 570 1011 L 570 970 L 529 970 C 497 970 482 964 458 940 C 426 907 426 913 448 782 C 456 730 461 724 605 580 C 700 485 764 429 781 425 C 818 417 854 437 920 504 C 976 561 990 570 990 547 C 990 529 1029 494 1058 485 C 1093 475 1137 510 1318 694 C 1442 820 1481 866 1490 897 C 1498 922 1501 982 1498 1061 C 1495 1171 1491 1191 1468 1236 C 1436 1296 1383 1345 1321 1373 C 1295 1383 1257 1410 1234 1431 C 1208 1457 1181 1473 1158 1477 C 1125 1482 1117 1478 1073 1437 Z M 1309 1310 C 1362 1284 1416 1218 1429 1165 C 1445 1100 1443 935 1426 902 C 1418 887 1337 801 1246 710 C 1104 569 1077 547 1062 556 C 1030 576 1037 614 1084 693 C 1135 776 1140 810 1109 841 C 1088 862 1081 863 961 857 C 892 853 760 847 669 844 L 502 837 L 495 860 C 481 904 499 908 765 920 C 903 927 1019 935 1024 940 C 1028 944 1027 956 1022 967 C 1012 983 996 985 823 985 L 635 985 L 632 1013 C 630 1028 630 1041 632 1041 C 634 1042 721 1048 825 1054 L 1015 1065 L 1015 1115 L 892 1115 C 794 1115 767 1118 760 1130 C 748 1149 748 1151 760 1170 C 767 1181 797 1186 887 1190 C 1005 1195 1005 1195 1005 1220 C 1005 1243 1001 1245 945 1250 C 886 1255 885 1256 885 1285 C 885 1311 889 1316 920 1321 C 939 1325 1026 1328 1113 1329 C 1252 1330 1275 1328 1309 1310 Z M 440 1451 C 434 1439 430 1354 430 1245 C 430 1136 434 1051 440 1039 C 452 1017 499 1013 518 1032 C 535 1049 535 1441 518 1458 C 499 1477 452 1473 440 1451 Z M 300 582 C 269 557 282 540 330 540 C 378 540 391 557 360 582 C 348 592 334 600 330 600 C 326 600 312 592 300 582 Z" android:strokeWidth="1"/>
|
||||||
|
<path android:name="path_2" android:fillColor="#000" android:pathData="M 485 550 C 468 532 454 530 308 530 C 174 530 148 528 143 514 C 140 505 148 488 163 472 C 185 448 188 434 192 348 C 197 256 196 250 174 229 C 146 203 143 182 166 173 C 177 169 223 208 322 306 C 510 493 546 536 530 555 C 514 575 507 574 485 550 Z M 356 314 L 267 219 L 287 182 C 309 139 349 131 364 166 C 369 177 386 194 401 203 C 449 230 471 276 468 344 C 466 377 460 405 455 407 C 449 409 404 367 356 314 Z" android:strokeWidth="1"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
7
MotoActions/res/drawable/ic_actions_twist.xml
Normal file
7
MotoActions/res/drawable/ic_actions_twist.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:name="vector" android:tint="?android:attr/colorControlNormal" android:height="1600dp" android:width="1600dp" android:viewportWidth="1600" android:viewportHeight="1600">
|
||||||
|
<group android:name="group">
|
||||||
|
<path android:name="path" android:fillColor="#000" android:pathData="M 375 1429 C 345 1401 295 1366 263 1350 C 193 1317 139 1262 108 1195 C 88 1151 86 1128 85 1015 C 85 906 88 879 104 846 C 117 821 194 742 318 629 C 492 470 517 450 548 450 C 573 450 589 458 611 481 C 627 498 640 518 640 526 C 640 550 652 542 718 478 C 776 420 784 415 825 415 C 869 415 871 416 1025 570 C 1110 655 1180 732 1180 740 C 1180 749 1191 771 1204 789 C 1236 832 1244 869 1230 906 C 1213 951 1180 980 1138 986 C 1102 992 1100 995 1100 1027 C 1100 1072 1049 1125 997 1135 C 965 1141 960 1146 960 1170 C 960 1209 917 1257 870 1271 C 838 1281 831 1288 826 1316 C 822 1336 806 1361 783 1380 C 749 1410 744 1412 675 1409 C 603 1406 602 1406 561 1443 C 526 1474 513 1480 474 1480 C 433 1480 423 1475 375 1429 Z M 541 1374 C 555 1361 558 1348 553 1311 C 548 1268 551 1260 580 1227 C 598 1206 628 1185 651 1179 C 683 1169 690 1162 690 1142 C 690 1105 759 1040 799 1040 C 827 1040 830 1037 830 1009 C 830 986 840 967 869 939 C 904 903 912 900 961 900 C 1009 900 1018 896 1052 863 C 1073 843 1090 821 1090 815 C 1090 810 1020 735 935 650 L 780 495 L 495 780 C 338 937 210 1069 210 1075 C 210 1084 510 1390 519 1390 C 521 1390 531 1383 541 1374 Z M 728 1293 C 731 1272 727 1270 691 1270 C 649 1270 634 1281 644 1306 C 648 1317 661 1320 687 1318 C 718 1316 726 1311 728 1293 Z M 864 1169 C 869 1165 870 1154 866 1145 C 857 1121 786 1128 782 1154 C 780 1164 784 1176 791 1181 C 806 1190 849 1183 864 1169 Z M 1004 1030 C 1022 1012 1001 990 965 990 C 928 990 913 1007 924 1036 C 929 1048 938 1050 962 1045 C 980 1041 999 1034 1004 1030 Z M 539 634 C 564 594 571 574 566 554 C 562 540 553 530 545 532 C 538 534 457 603 367 685 C 181 853 160 883 160 976 L 160 1035 L 333 862 C 429 766 521 664 539 634 Z M 1140 885 C 1161 860 1141 854 1118 878 C 1100 896 1099 900 1112 900 C 1120 900 1133 893 1140 885 Z M 1385 753 C 1332 740 1312 679 1350 645 C 1364 632 1379 629 1405 633 L 1440 639 L 1426 612 C 1382 527 1255 384 1155 309 C 1089 259 1078 230 1111 194 C 1123 181 1141 170 1151 170 C 1194 170 1412 371 1488 483 C 1554 578 1576 661 1550 711 C 1528 750 1454 770 1385 753 Z" android:strokeWidth="1"/>
|
||||||
|
<path android:name="path_1" android:fillColor="#000" android:pathData="M 1180 633 C 1166 624 1120 587 1077 551 C 928 427 830 277 830 175 C 830 128 834 119 861 96 C 878 82 904 70 919 70 C 956 70 1030 109 1054 143 L 1074 170 L 1053 198 C 1037 219 1025 225 997 224 L 961 223 L 980 260 C 1012 323 1089 409 1169 471 C 1286 563 1290 567 1290 593 C 1290 644 1228 666 1180 633 Z" android:strokeWidth="1"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
7
MotoActions/res/drawable/ic_actions_wave.xml
Normal file
7
MotoActions/res/drawable/ic_actions_wave.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:aapt="http://schemas.android.com/aapt" android:name="vector" android:tint="?android:attr/colorControlNormal" android:height="1610dp" android:width="1610dp" android:viewportWidth="1610" android:viewportHeight="1610">
|
||||||
|
<group android:name="group">
|
||||||
|
<path android:name="path" android:fillColor="#000" android:pathData="M 977 1350 C 956 1344 926 1333 910 1325 C 894 1317 870 1310 856 1310 C 798 1310 750 1264 750 1208 C 750 1193 711 1146 625 1060 C 512 946 500 930 500 898 C 500 878 509 852 520 837 C 546 804 546 799 509 764 C 445 704 433 642 475 592 C 497 566 498 559 489 531 C 468 471 512 410 577 410 C 595 410 610 405 610 400 C 610 394 621 378 635 365 C 653 346 670 340 704 340 C 740 340 750 336 755 320 C 758 309 773 291 787 280 C 811 261 827 260 1027 260 L 1242 260 L 1271 289 C 1299 317 1300 323 1300 404 C 1300 489 1300 490 1325 490 C 1339 490 1358 498 1368 508 C 1388 528 1391 561 1406 907 C 1414 1085 1405 1121 1340 1185 C 1318 1207 1300 1229 1300 1236 C 1300 1262 1261 1293 1192 1321 C 1110 1353 1034 1364 977 1350 Z M 1150 1269 C 1202 1243 1297 1154 1326 1104 L 1352 1059 L 1341 827 C 1335 699 1330 585 1330 573 C 1330 545 1301 542 1272 568 C 1257 580 1246 610 1234 670 C 1214 776 1200 800 1158 800 C 1129 800 1102 776 924 599 C 760 436 718 399 699 402 C 683 404 674 413 672 429 C 669 449 701 485 846 631 C 999 785 1022 811 1011 824 C 1003 833 993 840 987 840 C 981 840 892 756 789 654 C 638 504 598 469 579 472 C 562 474 554 482 552 500 C 550 521 582 557 735 710 C 837 812 920 900 920 906 C 920 912 913 923 905 930 C 891 941 866 920 726 782 C 637 693 557 620 549 620 C 530 620 510 640 510 659 C 510 668 583 748 672 837 C 811 977 832 1001 821 1014 C 813 1023 802 1030 796 1030 C 790 1030 746 992 700 945 C 632 877 610 860 590 862 C 572 864 564 872 561 890 C 559 911 586 942 731 1083 C 827 1176 919 1259 935 1268 C 1000 1302 1084 1303 1150 1269 Z M 1170 683 C 1191 576 1200 554 1230 525 C 1257 499 1260 490 1260 433 L 1260 370 L 1030 370 C 854 370 800 373 800 382 C 800 395 1139 740 1152 740 C 1155 740 1164 714 1170 683 Z M 407 1243 C 403 1240 400 1223 400 1206 C 400 1181 412 1162 458 1117 C 516 1059 552 1046 578 1072 C 603 1097 590 1131 533 1191 C 488 1239 471 1250 445 1250 C 428 1250 410 1247 407 1243 Z M 317 1142 C 307 1132 300 1115 300 1104 C 300 1078 420 960 446 960 C 475 960 490 979 490 1015 C 490 1041 479 1058 431 1103 C 368 1163 343 1171 317 1142 Z" android:strokeWidth="1"/>
|
||||||
|
<path android:name="path_1" android:fillColor="#000" android:pathData="M 217 1042 C 207 1032 200 1015 200 1005 C 200 995 246 941 302 884 C 390 794 408 780 437 780 C 473 780 495 807 485 839 C 476 868 275 1060 253 1060 C 242 1060 226 1052 217 1042 Z" android:strokeWidth="1"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_double_tap.xml
Normal file
20
MotoActions/res/drawable/ic_double_tap.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 10,9C 10,8.4477 10.4477,8 11,8C 11.5523,8 12,8.4477 12,9L 12,13.47L 13.21,13.6L 18.15,15.79C 18.6759,16.0317 19.0093,16.5613 19,17.14L 19,21.5C 18.974,22.3174 18.3174,22.974 17.5,23L 11,23C 10.6216,23.0009 10.2596,22.8453 10,22.57L 5.1,18.37L 5.84,17.6C 6.03083,17.3942 6.29936,17.2781 6.58,17.28L 6.8,17.28L 10,19L 10,9 Z M 11,5C 13.2091,5 15,6.79086 15,9C 15,10.4806 14.1956,11.7733 13,12.4649L 13,11.2361C 13.6137,10.6868 14,9.8885 14,9.00001C 14,7.34315 12.6568,6.00001 11,6.00001C 9.34314,6.00001 8,7.34315 8,9.00001C 8,9.88851 8.38625,10.6868 9,11.2361L 9,12.4649C 7.8044,11.7733 7,10.4806 7,9C 7,6.79086 8.79086,5 11,5 Z M 11,3C 14.3137,3 17,5.6863 17,9C 17,10.6993 16.2936,12.2336 15.1584,13.3253L 14.1554,12.8788C 15.2811,11.9619 16,10.5649 16,9C 16,6.23858 13.7614,4.00001 11,4.00001C 8.23857,4.00001 6,6.23858 6,9C 6,11.0503 7.23409,12.8124 9,13.584L 9,14.6586C 6.66961,13.8349 5,11.6124 5,9C 5,5.6863 7.68629,3 11,3 Z " />
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_fingerprint.xml
Normal file
20
MotoActions/res/drawable/ic_fingerprint.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 17.8075,4.4675C 17.73,4.4675 17.6513,4.4488 17.5787,4.4088C 15.6587,3.4175 13.9987,2.9978 12.0113,2.9978C 10.0288,2.9978 8.15,3.4713 6.44,4.4088C 6.20125,4.5413 5.89875,4.4488 5.76125,4.2087C 5.63,3.9695 5.7175,3.6625 5.9625,3.53C 7.8225,2.5205 9.85875,2.0025 12.0113,2.0025C 14.1412,2.0025 16.0012,2.4713 18.0425,3.52C 18.2913,3.6521 18.3788,3.95 18.2525,4.19C 18.1588,4.37 17.9887,4.4675 17.8075,4.4675 Z M 3.50125,9.7212C 3.39875,9.7212 3.30125,9.6925 3.2075,9.6287C 2.97875,9.4675 2.93,9.16 3.09125,8.9312C 4.0825,7.5287 5.34125,6.4313 6.84125,5.6588C 9.98,4.0375 13.9987,4.0287 17.1488,5.65C 18.6525,6.4212 19.9125,7.51 20.8984,8.9012C 21.06,9.1213 21.0107,9.4388 20.7813,9.6C 20.5518,9.7612 20.2393,9.7125 20.0787,9.4825C 19.18,8.2175 18.0425,7.2312 16.69,6.5375C 13.8188,5.0687 10.1512,5.0687 7.29,6.5475C 5.9275,7.2512 4.79,8.2525 3.89125,9.5112C 3.80875,9.6488 3.6625,9.7212 3.50125,9.7212 Z M 9.75125,21.7925C 9.61875,21.7925 9.4925,21.7388 9.4,21.64C 8.53,20.7712 8.06125,20.21 7.3875,18.9988C 6.69875,17.7687 6.3375,16.27 6.3375,14.6588C 6.3375,11.69 8.88125,9.2675 12.0025,9.2675C 15.1225,9.2675 17.6612,11.69 17.6612,14.6588C 17.6612,14.9412 17.4413,15.1613 17.1587,15.1613C 16.88,15.1613 16.66,14.9412 16.66,14.6588C 16.66,12.2413 14.57,10.2688 12.0025,10.2688C 9.42875,10.2688 7.33875,12.2413 7.33875,14.6588C 7.33875,16.0988 7.66125,17.4313 8.27125,18.5113C 8.91125,19.6588 9.35,20.1512 10.1225,20.9275C 10.3075,21.1275 10.3075,21.44 10.1225,21.64C 10.01,21.7388 9.8775,21.7925 9.75125,21.7925 Z M 16.9188,19.9412C 15.7325,19.9412 14.6775,19.6388 13.8188,19.0475C 12.3287,18.0425 11.44,16.4012 11.44,14.6588C 11.44,14.38 11.66,14.16 11.9388,14.16C 12.2212,14.16 12.4413,14.38 12.4413,14.6588C 12.4413,16.0687 13.1587,17.4025 14.38,18.2175C 15.0875,18.7013 15.9175,18.9312 16.9188,18.9312C 17.1587,18.9312 17.5587,18.9012 17.9587,18.8275C 18.2325,18.7787 18.4912,18.96 18.54,19.2388C 18.5888,19.5112 18.4087,19.77 18.13,19.8187C 17.5587,19.9313 17.06,19.9412 16.9188,19.9412 Z M 14.9125,22.0025C 14.8688,22.0025 14.8187,21.9925 14.78,21.9825C 13.1888,21.5375 12.1488,20.9525 11.06,19.8775C 9.65875,18.4913 8.89125,16.64 8.89125,14.6588C 8.89125,13.0425 10.2688,11.7188 11.9675,11.7188C 13.6725,11.7188 15.0487,13.0425 15.0487,14.6588C 15.0487,15.7325 15.9813,16.6013 17.1288,16.6013C 18.2813,16.6013 19.2087,15.7325 19.2087,14.6588C 19.2087,10.8887 15.9625,7.8325 11.9575,7.8325C 9.12125,7.8325 6.51875,9.4087 5.35125,11.86C 4.96125,12.6713 4.76125,13.6187 4.76125,14.6588C 4.76125,15.44 4.82875,16.67 5.43,18.2712C 5.5325,18.53 5.4,18.8188 5.14125,18.9113C 4.8775,19.0087 4.59,18.8725 4.5025,18.6187C 4.00875,17.31 3.77,16.0113 3.77,14.6588C 3.77,13.4625 3.99875,12.3687 4.44875,11.4213C 5.78125,8.6275 8.73,6.8212 11.9575,6.8212C 16.5088,6.8212 20.21,10.3325 20.21,14.6487C 20.21,16.27 18.8287,17.5875 17.1288,17.5875C 15.43,17.5875 14.0475,16.27 14.0475,14.6487C 14.0475,13.5788 13.12,12.71 11.9675,12.71C 10.82,12.71 9.8875,13.5788 9.8875,14.6487C 9.8875,16.3625 10.5513,17.9587 11.7575,19.16C 12.71,20.0975 13.6188,20.62 15.0288,21.0113C 15.2975,21.0788 15.4488,21.3625 15.3813,21.6213C 15.3325,21.85 15.1225,22.0025 14.9125,22.0025 Z " />
|
||||||
|
</vector>
|
||||||
BIN
MotoActions/res/drawable/ic_gesture.png
Normal file
BIN
MotoActions/res/drawable/ic_gesture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
9
MotoActions/res/drawable/ic_hand.xml
Normal file
9
MotoActions/res/drawable/ic_hand.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<!-- drawable/ic_hand.xml -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M6.58,19H14.58V22H6.58V19M19.74,11.6C19.55,11.4 19.29,11.28 19,11.28L18.78,11.31L15.58,13V11.83L16.09,2.9C16.12,2.35 15.7,1.87 15.15,1.84C14.6,1.81 14.12,2.23 14.09,2.78L13.82,7.47H13.58L12.54,7.58V2A1,1 0 0,0 11.54,1C11,1 10.54,1.45 10.54,2V8.41L9.72,8.78L9.03,3.32C8.96,2.77 8.46,2.38 7.91,2.45C7.36,2.5 6.97,3 7.04,3.57L7.81,9.63L7.43,9.8C7.3,9.85 7.18,9.93 7.07,10L5.97,6.11C5.81,5.54 5.25,5.2 4.71,5.34C4.18,5.5 3.88,6.08 4.04,6.65L6.61,15.77C6.61,15.8 6.63,15.84 6.64,15.87L6.67,16H6.68C6.9,16.57 7.47,17 8.08,17H14.58C14.97,17 15.32,16.84 15.58,16.57L20.5,12.37L19.74,11.6Z" />
|
||||||
|
</vector>
|
||||||
9
MotoActions/res/drawable/ic_pickup.xml
Normal file
9
MotoActions/res/drawable/ic_pickup.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<!-- drawable/ic_pickup.xml -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M9.64,13.4C8.63,12.5 7.34,12.03 6,12V15L2,11L6,7V10C7.67,10 9.3,10.57 10.63,11.59C10.22,12.15 9.89,12.76 9.64,13.4M18,15V12C17.5,12 13.5,12.16 13.05,16.2C14.61,16.75 15.43,18.47 14.88,20.03C14.33,21.59 12.61,22.41 11.05,21.86C9.5,21.3 8.67,19.59 9.22,18.03C9.5,17.17 10.2,16.5 11.05,16.2C11.34,12.61 14.4,9.88 18,10V7L22,11L18,15M13,19A1,1 0 0,0 12,18A1,1 0 0,0 11,19A1,1 0 0,0 12,20A1,1 0 0,0 13,19M11,11.12C11.58,10.46 12.25,9.89 13,9.43V5H16L12,1L8,5H11V11.12Z" />
|
||||||
|
</vector>
|
||||||
29
MotoActions/res/drawable/ic_settings_doze.xml
Normal file
29
MotoActions/res/drawable/ic_settings_doze.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="1000.000000"
|
||||||
|
android:viewportHeight="1000.000000"
|
||||||
|
android:tint="?android:attr/colorControlNormal">
|
||||||
|
|
||||||
|
<group
|
||||||
|
android:translateY="1000.000000"
|
||||||
|
android:scaleX="0.100000"
|
||||||
|
android:scaleY="-0.100000">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:pathData="M3022 9600 c-109 -29 -187 -74 -272 -160 -87 -86 -131 -163 -160 -276 -20 -76 -20
|
||||||
|
-127 -20 -4094 0 -3967 0 -4018 20 -4094 29 -113 73 -190 160 -276 86 -87 163 -131
|
||||||
|
276 -160 75 -20 117 -20 1849 -20 1732 0 1774 0 1849 20 113 29 190 73 276 160 87
|
||||||
|
86 131 163 160 276 20 76 20 127 20 4094 0 3967 0 4018 -20 4094 -29 113 -73 190
|
||||||
|
-160 276 -86 87 -163 131 -276 160 -75 20 -116 20 -1853 19 -1716 0 -1778 -1 -1849
|
||||||
|
-19z m1943 -2149 c51 -23 93 -65 116 -116 14 -31 19 -65 19 -150 l0 -110 83 -19
|
||||||
|
c227 -50 446 -169 623 -338 195 -187 315 -391 387 -658 l32 -115 3 -785 2 -785 363
|
||||||
|
-357 362 -357 -2075 0 -2075 0 352 347 352 347 3 795 3 795 32 115 c72 267 192 471
|
||||||
|
387 658 177 169 396 288 624 338 l82 19 0 110 c0 85 5 119 19 150 38 84 117 135
|
||||||
|
211 135 32 0 72 -8 95 -19z m415 -4018 c-1 -27 -32 -118 -60 -172 -60 -119 -188
|
||||||
|
-221 -325 -257 -27 -8 -86 -14 -130 -14 -95 0 -157 15 -244 60 -119 60 -221 188
|
||||||
|
-257 325 -8 28 -14 53 -14 58 0 4 232 7 515 7 283 0 515 -3 515 -7z" />
|
||||||
|
</group>
|
||||||
|
</vector>
|
||||||
9
MotoActions/res/drawable/ic_settings_fingerprint.xml
Normal file
9
MotoActions/res/drawable/ic_settings_fingerprint.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal">
|
||||||
|
<path android:fillColor="#FFFFFFFF" android:pathData="M11.83,1.73C8.43,1.79 6.23,3.32 6.23,3.32C5.95,3.5 5.88,3.91 6.07,4.19C6.27,4.5 6.66,4.55 6.96,4.34C6.96,4.34 11.27,1.15 17.46,4.38C17.75,4.55 18.14,4.45 18.31,4.15C18.5,3.85 18.37,3.47 18.03,3.28C16.36,2.4 14.78,1.96 13.36,1.8C12.83,1.74 12.32,1.72 11.83,1.73M12.22,4.34C6.26,4.26 3.41,9.05 3.41,9.05C3.22,9.34 3.3,9.72 3.58,9.91C3.87,10.1 4.26,10 4.5,9.68C4.5,9.68 6.92,5.5 12.2,5.59C17.5,5.66 19.82,9.65 19.82,9.65C20,9.94 20.38,10.04 20.68,9.87C21,9.69 21.07,9.31 20.9,9C20.9,9 18.15,4.42 12.22,4.34M11.5,6.82C9.82,6.94 8.21,7.55 7,8.56C4.62,10.53 3.1,14.14 4.77,19C4.88,19.33 5.24,19.5 5.57,19.39C5.89,19.28 6.07,18.92 5.95,18.6V18.6C4.41,14.13 5.78,11.2 7.8,9.5C9.77,7.89 13.25,7.5 15.84,9.1C17.11,9.9 18.1,11.28 18.6,12.64C19.11,14 19.08,15.32 18.67,15.94C18.25,16.59 17.4,16.83 16.65,16.64C15.9,16.45 15.29,15.91 15.26,14.77C15.23,13.06 13.89,12 12.5,11.84C11.16,11.68 9.61,12.4 9.21,14C8.45,16.92 10.36,21.07 14.78,22.45C15.11,22.55 15.46,22.37 15.57,22.04C15.67,21.71 15.5,21.35 15.15,21.25C11.32,20.06 9.87,16.43 10.42,14.29C10.66,13.33 11.5,13 12.38,13.08C13.25,13.18 14,13.7 14,14.79C14.05,16.43 15.12,17.54 16.34,17.85C17.56,18.16 18.97,17.77 19.72,16.62C20.5,15.45 20.37,13.8 19.78,12.21C19.18,10.61 18.07,9.03 16.5,8.04C14.96,7.08 13.19,6.7 11.5,6.82M11.86,9.25V9.26C10.08,9.32 8.3,10.24 7.28,12.18C5.96,14.67 6.56,17.21 7.44,19.04C8.33,20.88 9.54,22.1 9.54,22.1C9.78,22.35 10.17,22.35 10.42,22.11C10.67,21.87 10.67,21.5 10.43,21.23C10.43,21.23 9.36,20.13 8.57,18.5C7.78,16.87 7.3,14.81 8.38,12.77C9.5,10.67 11.5,10.16 13.26,10.67C15.04,11.19 16.53,12.74 16.5,15.03C16.46,15.38 16.71,15.68 17.06,15.7C17.4,15.73 17.7,15.47 17.73,15.06C17.79,12.2 15.87,10.13 13.61,9.47C13.04,9.31 12.45,9.23 11.86,9.25M12.08,14.25C11.73,14.26 11.46,14.55 11.47,14.89C11.47,14.89 11.5,16.37 12.31,17.8C13.15,19.23 14.93,20.59 18.03,20.3C18.37,20.28 18.64,20 18.62,19.64C18.6,19.29 18.3,19.03 17.91,19.06C15.19,19.31 14.04,18.28 13.39,17.17C12.74,16.07 12.72,14.88 12.72,14.88C12.72,14.53 12.44,14.25 12.08,14.25Z" />
|
||||||
|
</vector>
|
||||||
29
MotoActions/res/drawable/ic_settings_gestures.xml
Normal file
29
MotoActions/res/drawable/ic_settings_gestures.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="32.0"
|
||||||
|
android:viewportHeight="32.0"
|
||||||
|
android:tint="?android:attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M20,20.2V24H6V5.3h8.7l2.4,-4H7.6c-2.2,0 -4,1.8 -4,4v21.3c0,2.2 1.8,4 4,4h10.7c2.2,0 4,-1.8 4,-4V14.9L20,20.2zM15.6,28h-5.3v-1.3h5.3V28z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M28.5,7l1.1,-2.4L32,3.5l-2.4,-1.1L28.5,0l-1.1,2.4L25,3.5l2.4,1.1L28.5,7zM21,7.4l-2.2,-4.8l-2.2,4.8l-4.8,2.2l4.8,2.2l2.2,4.8l2.2,-4.8l4.8,-2.2L21,7.4zM28.5,12.2l-1.1,2.4L25,15.6l2.4,1.1l1.1,2.4l1.1,-2.4l2.4,-1.1l-2.4,-1.1L28.5,12.2z"/>
|
||||||
|
</vector>
|
||||||
28
MotoActions/res/drawable/ic_settings_gestures_dashboard.xml
Normal file
28
MotoActions/res/drawable/ic_settings_gestures_dashboard.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="32.0"
|
||||||
|
android:viewportHeight="32.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M20,20.2V24H6V5.3h8.7l2.4,-4H7.6c-2.2,0 -4,1.8 -4,4v21.3c0,2.2 1.8,4 4,4h10.7c2.2,0 4,-1.8 4,-4V14.9L20,20.2zM15.6,28h-5.3v-1.3h5.3V28z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M28.5,7l1.1,-2.4L32,3.5l-2.4,-1.1L28.5,0l-1.1,2.4L25,3.5l2.4,1.1L28.5,7zM21,7.4l-2.2,-4.8l-2.2,4.8l-4.8,2.2l4.8,2.2l2.2,4.8l2.2,-4.8l4.8,-2.2L21,7.4zM28.5,12.2l-1.1,2.4L25,15.6l2.4,1.1l1.1,2.4l1.1,-2.4l2.4,-1.1l-2.4,-1.1L28.5,12.2z"/>
|
||||||
|
</vector>
|
||||||
22
MotoActions/res/drawable/ic_settings_screen_off_gestures.xml
Normal file
22
MotoActions/res/drawable/ic_settings_screen_off_gestures.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:tint="?android:attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M9,11.24L9,7.5C9,6.12 10.12,5 11.5,5S14,6.12 14,7.5v3.74c1.21,-0.81 2,-2.18 2,-3.74C16,5.01 13.99,3 11.5,3S7,5.01 7,7.5c0,1.56 0.79,2.93 2,3.74zM18.84,15.87l-4.54,-2.26c-0.17,-0.07 -0.35,-0.11 -0.54,-0.11L13,13.5v-6c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,6.67 10,7.5v10.74l-3.43,-0.72c-0.08,-0.01 -0.15,-0.03 -0.24,-0.03 -0.31,0 -0.59,0.13 -0.79,0.33l-0.79,0.8 4.94,4.94c0.27,0.27 0.65,0.44 1.06,0.44h6.79c0.75,0 1.33,-0.55 1.44,-1.28l0.75,-5.27c0.01,-0.07 0.02,-0.14 0.02,-0.2 0,-0.62 -0.38,-1.16 -0.91,-1.38z"/>
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_swipe_left.xml
Normal file
20
MotoActions/res/drawable/ic_swipe_left.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 10,9C 10,8.4477 10.4477,8 11,8C 11.5523,8 12,8.4477 12,9L 12,13.47L 13.21,13.6L 18.15,15.79C 18.6759,16.0317 19.0093,16.5613 19,17.14L 19,21.5C 18.974,22.3174 18.3174,22.974 17.5,23L 11,23C 10.6216,23.0009 10.2596,22.8453 10,22.57L 5.1,18.37L 5.84,17.6C 6.03083,17.3942 6.29936,17.2781 6.58,17.28L 6.8,17.28L 10,19L 10,9 Z M 3,4L 6,7L 6,5L 12,5L 12,3L 6,3L 6,1L 3,4 Z " />
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_swipe_right.xml
Normal file
20
MotoActions/res/drawable/ic_swipe_right.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 10,9C 10,8.4477 10.4477,8 11,8C 11.5523,8 12,8.4477 12,9L 12,13.47L 13.21,13.6L 18.15,15.79C 18.6759,16.0317 19.0093,16.5613 19,17.14L 19,21.5C 18.974,22.3174 18.3174,22.974 17.5,23L 11,23C 10.6216,23.0009 10.2596,22.8453 10,22.57L 5.1,18.37L 5.84,17.6C 6.03083,17.3942 6.29936,17.2781 6.58,17.28L 6.8,17.28L 10,19L 10,9 Z M 12,4L 9,1L 9,3L 3,3L 3,5L 9,5L 9,7L 12,4 Z " />
|
||||||
|
</vector>
|
||||||
23
MotoActions/res/drawable/ic_tap.xml
Normal file
23
MotoActions/res/drawable/ic_tap.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:pathData="M 10,9C 10,8.4477 10.4477,8 11,8C 11.5523,8 12,8.4477 12,9L 12,13.47L 13.21,13.6L 18.15,15.79C 18.6759,16.0317 19.0093,16.5613 19,17.14L 19,21.5C 18.974,22.3174 18.3174,22.974 17.5,23L 11,23C 10.6216,23.0009 10.2596,22.8453 10,22.57L 5.1,18.37L 5.84,17.6C 6.03083,17.3942 6.29936,17.2781 6.58,17.28L 6.8,17.28L 10,19L 10,9 Z M 11,5C 13.2091,5 15,6.79086 15,9C 15,10.4806 14.1956,11.7733 13,12.4649L 13,11.2361C 13.6137,10.6868 14,9.8885 14,9C 14,7.34315 12.6569,6 11,6C 9.34315,6 8,7.34315 8,9C 8,9.8885 8.38625,10.6868 9,11.2361L 9,12.4649C 7.8044,11.7733 7,10.4806 7,9C 7,6.79086 8.79086,5 11,5 Z "/>
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_tap_hold.xml
Normal file
20
MotoActions/res/drawable/ic_tap_hold.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 10,9C 10,8.45 10.45,8 11,8C 11.55,8 12,8.45 12,9L 12,13.47L 13.21,13.6L 18.15,15.79C 18.68,16.03 19,16.56 19,17.14L 19,21.5C 18.97,22.32 18.32,22.97 17.5,23L 11,23C 10.62,23 10.26,22.85 10,22.57L 5.1,18.37L 5.84,17.6C 6.03,17.39 6.3,17.28 6.58,17.28L 6.8,17.28L 10,19L 10,9 Z M 9,12.441L 9,9C 9,7.897 9.897,7 11,7C 12.103,7 13,7.897 13,9L 13,12.441C 14.188,11.746 15,10.469 15,9C 15,6.8 13.2,5 11,5C 8.8,5 7,6.8 7,9C 7,10.469 7.812,11.746 9,12.441 Z " />
|
||||||
|
</vector>
|
||||||
20
MotoActions/res/drawable/ic_vibrate.xml
Normal file
20
MotoActions/res/drawable/ic_vibrate.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<!--
|
||||||
|
Copyright (c) google/material-design-icons
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:height="24dp"
|
||||||
|
android:width="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?android:attr/colorControlNormal" >
|
||||||
|
<path android:fillColor="#000" android:pathData="M 16,19L 8,19L 8,5L 16,5M 16.5,3L 7.5,3C 6.67,3 6,3.67 6,4.5L 6,19.5C 6,20.33 6.67,21 7.5,21L 16.5,21C 17.33,21 18,20.33 18,19.5L 18,4.5C 18,3.67 17.33,3 16.5,3 Z M 19,17L 21,17L 21,7L 19,7M 22,9L 22,15L 24,15L 24,9M 3,17L 5,17L 5,7L 3,7M 0,15L 2,15L 2,9L 0,9L 0,15 Z" />
|
||||||
|
</vector>
|
||||||
BIN
MotoActions/res/drawable/motoactions_png.png
Normal file
BIN
MotoActions/res/drawable/motoactions_png.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
20
MotoActions/res/drawable/switchbar_background.xml
Normal file
20
MotoActions/res/drawable/switchbar_background.xml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="?android:attr/colorControlHighlight">
|
||||||
|
<item android:drawable="?android:attr/colorSecondary" />
|
||||||
|
</ripple>
|
||||||
32
MotoActions/res/layout/actions.xml
Normal file
32
MotoActions/res/layout/actions.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
** Copyright 2020, ronaxdevil <pratabidya.007@gmail.com>
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/motoactions_pic"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/motoactions_png" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
35
MotoActions/res/layout/doze.xml
Normal file
35
MotoActions/res/layout/doze.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
** Copyright 2014, The Android Open Source Project
|
||||||
|
** Copyright 2020, ronaxdevil <pratabidya.007@gmail.com>
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ambient_pic"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/ambient_png" />
|
||||||
|
|
||||||
|
<include layout="@layout/switch_bar" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
35
MotoActions/res/layout/fp_gesture.xml
Normal file
35
MotoActions/res/layout/fp_gesture.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
** Copyright 2014, The Android Open Source Project
|
||||||
|
** Copyright 2020, ronaxdevil <pratabidya.007@gmail.com>
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/fpgesture_pic"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/fpgesture_png" />
|
||||||
|
|
||||||
|
<include layout="@layout/switch_bar" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
32
MotoActions/res/layout/gesture.xml
Normal file
32
MotoActions/res/layout/gesture.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
** Copyright 2020, ronaxdevil <pratabidya.007@gmail.com>
|
||||||
|
**
|
||||||
|
** 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.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/gesture_pic"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/gesture_png" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Based off frameworks/base/core/res/res/layout/preference_category_material.xml
|
||||||
|
except that this supports icon -->
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:paddingStart="?android:attr/listPreferredItemPaddingStart" >
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/icon_container"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<com.android.internal.widget.PreferenceImageView
|
||||||
|
android:id="@android:id/icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:tint="?android:attr/textColorPrimary"
|
||||||
|
android:maxWidth="18dp"
|
||||||
|
android:maxHeight="18dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="56dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/title"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Body2"
|
||||||
|
android:textColor="?android:attr/colorAccent"
|
||||||
|
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/summary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
86
MotoActions/res/layout/preference_material_settings.xml
Normal file
86
MotoActions/res/layout/preference_material_settings.xml
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Based off frameworks/base/core/res/res/layout/preference_material.xml
|
||||||
|
except that this has the negative margin on the image removed. -->
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||||
|
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:clipToPadding="false">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/icon_container"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="56dp"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
<com.android.internal.widget.PreferenceImageView
|
||||||
|
android:id="@android:id/icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="48dp"
|
||||||
|
android:maxHeight="48dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="24dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||||
|
android:ellipsize="marquee"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/summary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="24dp"
|
||||||
|
android:layout_below="@android:id/title"
|
||||||
|
android:layout_alignStart="@android:id/title"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
android:maxLines="10"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- Preference should place its actual preference widget here. -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@android:id/widget_frame"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="end|center_vertical"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:orientation="vertical"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
48
MotoActions/res/layout/switch_bar.xml
Normal file
48
MotoActions/res/layout/switch_bar.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2016 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/switch_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:attr/actionBarSize"
|
||||||
|
android:background="@drawable/switchbar_background"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<TextView android:id="@+id/switch_text"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingStart="48dp"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
||||||
|
android:textColor="?android:attr/textColorPrimary"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:text="@string/switch_bar_on" />
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@android:id/switch_widget"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:background="@null"
|
||||||
|
android:theme="@style/MotoActions.SwitchBar" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
80
MotoActions/res/values-pt-rBR/strings.xml
Normal file
80
MotoActions/res/values-pt-rBR/strings.xml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2013-2016 The CyanogenMod Project
|
||||||
|
(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.
|
||||||
|
-->
|
||||||
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<!-- Title and summary -->
|
||||||
|
<string name="moto_actions_title">Moto Ações</string>
|
||||||
|
|
||||||
|
<!-- Device gestures -->
|
||||||
|
<string name="device_gestures_title">Gestos do dispositivo</string>
|
||||||
|
<string name="device_gestures_summary">Gerenciar os gestos do dispositivo</string>
|
||||||
|
|
||||||
|
<!-- Ambient display gestures -->
|
||||||
|
<string name="ambient_display_manage_summary">Gerenciar os gestos da tela ambiente</string>
|
||||||
|
|
||||||
|
<!-- Fingerprint gestures -->
|
||||||
|
<string name="fingerprint_gestures_title">Gestos no sensor biométrico</string>
|
||||||
|
<string name="fingerprint_gestures_summary">Habilitar o uso de gestos no sensor biométrico</string>
|
||||||
|
<string name="fingerprint_gestures_manage_summary">Gerenciar os gestos do sensor biométrico</string>
|
||||||
|
<string name="fingerprint_actions_screenon">Ações com a tela ligada</string>
|
||||||
|
<string name="tap_title">Toque único</string>
|
||||||
|
<string name="tap_dlg_title">Selecione a ação para toque único</string>
|
||||||
|
<string name="double_tap_title">Toque duplo</string>
|
||||||
|
<string name="double_tap_dlg_title">Selecione a ação para toque duplo</string>
|
||||||
|
<string name="long_tap_title">Toque longo</string>
|
||||||
|
<string name="long_tap_dlg_title">Selecione a ação para toque longo</string>
|
||||||
|
<string name="touchscreen_swipe_left_title">Deslizar para a esquerda</string>
|
||||||
|
<string name="swipe_left_dlg_title">Selecione a ação para deslizar para a esquerda</string>
|
||||||
|
<string name="touchscreen_swipe_right_title">Deslizar para a direita</string>
|
||||||
|
<string name="swipe_right_dlg_title">Selecione a ação para deslizar para a direita</string>
|
||||||
|
|
||||||
|
<!-- Fingerprint gestures screen off -->
|
||||||
|
<string name="fingerprint_gestures_screenoff_title">Habilitar com a tela desligada</string>
|
||||||
|
<string name="fingerprint_gestures_screenoff_summary">Habilitar os gestos no sensor biométrico quando a tela estiver desligada.\n\nO desbloqueio por impressão digital deve estar desativado para usar esse recurso.</string>
|
||||||
|
<string name="fingerprint_actions_screenoff">Ações com a tela desligada</string>
|
||||||
|
|
||||||
|
<!-- Actions -->
|
||||||
|
<string name="action_none">Não fazer nada</string>
|
||||||
|
<string name="action_home">Início</string>
|
||||||
|
<string name="action_power">Ligar/desligar tela</string>
|
||||||
|
<string name="action_wake">Acordar o dispositivo</string>
|
||||||
|
<string name="action_back">Voltar</string>
|
||||||
|
<string name="action_recents">Recentes</string>
|
||||||
|
<string name="action_last_app">Último app</string>
|
||||||
|
<string name="action_volume_up">Aumentar volume</string>
|
||||||
|
<string name="action_volume_down">Diminuir volume</string>
|
||||||
|
<string name="action_voice_assistant">Assistente de voz</string>
|
||||||
|
<string name="action_play_pause">Tocar/pausar</string>
|
||||||
|
<string name="action_previous_track">Faixa anterior</string>
|
||||||
|
<string name="action_next_track">Próxima faixa</string>
|
||||||
|
<string name="action_flashlight">Ligar/desligar lanterna</string>
|
||||||
|
<string name="action_camera">Abrir câmera</string>
|
||||||
|
<string name="action_screenshot">Tirar uma captura de tela</string>
|
||||||
|
<string name="action_browser">Abrir navegador</string>
|
||||||
|
<string name="action_dialer">Abrir discador</string>
|
||||||
|
<string name="action_email">Abrir app de mail</string>
|
||||||
|
<string name="action_messages">Abrir app de mensagens</string>
|
||||||
|
|
||||||
|
<!-- Double tap to wake -->
|
||||||
|
<string name="tap_to_wake">Tocar para ativar</string>
|
||||||
|
<string name="tap_to_wake_summary">Toque duas vezes em qualquer parte da tela para ativar o dispositivo</string>
|
||||||
|
|
||||||
|
<!-- Screen off gestures haptic feedback -->
|
||||||
|
<string name="touchscreen_gesture_haptic_feedback">Retorno tátil</string>
|
||||||
|
<string name="touchscreen_gesture_haptic_feedback_summary">Vibrar quando um gesto for detectado</string>
|
||||||
|
|
||||||
|
</resources>
|
||||||
75
MotoActions/res/values/array.xml
Normal file
75
MotoActions/res/values/array.xml
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<string-array name="fp_keys_listArray">
|
||||||
|
<item>@string/action_none</item>
|
||||||
|
<item>@string/action_home</item>
|
||||||
|
<item>@string/action_power</item>
|
||||||
|
<item>@string/action_back</item>
|
||||||
|
<item>@string/action_recents</item>
|
||||||
|
<item>@string/action_last_app</item>
|
||||||
|
<item>@string/action_volume_up</item>
|
||||||
|
<item>@string/action_volume_down</item>
|
||||||
|
<item>@string/action_voice_assistant</item>
|
||||||
|
<item>@string/action_play_pause</item>
|
||||||
|
<item>@string/action_previous_track</item>
|
||||||
|
<item>@string/action_next_track</item>
|
||||||
|
<item>@string/action_flashlight</item>
|
||||||
|
<item>@string/action_camera</item>
|
||||||
|
<item>@string/action_screenshot</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="fp_keys_listValues">
|
||||||
|
<item>0</item>
|
||||||
|
<item>100</item> <!-- home -->
|
||||||
|
<item>101</item> <!-- power -->
|
||||||
|
<item>102</item> <!-- back -->
|
||||||
|
<item>103</item> <!-- recents -->
|
||||||
|
<item>121</item> <!-- last app -->
|
||||||
|
<item>104</item> <!-- volume up -->
|
||||||
|
<item>105</item> <!-- volume down -->
|
||||||
|
<item>106</item> <!-- voice assistant -->
|
||||||
|
<item>107</item> <!-- play/pause -->
|
||||||
|
<item>108</item> <!-- previous track -->
|
||||||
|
<item>109</item> <!-- next track -->
|
||||||
|
<item>110</item> <!-- flashlight -->
|
||||||
|
<item>111</item> <!-- camera -->
|
||||||
|
<item>112</item> <!-- screenshot -->
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="fp_keys_screen_off_listArray">
|
||||||
|
<item>@string/action_none</item>
|
||||||
|
<item>@string/action_power</item>
|
||||||
|
<item>@string/action_volume_up</item>
|
||||||
|
<item>@string/action_volume_down</item>
|
||||||
|
<item>@string/action_play_pause</item>
|
||||||
|
<item>@string/action_previous_track</item>
|
||||||
|
<item>@string/action_next_track</item>
|
||||||
|
<item>@string/action_flashlight</item>
|
||||||
|
<item>@string/action_camera</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="fp_keys_screen_off_listValues">
|
||||||
|
<item>0</item>
|
||||||
|
<item>101</item> <!-- power -->
|
||||||
|
<item>104</item> <!-- volume up -->
|
||||||
|
<item>105</item> <!-- volume down -->
|
||||||
|
<item>107</item> <!-- play/pause -->
|
||||||
|
<item>108</item> <!-- previous track -->
|
||||||
|
<item>109</item> <!-- next track -->
|
||||||
|
<item>110</item> <!-- flashlight -->
|
||||||
|
<item>111</item> <!-- camera -->
|
||||||
|
</string-array>
|
||||||
|
</resources>
|
||||||
58
MotoActions/res/values/styles.xml
Normal file
58
MotoActions/res/values/styles.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
|
||||||
|
<style name="MotoActions" parent="@android:style/Theme.DeviceDefault.Settings">
|
||||||
|
<item name="dialogPreferenceStyle">@style/MotoActions.DialogPreferenceStyle</item>
|
||||||
|
<item name="preferenceCategoryStyle">@style/MotoActions.PreferenceCategoryStyle</item>
|
||||||
|
<item name="preferenceFragmentStyle">@style/MotoActions.PreferenceFragmentStyle</item>
|
||||||
|
<item name="preferenceStyle">@style/MotoActions.PreferenceStyle</item>
|
||||||
|
<item name="preferenceTheme">@style/MotoActions.PreferenceTheme</item>
|
||||||
|
<item name="switchPreferenceStyle">@style/MotoActions.SwitchPreferenceStyle</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.DialogPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
||||||
|
<item name="allowDividerAbove">true</item>
|
||||||
|
<item name="allowDividerBelow">true</item>
|
||||||
|
<item name="android:layout">@layout/preference_category_material_settings</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
||||||
|
<item name="allowDividerAfterLastItem">false</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
||||||
|
<item name="allowDividerAbove">false</item>
|
||||||
|
<item name="allowDividerBelow">false</item>
|
||||||
|
<item name="singleLineTitle">false</item>
|
||||||
|
<item name="android:layout">@layout/preference_material_settings</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.PreferenceTheme">
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.SwitchPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||||
|
<item name="widgetLayout">@*android:layout/preference_widget_switch</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MotoActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
56
MotoActions/res/xml/actions_panel.xml
Normal file
56
MotoActions/res/xml/actions_panel.xml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_camera_action"
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:title="@string/camera_gesture_title"
|
||||||
|
android:summary="@string/camera_gesture_summary"
|
||||||
|
android:icon="@drawable/ic_actions_twist" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_chop_chop"
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:title="@string/chop_chop_gesture_title"
|
||||||
|
android:summary="@string/chop_chop_gesture_summary"
|
||||||
|
android:icon="@drawable/ic_actions_chop" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_ir_silencer"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:title="@string/hand_wave_silencer_title"
|
||||||
|
android:summary="@string/hand_wave_silencer_summary"
|
||||||
|
android:icon="@drawable/ic_actions_wave" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_flip_to_mute"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:title="@string/flip_to_mute_title"
|
||||||
|
android:summary="@string/flip_to_mute_summary"
|
||||||
|
android:icon="@drawable/ic_actions_flip" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_lift_to_silence"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:title="@string/lift_to_silence_title"
|
||||||
|
android:summary="@string/lift_to_silence_summary"
|
||||||
|
android:icon="@drawable/ic_actions_lift" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
33
MotoActions/res/xml/doze_panel.xml
Normal file
33
MotoActions/res/xml/doze_panel.xml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_pick_up"
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:title="@string/pick_up_gesture_title"
|
||||||
|
android:summary="@string/pick_up_gesture_summary"
|
||||||
|
android:icon="@drawable/ic_pickup" />
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_hand_wave"
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:title="@string/hand_wave_gesture_title"
|
||||||
|
android:summary="@string/hand_wave_gesture_summary"
|
||||||
|
android:icon="@drawable/ic_hand" />
|
||||||
|
</PreferenceScreen>
|
||||||
27
MotoActions/res/xml/doze_panel_indexable.xml
Normal file
27
MotoActions/res/xml/doze_panel_indexable.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="doze"
|
||||||
|
android:title="@string/ambient_display_title"
|
||||||
|
android:summary="@string/ambient_display_manage_summary"
|
||||||
|
android:icon="@drawable/ic_settings_doze" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
157
MotoActions/res/xml/fp_gesture_panel.xml
Normal file
157
MotoActions/res/xml/fp_gesture_panel.xml
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="fp_home_scr_off"
|
||||||
|
android:enabled="false"
|
||||||
|
android:title="@string/fingerprint_gestures_screenoff_title"
|
||||||
|
android:icon="@drawable/ic_fingerprint"
|
||||||
|
android:summary="@string/fingerprint_gestures_screenoff_summary" />
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="fp_keys_scr_on"
|
||||||
|
android:title="@string/fingerprint_actions_screenon" >
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="fp_haptic"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:icon="@drawable/ic_vibrate"
|
||||||
|
android:title="@string/touchscreen_gesture_haptic_feedback"
|
||||||
|
android:summary="@string/touchscreen_gesture_haptic_feedback_summary" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/tap_dlg_title"
|
||||||
|
android:key="fp_keys"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_listArray"
|
||||||
|
android:icon="@drawable/ic_tap"
|
||||||
|
android:entryValues="@array/fp_keys_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/double_tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/double_tap_dlg_title"
|
||||||
|
android:key="fp_key_dbltap"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_listArray"
|
||||||
|
android:icon="@drawable/ic_double_tap"
|
||||||
|
android:entryValues="@array/fp_keys_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/long_tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/long_tap_dlg_title"
|
||||||
|
android:key="fp_key_hold"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_listArray"
|
||||||
|
android:icon="@drawable/ic_tap_hold"
|
||||||
|
android:entryValues="@array/fp_keys_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/touchscreen_swipe_left_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/swipe_left_dlg_title"
|
||||||
|
android:key="fp_key_left"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_listArray"
|
||||||
|
android:icon="@drawable/ic_swipe_left"
|
||||||
|
android:entryValues="@array/fp_keys_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:title="@string/touchscreen_swipe_right_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/swipe_right_dlg_title"
|
||||||
|
android:key="fp_key_right"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_listArray"
|
||||||
|
android:icon="@drawable/ic_swipe_right"
|
||||||
|
android:entryValues="@array/fp_keys_listValues" />
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory
|
||||||
|
android:key="fp_keys_scr_off"
|
||||||
|
android:title="@string/fingerprint_actions_screenoff"
|
||||||
|
android:enabled="false" >
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="fp_haptic_scr_off"
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:icon="@drawable/ic_vibrate"
|
||||||
|
android:title="@string/touchscreen_gesture_haptic_feedback"
|
||||||
|
android:summary="@string/touchscreen_gesture_haptic_feedback_summary" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:title="@string/tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/tap_dlg_title"
|
||||||
|
android:key="fp_keys_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_screen_off_listArray"
|
||||||
|
android:icon="@drawable/ic_tap"
|
||||||
|
android:entryValues="@array/fp_keys_screen_off_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:title="@string/double_tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/double_tap_dlg_title"
|
||||||
|
android:key="fp_key_dbltap_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_screen_off_listArray"
|
||||||
|
android:icon="@drawable/ic_double_tap"
|
||||||
|
android:entryValues="@array/fp_keys_screen_off_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:title="@string/long_tap_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/long_tap_dlg_title"
|
||||||
|
android:key="fp_key_hold_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_screen_off_listArray"
|
||||||
|
android:icon="@drawable/ic_tap_hold"
|
||||||
|
android:entryValues="@array/fp_keys_screen_off_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:title="@string/touchscreen_swipe_left_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/swipe_left_dlg_title"
|
||||||
|
android:key="fp_key_left_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_screen_off_listArray"
|
||||||
|
android:icon="@drawable/ic_swipe_left"
|
||||||
|
android:entryValues="@array/fp_keys_screen_off_listValues" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:dependency="fp_home_scr_off"
|
||||||
|
android:title="@string/touchscreen_swipe_right_title"
|
||||||
|
android:summary="%s"
|
||||||
|
android:dialogTitle="@string/swipe_right_dlg_title"
|
||||||
|
android:key="fp_key_right_off"
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:entries="@array/fp_keys_screen_off_listArray"
|
||||||
|
android:icon="@drawable/ic_swipe_right"
|
||||||
|
android:entryValues="@array/fp_keys_screen_off_listValues" />
|
||||||
|
|
||||||
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
27
MotoActions/res/xml/fp_gesture_panel_indexable.xml
Normal file
27
MotoActions/res/xml/fp_gesture_panel_indexable.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="fp_gestures"
|
||||||
|
android:title="@string/fingerprint_gestures_title"
|
||||||
|
android:summary="@string/fingerprint_gestures_manage_summary"
|
||||||
|
android:icon="@drawable/ic_settings_fingerprint" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
51
MotoActions/res/xml/main_panel.xml
Normal file
51
MotoActions/res/xml/main_panel.xml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="gestures"
|
||||||
|
android:title="@string/device_gestures_title"
|
||||||
|
android:summary="@string/device_gestures_summary"
|
||||||
|
android:icon="@drawable/ic_settings_gestures">
|
||||||
|
<intent
|
||||||
|
android:targetPackage="com.moto.actions"
|
||||||
|
android:targetClass="com.moto.actions.GestureSettingsActivity" />
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="doze"
|
||||||
|
android:title="@string/ambient_display_title"
|
||||||
|
android:summary="@string/ambient_display_manage_summary"
|
||||||
|
android:icon="@drawable/ic_settings_doze">
|
||||||
|
<intent
|
||||||
|
android:targetPackage="com.moto.actions"
|
||||||
|
android:targetClass="com.moto.actions.DozeSettingsActivity" />
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="fp_gestures"
|
||||||
|
android:title="@string/fingerprint_gestures_title"
|
||||||
|
android:summary="@string/fingerprint_gestures_manage_summary"
|
||||||
|
android:icon="@drawable/ic_settings_fingerprint">
|
||||||
|
<intent
|
||||||
|
android:targetPackage="com.moto.actions"
|
||||||
|
android:targetClass="com.moto.actions.FPGestureSettingsActivity" />
|
||||||
|
</Preference>
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
|
||||||
|
public class ActionsPreferenceActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFragmentManager().beginTransaction()
|
||||||
|
.replace(android.R.id.content, new ActionsPreferenceFragment()).commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015-2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.preference.PreferenceFragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
public class ActionsPreferenceFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
final View view = LayoutInflater.from(getContext()).inflate(R.layout.actions, container, false);
|
||||||
|
((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
addPreferencesFromResource(R.xml.main_panel);
|
||||||
|
}
|
||||||
|
}
|
||||||
68
MotoActions/src/com/moto/actions/BootCompletedReceiver.java
Normal file
68
MotoActions/src/com/moto/actions/BootCompletedReceiver.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.content.ServiceConnection;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.actions.Constants;
|
||||||
|
import com.moto.actions.ServiceWrapper.LocalBinder;
|
||||||
|
|
||||||
|
public class BootCompletedReceiver extends BroadcastReceiver {
|
||||||
|
static final String TAG = "MotoActions";
|
||||||
|
final String NAVBAR_SHOWN = "navbar_shown";
|
||||||
|
|
||||||
|
private ServiceWrapper mServiceWrapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(final Context context, Intent intent) {
|
||||||
|
Log.i(TAG, "Booting");
|
||||||
|
|
||||||
|
if (intent.getAction() != null && !intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore nodes to saved preference values
|
||||||
|
for (String pref : Constants.sPrefKeys) {
|
||||||
|
Constants.writePreference(context, pref);
|
||||||
|
}
|
||||||
|
|
||||||
|
context.startService(new Intent(context, ServiceWrapper.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ServiceConnection serviceConnection = new ServiceConnection() {
|
||||||
|
@Override
|
||||||
|
public void onServiceConnected(ComponentName className, IBinder service) {
|
||||||
|
LocalBinder binder = (LocalBinder) service;
|
||||||
|
mServiceWrapper = binder.getService();
|
||||||
|
mServiceWrapper.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceDisconnected(ComponentName className) {
|
||||||
|
mServiceWrapper = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
35
MotoActions/src/com/moto/actions/DozeSettingsActivity.java
Normal file
35
MotoActions/src/com/moto/actions/DozeSettingsActivity.java
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
|
||||||
|
public class DozeSettingsActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getActionBar().setTitle(R.string.ambient_display_title);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFragmentManager().beginTransaction()
|
||||||
|
.replace(android.R.id.content, new DozeSettingsFragment()).commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
101
MotoActions/src/com/moto/actions/DozeSettingsFragment.java
Normal file
101
MotoActions/src/com/moto/actions/DozeSettingsFragment.java
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.preference.PreferenceFragment;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import androidx.preference.Preference;
|
||||||
|
import androidx.preference.SwitchPreference;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.Switch;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
public class DozeSettingsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
private SwitchPreference mHandwavePreference;
|
||||||
|
private SwitchPreference mPickupPreference;
|
||||||
|
|
||||||
|
private TextView mSwitchBarText;
|
||||||
|
private Switch mAmbientDisplaySwitch;
|
||||||
|
|
||||||
|
private String KEY_GESTURE_HAND_WAVE = "gesture_hand_wave";
|
||||||
|
private String KEY_GESTURE_PICK_UP = "gesture_pick_up";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
final View view = LayoutInflater.from(getContext()).inflate(R.layout.doze, container, false);
|
||||||
|
((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
View switchBar = view.findViewById(R.id.switch_bar);
|
||||||
|
mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
|
||||||
|
mAmbientDisplaySwitch.setChecked(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
|
||||||
|
mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener);
|
||||||
|
|
||||||
|
switchBar.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mAmbientDisplaySwitch.toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mSwitchBarText = switchBar.findViewById(R.id.switch_text);
|
||||||
|
mSwitchBarText.setText(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()) ? R.string.switch_bar_on :
|
||||||
|
R.string.switch_bar_off);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
addPreferencesFromResource(R.xml.doze_panel);
|
||||||
|
boolean dozeEnabled = MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver());
|
||||||
|
mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE);
|
||||||
|
mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP);
|
||||||
|
updatePrefs(dozeEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private CompoundButton.OnCheckedChangeListener mAmbientDisplayPrefListener =
|
||||||
|
new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean enable) {
|
||||||
|
if (enableDoze(enable)) {
|
||||||
|
updatePrefs(enable);
|
||||||
|
mSwitchBarText.setText(enable ? R.string.switch_bar_on : R.string.switch_bar_off);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void updatePrefs(boolean enabled){
|
||||||
|
mHandwavePreference.setEnabled(enabled);
|
||||||
|
mPickupPreference.setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean enableDoze(boolean enable) {
|
||||||
|
return Settings.Secure.putInt(getActivity().getContentResolver(),
|
||||||
|
Settings.Secure.DOZE_ENABLED, enable ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
|
||||||
|
public class FPGestureSettingsActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getActionBar().setTitle(R.string.fingerprint_gestures_title);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFragmentManager().beginTransaction()
|
||||||
|
.replace(android.R.id.content, new FPGestureSettingsFragment()).commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
120
MotoActions/src/com/moto/actions/FPGestureSettingsFragment.java
Normal file
120
MotoActions/src/com/moto/actions/FPGestureSettingsFragment.java
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences.Editor;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import androidx.preference.PreferenceCategory;
|
||||||
|
import androidx.preference.SwitchPreference;
|
||||||
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
|
import androidx.preference.PreferenceFragment;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.Switch;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.moto.actions.actions.Constants;
|
||||||
|
|
||||||
|
import static com.moto.actions.actions.Constants.FP_HOME_KEY;
|
||||||
|
import static com.moto.actions.actions.Constants.FP_HOME_KEY_OFF;
|
||||||
|
|
||||||
|
public class FPGestureSettingsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
private SwitchPreference mFPScreenOffGesture;
|
||||||
|
private PreferenceCategory mFPScreenOffCategory;
|
||||||
|
private PreferenceCategory mFPScreenOnCategory;
|
||||||
|
|
||||||
|
private TextView mSwitchBarText;
|
||||||
|
private Switch mFPGestureSwitch;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
final View view = LayoutInflater.from(getContext()).inflate(R.layout.fp_gesture, container, false);
|
||||||
|
((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
View switchBar = view.findViewById(R.id.switch_bar);
|
||||||
|
mFPGestureSwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
|
||||||
|
mFPGestureSwitch.setChecked(isFPGestureEnabled());
|
||||||
|
mFPGestureSwitch.setOnCheckedChangeListener(mFPGesturePrefListener);
|
||||||
|
|
||||||
|
switchBar.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mFPGestureSwitch.toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
mSwitchBarText = switchBar.findViewById(R.id.switch_text);
|
||||||
|
mSwitchBarText.setText(isFPGestureEnabled() ? R.string.switch_bar_on :
|
||||||
|
R.string.switch_bar_off);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePrefs(boolean enabled){
|
||||||
|
Editor prefEditor = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit();
|
||||||
|
prefEditor.putBoolean(FP_HOME_KEY, enabled);
|
||||||
|
prefEditor.apply();
|
||||||
|
mFPScreenOnCategory.setEnabled(enabled);
|
||||||
|
mFPScreenOffGesture.setEnabled(enabled);
|
||||||
|
mFPScreenOffCategory.setEnabled(enabled);
|
||||||
|
if(enabled){
|
||||||
|
boolean hasEnrolledFingerprints = hasEnrolledFingerprints();
|
||||||
|
mFPScreenOffGesture.setEnabled(!hasEnrolledFingerprints);
|
||||||
|
mFPScreenOffCategory.setEnabled(!hasEnrolledFingerprints);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFPGestureEnabled(){
|
||||||
|
return Constants.isPreferenceEnabled(getActivity(), FP_HOME_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
addPreferencesFromResource(R.xml.fp_gesture_panel);
|
||||||
|
mFPScreenOffGesture = (SwitchPreference) findPreference(FP_HOME_KEY_OFF);
|
||||||
|
mFPScreenOffCategory = (PreferenceCategory) findPreference("fp_keys_scr_off");
|
||||||
|
mFPScreenOnCategory = (PreferenceCategory) findPreference("fp_keys_scr_on");
|
||||||
|
updatePrefs(isFPGestureEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
|
private CompoundButton.OnCheckedChangeListener mFPGesturePrefListener =
|
||||||
|
new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton compoundButton, boolean enable) {
|
||||||
|
updatePrefs(enable);
|
||||||
|
mSwitchBarText.setText(enable ? R.string.switch_bar_on : R.string.switch_bar_off);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private boolean hasEnrolledFingerprints(){
|
||||||
|
FingerprintManager fingerprintManager = (FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
|
||||||
|
return fingerprintManager.hasEnrolledFingerprints();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
|
||||||
|
public class GestureSettingsActivity extends PreferenceActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
if (getActionBar() != null) {
|
||||||
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFragmentManager().beginTransaction()
|
||||||
|
.replace(android.R.id.content, new GestureSettingsFragment()).commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import androidx.preference.PreferenceFragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
public class GestureSettingsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
final View view = LayoutInflater.from(getContext()).inflate(R.layout.gesture, container, false);
|
||||||
|
((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
addPreferencesFromResource(R.xml.actions_panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
756
MotoActions/src/com/moto/actions/KeyHandler.java
Normal file
756
MotoActions/src/com/moto/actions/KeyHandler.java
Normal file
@@ -0,0 +1,756 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.app.ActivityManagerNative;
|
||||||
|
import android.app.ISearchManager;
|
||||||
|
import android.app.KeyguardManager;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.camera2.CameraAccessException;
|
||||||
|
import android.hardware.camera2.CameraCharacteristics;
|
||||||
|
import android.hardware.camera2.CameraManager;
|
||||||
|
import android.hardware.input.InputManager;
|
||||||
|
import android.media.AudioAttributes;
|
||||||
|
import android.media.session.MediaSessionLegacyHelper;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.os.PowerManager.WakeLock;
|
||||||
|
import android.os.RemoteException;
|
||||||
|
import android.os.ServiceManager;
|
||||||
|
import android.os.SystemClock;
|
||||||
|
import android.os.UserHandle;
|
||||||
|
import android.os.VibrationEffect;
|
||||||
|
import android.os.Vibrator;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.InputDevice;
|
||||||
|
import android.view.KeyCharacterMap;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.ViewConfiguration;
|
||||||
|
|
||||||
|
import com.android.internal.os.DeviceKeyHandler;
|
||||||
|
import com.android.internal.util.ArrayUtils;
|
||||||
|
|
||||||
|
import com.moto.actions.util.FileUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.moto.actions.actions.Constants.*;
|
||||||
|
|
||||||
|
public class KeyHandler implements DeviceKeyHandler {
|
||||||
|
|
||||||
|
private static final String TAG = KeyHandler.class.getSimpleName();
|
||||||
|
|
||||||
|
private static final int GESTURE_REQUEST = 1;
|
||||||
|
private static final int FP_ACTION_REQUEST = 2;
|
||||||
|
|
||||||
|
private static final String ACTION_DISMISS_KEYGUARD =
|
||||||
|
"com.android.keyguard.action.DISMISS_KEYGUARD_SECURELY";
|
||||||
|
|
||||||
|
private static final String GESTURE_WAKEUP_REASON = "keyhandler-gesture-wakeup";
|
||||||
|
private static final int GESTURE_WAKELOCK_DURATION = 3000;
|
||||||
|
private static final AudioAttributes VIBRATION_ATTRIBUTES = new AudioAttributes.Builder()
|
||||||
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||||
|
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
|
||||||
|
.build();
|
||||||
|
private final Context mContext;
|
||||||
|
private final PowerManager mPowerManager;
|
||||||
|
WakeLock mGestureWakeLock;
|
||||||
|
private KeyguardManager mKeyguardManager;
|
||||||
|
private FPScreenOffGesturesHandler mFPScreenOffGesturesHandler;
|
||||||
|
private CameraManager mCameraManager;
|
||||||
|
private String mRearCameraId;
|
||||||
|
private boolean mTorchEnabled;
|
||||||
|
private Vibrator mVibrator;
|
||||||
|
private ISearchManager mSearchManagerService;
|
||||||
|
private Handler mHandler;
|
||||||
|
private int fpTapCounts = 0;
|
||||||
|
private boolean fpTapPending = false;
|
||||||
|
private boolean fpGesturePending = false;
|
||||||
|
private Runnable doubleTapRunnable = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
int action = 0;
|
||||||
|
if (fpTapCounts > 1) {
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEY_DBLTAP_NODE)));
|
||||||
|
} else {
|
||||||
|
if (isSingleTapEnabledOnFP()) {
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEYS_NODE)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (action != 0) {
|
||||||
|
boolean isActionSupported = ArrayUtils.contains(mPowerManager.isScreenOn() ? sFPSupportedActions : sFPSupportedActionsScreenOff, action);
|
||||||
|
if (isActionSupported) {
|
||||||
|
fireFPAction(action, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetDoubleTapOnFP();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private Runnable fpGestureRunnable = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
resetFPGestureDelay();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public KeyHandler(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
|
||||||
|
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
|
mFPScreenOffGesturesHandler = new FPScreenOffGesturesHandler();
|
||||||
|
|
||||||
|
mGestureWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
|
||||||
|
"GestureWakeLock");
|
||||||
|
|
||||||
|
mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
if (mVibrator == null || !mVibrator.hasVibrator()) {
|
||||||
|
mVibrator = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
||||||
|
mCameraManager.registerTorchCallback(new MyTorchCallback(), null);
|
||||||
|
|
||||||
|
mHandler = new Handler(Looper.getMainLooper());
|
||||||
|
}
|
||||||
|
|
||||||
|
static long[] getLongIntArray(Resources r, int resid) {
|
||||||
|
int[] ar = r.getIntArray(resid);
|
||||||
|
if (ar == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
long[] out = new long[ar.length];
|
||||||
|
for (int i = 0; i < ar.length; i++) {
|
||||||
|
out[i] = ar[i];
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActivityInfo getRunningActivityInfo(Context context) {
|
||||||
|
final ActivityManager am = (ActivityManager) context
|
||||||
|
.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
final PackageManager pm = context.getPackageManager();
|
||||||
|
|
||||||
|
List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(1);
|
||||||
|
if (tasks != null && !tasks.isEmpty()) {
|
||||||
|
ActivityManager.RunningTaskInfo top = tasks.get(0);
|
||||||
|
try {
|
||||||
|
return pm.getActivityInfo(top.topActivity, 0);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void dispatchMediaKeyWithWakeLock(int keycode, Context context) {
|
||||||
|
if (ActivityManagerNative.isSystemReady()) {
|
||||||
|
KeyEvent event = new KeyEvent(SystemClock.uptimeMillis(),
|
||||||
|
SystemClock.uptimeMillis(), KeyEvent.ACTION_DOWN, keycode, 0);
|
||||||
|
MediaSessionLegacyHelper.getHelper(context).sendMediaButtonEvent(event, true);
|
||||||
|
event = KeyEvent.changeAction(event, KeyEvent.ACTION_UP);
|
||||||
|
MediaSessionLegacyHelper.getHelper(context).sendMediaButtonEvent(event, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void switchToLastApp(Context context) {
|
||||||
|
final ActivityManager am =
|
||||||
|
(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
ActivityManager.RunningTaskInfo lastTask = getLastTask(context, am);
|
||||||
|
|
||||||
|
if (lastTask != null) {
|
||||||
|
am.moveTaskToFront(lastTask.id, ActivityManager.MOVE_TASK_NO_USER_ACTION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActivityManager.RunningTaskInfo getLastTask(Context context,
|
||||||
|
final ActivityManager am) {
|
||||||
|
final String defaultHomePackage = resolveCurrentLauncherPackage(context);
|
||||||
|
List<ActivityManager.RunningTaskInfo> tasks = am.getRunningTasks(5);
|
||||||
|
|
||||||
|
for (int i = 1; i < tasks.size(); i++) {
|
||||||
|
String packageName = tasks.get(i).topActivity.getPackageName();
|
||||||
|
if (!packageName.equals(defaultHomePackage)
|
||||||
|
&& !packageName.equals(context.getPackageName())
|
||||||
|
&& !packageName.equals("com.android.systemui")) {
|
||||||
|
return tasks.get(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String resolveCurrentLauncherPackage(Context context) {
|
||||||
|
final Intent launcherIntent = new Intent(Intent.ACTION_MAIN)
|
||||||
|
.addCategory(Intent.CATEGORY_HOME);
|
||||||
|
final PackageManager pm = context.getPackageManager();
|
||||||
|
final ResolveInfo launcherInfo = pm.resolveActivity(launcherIntent, 0);
|
||||||
|
return launcherInfo.activityInfo.packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getRearCameraId() {
|
||||||
|
if (mRearCameraId == null) {
|
||||||
|
try {
|
||||||
|
for (final String cameraId : mCameraManager.getCameraIdList()) {
|
||||||
|
CameraCharacteristics characteristics =
|
||||||
|
mCameraManager.getCameraCharacteristics(cameraId);
|
||||||
|
int cOrientation = characteristics.get(CameraCharacteristics.LENS_FACING);
|
||||||
|
if (cOrientation == CameraCharacteristics.LENS_FACING_BACK) {
|
||||||
|
mRearCameraId = cameraId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (CameraAccessException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mRearCameraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Intent getLaunchableIntent(Intent intent) {
|
||||||
|
PackageManager pm = mContext.getPackageManager();
|
||||||
|
List<ResolveInfo> resInfo = pm.queryIntentActivities(intent, 0);
|
||||||
|
if (resInfo.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return pm.getLaunchIntentForPackage(resInfo.get(0).activityInfo.packageName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void triggerCameraAction() {
|
||||||
|
ensureKeyguardManager();
|
||||||
|
WakeLock wl = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "GestureWakeLock");
|
||||||
|
wl.acquire(500);
|
||||||
|
if (mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
|
launchSecureCamera();
|
||||||
|
} else {
|
||||||
|
launchCamera();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void launchCamera() {
|
||||||
|
Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addFlags(Intent.FLAG_FROM_BACKGROUND);
|
||||||
|
if (getBestActivityInfo(intent) != null) {
|
||||||
|
// Only launch if we can succeed, but let the user pick the action
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void launchSecureCamera() {
|
||||||
|
// Keyguard won't allow a picker, try to pick the secure intent in the package
|
||||||
|
// that would be the one used for a default action of launching the camera
|
||||||
|
Intent normalIntent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
||||||
|
normalIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
normalIntent.addFlags(Intent.FLAG_FROM_BACKGROUND);
|
||||||
|
|
||||||
|
Intent secureIntent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE);
|
||||||
|
secureIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
secureIntent.addFlags(Intent.FLAG_FROM_BACKGROUND);
|
||||||
|
|
||||||
|
ActivityInfo normalActivity = getBestActivityInfo(normalIntent);
|
||||||
|
ActivityInfo secureActivity = getBestActivityInfo(secureIntent, normalActivity);
|
||||||
|
if (secureActivity != null) {
|
||||||
|
secureIntent.setComponent(new ComponentName(secureActivity.applicationInfo.packageName, secureActivity.name));
|
||||||
|
mContext.startActivity(secureIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActivityInfo getBestActivityInfo(Intent intent) {
|
||||||
|
PackageManager pm = mContext.getPackageManager();
|
||||||
|
ResolveInfo resolveInfo = pm.resolveActivity(intent, 0);
|
||||||
|
if (resolveInfo != null) {
|
||||||
|
return resolveInfo.activityInfo;
|
||||||
|
} else {
|
||||||
|
// If the resolving failed, just find our own best match
|
||||||
|
return getBestActivityInfo(intent, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActivityInfo getBestActivityInfo(Intent intent, ActivityInfo match) {
|
||||||
|
PackageManager pm = mContext.getPackageManager();
|
||||||
|
List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
|
||||||
|
ActivityInfo best = null;
|
||||||
|
if (activities.size() > 0) {
|
||||||
|
best = activities.get(0).activityInfo;
|
||||||
|
if (match != null) {
|
||||||
|
String packageName = match.applicationInfo.packageName;
|
||||||
|
for (int i = activities.size() - 1; i >= 0; i--) {
|
||||||
|
ActivityInfo activityInfo = activities.get(i).activityInfo;
|
||||||
|
if (packageName.equals(activityInfo.applicationInfo.packageName)) {
|
||||||
|
best = activityInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openBrowser() {
|
||||||
|
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
|
||||||
|
mPowerManager.wakeUp(SystemClock.uptimeMillis(), GESTURE_WAKEUP_REASON);
|
||||||
|
final Intent intent = getLaunchableIntent(
|
||||||
|
new Intent(Intent.ACTION_VIEW, Uri.parse("http:")));
|
||||||
|
startActivitySafely(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openDialer() {
|
||||||
|
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
|
||||||
|
mPowerManager.wakeUp(SystemClock.uptimeMillis(), GESTURE_WAKEUP_REASON);
|
||||||
|
final Intent intent = new Intent(Intent.ACTION_DIAL, null);
|
||||||
|
startActivitySafely(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openEmail() {
|
||||||
|
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
|
||||||
|
mPowerManager.wakeUp(SystemClock.uptimeMillis(), GESTURE_WAKEUP_REASON);
|
||||||
|
final Intent intent = getLaunchableIntent(
|
||||||
|
new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:")));
|
||||||
|
startActivitySafely(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openMessages() {
|
||||||
|
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
|
||||||
|
mPowerManager.wakeUp(SystemClock.uptimeMillis(), GESTURE_WAKEUP_REASON);
|
||||||
|
final String defaultApplication = Settings.Secure.getString(
|
||||||
|
mContext.getContentResolver(), "sms_default_application");
|
||||||
|
final PackageManager pm = mContext.getPackageManager();
|
||||||
|
final Intent intent = pm.getLaunchIntentForPackage(defaultApplication);
|
||||||
|
if (intent != null) {
|
||||||
|
startActivitySafely(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleFlashlight() {
|
||||||
|
String rearCameraId = getRearCameraId();
|
||||||
|
if (rearCameraId != null) {
|
||||||
|
mGestureWakeLock.acquire(GESTURE_WAKELOCK_DURATION);
|
||||||
|
try {
|
||||||
|
mCameraManager.setTorchMode(rearCameraId, !mTorchEnabled);
|
||||||
|
mTorchEnabled = !mTorchEnabled;
|
||||||
|
} catch (CameraAccessException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ensureKeyguardManager() {
|
||||||
|
if (mKeyguardManager == null) {
|
||||||
|
mKeyguardManager =
|
||||||
|
(KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetDoubleTapOnFP() {
|
||||||
|
fpTapCounts = 0;
|
||||||
|
fpTapPending = false;
|
||||||
|
mHandler.removeCallbacks(doubleTapRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void detectDoubleTapOnFP() {
|
||||||
|
fpTapCounts++;
|
||||||
|
if (fpTapCounts == 1 || fpTapCounts == 2) {
|
||||||
|
doHapticFeedbackFP(false);
|
||||||
|
}
|
||||||
|
if (!fpTapPending) {
|
||||||
|
fpTapPending = true;
|
||||||
|
mHandler.postDelayed(doubleTapRunnable, ViewConfiguration.getDoubleTapTimeout());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isSingleTapEnabledOnFP() {
|
||||||
|
return !FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEYS_NODE)).equals("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isDoubleTapEnabledOnFP() {
|
||||||
|
return !FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEY_DBLTAP_NODE)).equals("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isHapticFeedbackEnabledOnFP() {
|
||||||
|
return !FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_HAPTIC_NODE)).equals("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getFPNodeBasedOnScreenState(String node) {
|
||||||
|
if (mPowerManager.isScreenOn()) {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
switch (node) {
|
||||||
|
case FP_KEYS_NODE:
|
||||||
|
return FP_KEYS_SCREENOFF_NODE;
|
||||||
|
case FP_HAPTIC_NODE:
|
||||||
|
return FP_HAPTIC_SCREENOFF_NODE;
|
||||||
|
case FP_KEY_DBLTAP_NODE:
|
||||||
|
return FP_KEY_SCREENOFF_DBLTAP_NODE;
|
||||||
|
case FP_KEY_HOLD_NODE:
|
||||||
|
return FP_KEY_SCREENOFF_HOLD_NODE;
|
||||||
|
case FP_KEY_RIGHT_NODE:
|
||||||
|
return FP_KEY_SCREENOFF_RIGHT_NODE;
|
||||||
|
case FP_KEY_LEFT_NODE:
|
||||||
|
return FP_KEY_SCREENOFF_LEFT_NODE;
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyEvent handleKeyEvent(KeyEvent event) {
|
||||||
|
int scanCode = event.getScanCode();
|
||||||
|
|
||||||
|
if (DEBUG) {
|
||||||
|
Log.d(TAG, "DEBUG: action=" + event.getAction()
|
||||||
|
+ ", flags=" + event.getFlags()
|
||||||
|
+ ", keyCode=" + event.getKeyCode()
|
||||||
|
+ ", scanCode=" + event.getScanCode()
|
||||||
|
+ ", metaState=" + event.getMetaState()
|
||||||
|
+ ", repeatCount=" + event.getRepeatCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isFPScanCode = ArrayUtils.contains(sSupportedFPGestures, scanCode);
|
||||||
|
if (!isFPScanCode) {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isFPGestureEnabled = FileUtils.readOneLine(FP_HOME_NODE).equals("1");
|
||||||
|
boolean isFPGestureEnabledOnScreenOff = FileUtils.readOneLine(FP_HOME_OFF_NODE).equals("1");
|
||||||
|
|
||||||
|
boolean isScreenOn = mPowerManager.isScreenOn();
|
||||||
|
|
||||||
|
// We only want ACTION_UP event
|
||||||
|
if (event.getAction() != KeyEvent.ACTION_UP) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFPScanCode){
|
||||||
|
if (fpGesturePending) {
|
||||||
|
return event;
|
||||||
|
} else {
|
||||||
|
resetFPGestureDelay();
|
||||||
|
fpGesturePending = true;
|
||||||
|
mHandler.postDelayed(fpGestureRunnable, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scanCode != FP_TAP_SCANCODE) {
|
||||||
|
resetDoubleTapOnFP();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFPScanCode) {
|
||||||
|
if ((!isFPGestureEnabled) || (!isScreenOn && !isFPGestureEnabledOnScreenOff)) {
|
||||||
|
resetDoubleTapOnFP();
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
if (!isScreenOn && isFPGestureEnabledOnScreenOff) {
|
||||||
|
processFPScreenOffScancode(scanCode);
|
||||||
|
} else {
|
||||||
|
processFPScancode(scanCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processFPScancode(int scanCode) {
|
||||||
|
int action = 0;
|
||||||
|
boolean isScreenOn = mPowerManager.isScreenOn();
|
||||||
|
switch (scanCode) {
|
||||||
|
case FP_TAP_SCANCODE:
|
||||||
|
if (isDoubleTapEnabledOnFP()) {
|
||||||
|
detectDoubleTapOnFP();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
resetDoubleTapOnFP();
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEYS_NODE)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FP_HOLD_SCANCODE:
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEY_HOLD_NODE)));
|
||||||
|
break;
|
||||||
|
case FP_RIGHT_SCANCODE:
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEY_RIGHT_NODE)));
|
||||||
|
break;
|
||||||
|
case FP_LEFT_SCANCODE:
|
||||||
|
action = str2int(FileUtils.readOneLine(getFPNodeBasedOnScreenState(FP_KEY_LEFT_NODE)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
boolean isActionSupported = ArrayUtils.contains(isScreenOn ? sFPSupportedActions : sFPSupportedActionsScreenOff, action);
|
||||||
|
if (isActionSupported) {
|
||||||
|
fireFPAction(action, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireFPAction(int action, boolean isDoubleTap) {
|
||||||
|
ensureKeyguardManager();
|
||||||
|
boolean isHapticFeedbackEnabledOnFP = isHapticFeedbackEnabledOnFP();
|
||||||
|
if (isDoubleTap && action != ACTION_CAMERA && action != ACTION_FLASHLIGHT) {
|
||||||
|
isHapticFeedbackEnabledOnFP = false;
|
||||||
|
}
|
||||||
|
if (isHapticFeedbackEnabledOnFP){
|
||||||
|
if (action == ACTION_CAMERA || action == ACTION_FLASHLIGHT) {
|
||||||
|
vibrate(action == ACTION_CAMERA ? 500 : 250);
|
||||||
|
}else if (action != ACTION_VOICE_ASSISTANT) {
|
||||||
|
doHapticFeedbackFP(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (action) {
|
||||||
|
case ACTION_HOME:
|
||||||
|
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_HOME);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_POWER:
|
||||||
|
toggleScreenState();
|
||||||
|
break;
|
||||||
|
case ACTION_BACK:
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_BACK);
|
||||||
|
break;
|
||||||
|
case ACTION_RECENTS:
|
||||||
|
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_APP_SWITCH);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACTION_VOLUME_UP:
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_VOLUME_UP);
|
||||||
|
break;
|
||||||
|
case ACTION_VOLUME_DOWN:
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_VOLUME_DOWN);
|
||||||
|
break;
|
||||||
|
case ACTION_VOICE_ASSISTANT:
|
||||||
|
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
|
fireGoogleNowOnTap();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case ACTION_PLAY_PAUSE:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_PREVIOUS_TRACK:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_PREVIOUS, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_NEXT_TRACK:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_NEXT, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_FLASHLIGHT:
|
||||||
|
toggleFlashlight();
|
||||||
|
break;
|
||||||
|
case ACTION_CAMERA:
|
||||||
|
triggerCameraAction();
|
||||||
|
break;
|
||||||
|
case ACTION_SCREENSHOT:
|
||||||
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_SYSRQ);
|
||||||
|
break;
|
||||||
|
case ACTION_LAST_APP:
|
||||||
|
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
|
switchToLastApp(mContext);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void vibrate(int intensity) {
|
||||||
|
if (mVibrator == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mVibrator.vibrate(intensity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toggleScreenState() {
|
||||||
|
if (mPowerManager.isScreenOn()) {
|
||||||
|
mPowerManager.goToSleep(SystemClock.uptimeMillis());
|
||||||
|
} else {
|
||||||
|
mPowerManager.wakeUp(SystemClock.uptimeMillis());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void triggerVirtualKeypress(final Handler handler, final int keyCode) {
|
||||||
|
final InputManager im = InputManager.getInstance();
|
||||||
|
long now = SystemClock.uptimeMillis();
|
||||||
|
|
||||||
|
final KeyEvent downEvent = new KeyEvent(now, now, KeyEvent.ACTION_DOWN,
|
||||||
|
keyCode, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
|
||||||
|
KeyEvent.FLAG_FROM_SYSTEM, InputDevice.SOURCE_CLASS_BUTTON);
|
||||||
|
final KeyEvent upEvent = KeyEvent.changeAction(downEvent,
|
||||||
|
KeyEvent.ACTION_UP);
|
||||||
|
|
||||||
|
// add a small delay to make sure everything behind got focus
|
||||||
|
handler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
im.injectInputEvent(downEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
handler.postDelayed(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
im.injectInputEvent(upEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
|
||||||
|
}
|
||||||
|
}, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireGoogleNowOnTap() {
|
||||||
|
doHapticFeedbackFP(true);
|
||||||
|
mSearchManagerService = ISearchManager.Stub.asInterface(ServiceManager.getService(Context.SEARCH_SERVICE));
|
||||||
|
if (mSearchManagerService != null) {
|
||||||
|
try {
|
||||||
|
mSearchManagerService.launchAssist(new Bundle());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int str2int(String str) {
|
||||||
|
if (str == null || str.isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Integer.valueOf(str);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processFPScreenOffScancode(int scanCode) {
|
||||||
|
if (!mFPScreenOffGesturesHandler.hasMessages(FP_ACTION_REQUEST)) {
|
||||||
|
Message msg = mFPScreenOffGesturesHandler.obtainMessage(FP_ACTION_REQUEST);
|
||||||
|
msg.arg1 = scanCode;
|
||||||
|
mFPScreenOffGesturesHandler.sendMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetFPGestureDelay() {
|
||||||
|
fpGesturePending = false;
|
||||||
|
mHandler.removeCallbacks(fpGestureRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fireScreenOffAction(int action) {
|
||||||
|
boolean haptic = Settings.System.getInt(mContext.getContentResolver(), KEY_GESTURE_ENABLE_HAPTIC_FEEDBACK, 1) != 0;
|
||||||
|
if (haptic && (action == ACTION_CAMERA || action == ACTION_FLASHLIGHT)) {
|
||||||
|
vibrate(action == ACTION_CAMERA ? 500 : 250);
|
||||||
|
}
|
||||||
|
if (haptic && action == ACTION_POWER){
|
||||||
|
doHapticFeedbackScreenOff();
|
||||||
|
}
|
||||||
|
switch (action) {
|
||||||
|
case ACTION_POWER:
|
||||||
|
toggleScreenState();
|
||||||
|
break;
|
||||||
|
case ACTION_PLAY_PAUSE:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_PREVIOUS_TRACK:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_PREVIOUS, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_NEXT_TRACK:
|
||||||
|
dispatchMediaKeyWithWakeLock(KeyEvent.KEYCODE_MEDIA_NEXT, mContext);
|
||||||
|
break;
|
||||||
|
case ACTION_FLASHLIGHT:
|
||||||
|
toggleFlashlight();
|
||||||
|
break;
|
||||||
|
case ACTION_CAMERA:
|
||||||
|
triggerCameraAction();
|
||||||
|
break;
|
||||||
|
case ACTION_BROWSER:
|
||||||
|
openBrowser();
|
||||||
|
break;
|
||||||
|
case ACTION_DIALER:
|
||||||
|
openDialer();
|
||||||
|
break;
|
||||||
|
case ACTION_EMAIL:
|
||||||
|
openEmail();
|
||||||
|
break;
|
||||||
|
case ACTION_MESSAGES:
|
||||||
|
openMessages();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (action != ACTION_FLASHLIGHT && action != ACTION_CAMERA && action != ACTION_POWER) {
|
||||||
|
doHapticFeedbackScreenOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startActivitySafely(Intent intent) {
|
||||||
|
intent.addFlags(
|
||||||
|
Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
| Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||||
|
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
try {
|
||||||
|
UserHandle user = new UserHandle(UserHandle.USER_CURRENT);
|
||||||
|
mContext.startActivityAsUser(intent, null, user);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doHapticFeedbackScreenOff() {
|
||||||
|
if (mVibrator == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
boolean enabled = Settings.System.getInt(mContext.getContentResolver(), KEY_GESTURE_ENABLE_HAPTIC_FEEDBACK, 1) != 0;
|
||||||
|
if (enabled) {
|
||||||
|
mVibrator.vibrate(50);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doHapticFeedbackFP(boolean longpress) {
|
||||||
|
if (mVibrator == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isHapticFeedbackEnabledOnFP()) {
|
||||||
|
mHandler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
int owningUid;
|
||||||
|
String owningPackage;
|
||||||
|
owningUid = android.os.Process.myUid();
|
||||||
|
owningPackage = mContext.getOpPackageName();
|
||||||
|
VibrationEffect effect = VibrationEffect.createOneShot(longpress ? 50 : 40, VibrationEffect.DEFAULT_AMPLITUDE);
|
||||||
|
mVibrator.vibrate(owningUid, owningPackage, effect, null, VIBRATION_ATTRIBUTES);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class FPScreenOffGesturesHandler extends Handler {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
processFPScancode(msg.arg1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MyTorchCallback extends CameraManager.TorchCallback {
|
||||||
|
@Override
|
||||||
|
public void onTorchModeChanged(String cameraId, boolean enabled) {
|
||||||
|
if (!cameraId.equals(mRearCameraId))
|
||||||
|
return;
|
||||||
|
mTorchEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTorchModeUnavailable(String cameraId) {
|
||||||
|
if (!cameraId.equals(mRearCameraId))
|
||||||
|
return;
|
||||||
|
mTorchEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.MatrixCursor;
|
||||||
|
import android.provider.SearchIndexableResource;
|
||||||
|
import android.provider.SearchIndexablesProvider;
|
||||||
|
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_CLASS_NAME;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_ICON_RESID;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_ACTION;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RANK;
|
||||||
|
import static android.provider.SearchIndexablesContract.COLUMN_INDEX_XML_RES_RESID;
|
||||||
|
import static android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS;
|
||||||
|
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
|
||||||
|
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
|
||||||
|
|
||||||
|
public class MotoActionsSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||||
|
private static final String TAG = "MotoActionsSearchIndexablesProvider";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreate() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Cursor queryXmlResources(String[] projection) {
|
||||||
|
MatrixCursor cursor = new MatrixCursor(INDEXABLES_XML_RES_COLUMNS);
|
||||||
|
|
||||||
|
cursor.addRow(generateResourceRef(new SearchIndexableResource(1, R.xml.actions_panel,
|
||||||
|
GestureSettingsActivity.class.getName(),
|
||||||
|
R.drawable.ic_settings_gestures)));
|
||||||
|
|
||||||
|
cursor.addRow(generateResourceRef(new SearchIndexableResource(1, R.xml.fp_gesture_panel,
|
||||||
|
FPGestureSettingsActivity.class.getName(),
|
||||||
|
R.drawable.ic_settings_fingerprint)));
|
||||||
|
cursor.addRow(generateResourceRef(new SearchIndexableResource(1, R.xml.fp_gesture_panel_indexable,
|
||||||
|
FPGestureSettingsActivity.class.getName(),
|
||||||
|
R.drawable.ic_settings_fingerprint)));
|
||||||
|
|
||||||
|
cursor.addRow(generateResourceRef(new SearchIndexableResource(1, R.xml.doze_panel,
|
||||||
|
DozeSettingsActivity.class.getName(),
|
||||||
|
R.drawable.ic_settings_doze)));
|
||||||
|
cursor.addRow(generateResourceRef(new SearchIndexableResource(1, R.xml.doze_panel_indexable,
|
||||||
|
DozeSettingsActivity.class.getName(),
|
||||||
|
R.drawable.ic_settings_doze)));
|
||||||
|
|
||||||
|
return cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Object[] generateResourceRef(SearchIndexableResource sir) {
|
||||||
|
Object[] ref = new Object[7];
|
||||||
|
ref[COLUMN_INDEX_XML_RES_RANK] = sir.rank;
|
||||||
|
ref[COLUMN_INDEX_XML_RES_RESID] = sir.xmlResId;
|
||||||
|
ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null;
|
||||||
|
ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId;
|
||||||
|
ref[COLUMN_INDEX_XML_RES_INTENT_ACTION] = "com.android.settings.action.EXTRA_SETTINGS";
|
||||||
|
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "com.moto.actions";
|
||||||
|
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Cursor queryRawData(String[] projection) {
|
||||||
|
MatrixCursor cursor = new MatrixCursor(INDEXABLES_RAW_COLUMNS);
|
||||||
|
return cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Cursor queryNonIndexableKeys(String[] projection) {
|
||||||
|
MatrixCursor cursor = new MatrixCursor(NON_INDEXABLES_KEYS_COLUMNS);
|
||||||
|
return cursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
115
MotoActions/src/com/moto/actions/MotoActionsService.java
Normal file
115
MotoActions/src/com/moto/actions/MotoActionsService.java
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.app.IntentService;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||||
|
import com.moto.actions.actions.CameraActivationSensor;
|
||||||
|
import com.moto.actions.actions.ChopChopSensor;
|
||||||
|
import com.moto.actions.actions.FlipToMute;
|
||||||
|
import com.moto.actions.actions.LiftToSilence;
|
||||||
|
import com.moto.actions.actions.ProximitySilencer;
|
||||||
|
|
||||||
|
import com.moto.actions.doze.DozePulseAction;
|
||||||
|
import com.moto.actions.doze.GlanceSensor;
|
||||||
|
import com.moto.actions.doze.ProximitySensor;
|
||||||
|
import com.moto.actions.doze.ScreenReceiver;
|
||||||
|
import com.moto.actions.doze.ScreenStateNotifier;
|
||||||
|
|
||||||
|
public class MotoActionsService extends IntentService implements ScreenStateNotifier,
|
||||||
|
UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private final PowerManager mPowerManager;
|
||||||
|
private final PowerManager.WakeLock mWakeLock;
|
||||||
|
|
||||||
|
private final List<ScreenStateNotifier> mScreenStateNotifiers = new LinkedList<>();
|
||||||
|
private final List<UpdatedStateNotifier> mUpdatedStateNotifiers = new LinkedList<>();
|
||||||
|
|
||||||
|
public MotoActionsService(Context context) {
|
||||||
|
super("MotoActionService");
|
||||||
|
|
||||||
|
Log.d(TAG, "Starting");
|
||||||
|
|
||||||
|
MotoActionsSettings motoActionsSettings = new MotoActionsSettings(context, this);
|
||||||
|
SensorHelper sensorHelper = new SensorHelper(context);
|
||||||
|
new ScreenReceiver(context, this);
|
||||||
|
|
||||||
|
DozePulseAction mDozePulseAction = new DozePulseAction(context);
|
||||||
|
mScreenStateNotifiers.add(mDozePulseAction);
|
||||||
|
|
||||||
|
// Actionable sensors get screen on/off notifications
|
||||||
|
mScreenStateNotifiers.add(new GlanceSensor(motoActionsSettings, sensorHelper, mDozePulseAction));
|
||||||
|
mScreenStateNotifiers.add(new ProximitySensor(motoActionsSettings, sensorHelper, mDozePulseAction));
|
||||||
|
|
||||||
|
// Other actions that are always enabled
|
||||||
|
mUpdatedStateNotifiers.add(new CameraActivationSensor(motoActionsSettings, sensorHelper));
|
||||||
|
mUpdatedStateNotifiers.add(new ChopChopSensor(motoActionsSettings, sensorHelper));
|
||||||
|
mUpdatedStateNotifiers.add(new ProximitySilencer(motoActionsSettings, context, sensorHelper));
|
||||||
|
mUpdatedStateNotifiers.add(new FlipToMute(motoActionsSettings, context, sensorHelper));
|
||||||
|
mUpdatedStateNotifiers.add(new LiftToSilence(motoActionsSettings, context, sensorHelper));
|
||||||
|
|
||||||
|
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
|
String tag = context.getPackageName() + ":ServiceWakeLock";
|
||||||
|
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, tag);
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onHandleIntent(Intent intent) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOn() {
|
||||||
|
if (!mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.acquire();
|
||||||
|
}
|
||||||
|
for (ScreenStateNotifier screenStateNotifier : mScreenStateNotifiers) {
|
||||||
|
screenStateNotifier.screenTurnedOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOff() {
|
||||||
|
if (mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.release();
|
||||||
|
}
|
||||||
|
for (ScreenStateNotifier screenStateNotifier : mScreenStateNotifiers) {
|
||||||
|
screenStateNotifier.screenTurnedOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateState() {
|
||||||
|
if (mPowerManager.isInteractive()) {
|
||||||
|
screenTurnedOn();
|
||||||
|
} else {
|
||||||
|
screenTurnedOff();
|
||||||
|
}
|
||||||
|
for (UpdatedStateNotifier notifier : mUpdatedStateNotifiers) {
|
||||||
|
notifier.updateState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
147
MotoActions/src/com/moto/actions/MotoActionsSettings.java
Normal file
147
MotoActions/src/com/moto/actions/MotoActionsSettings.java
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.actions.Constants;
|
||||||
|
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||||
|
import com.moto.actions.actions.CameraActivationAction;
|
||||||
|
import com.moto.actions.actions.TorchAction;
|
||||||
|
|
||||||
|
public class MotoActionsSettings implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private static final String GESTURE_CAMERA_ACTION_KEY = "gesture_camera_action";
|
||||||
|
private static final String GESTURE_CHOP_CHOP_KEY = "gesture_chop_chop";
|
||||||
|
private static final String GESTURE_PICK_UP_KEY = "gesture_pick_up";
|
||||||
|
private static final String GESTURE_IR_WAKEUP_KEY = "gesture_hand_wave";
|
||||||
|
private static final String GESTURE_IR_SILENCER_KEY = "gesture_ir_silencer";
|
||||||
|
private static final String GESTURE_FLIP_TO_MUTE_KEY = "gesture_flip_to_mute";
|
||||||
|
private static final String GESTURE_LIFT_TO_SILENCE_KEY = "gesture_lift_to_silence";
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final UpdatedStateNotifier mUpdatedStateNotifier;
|
||||||
|
|
||||||
|
private boolean mCameraGestureEnabled;
|
||||||
|
private boolean mChopChopEnabled;
|
||||||
|
private boolean mPickUpGestureEnabled;
|
||||||
|
private boolean mIrWakeUpEnabled;
|
||||||
|
private boolean mIrSilencerEnabled;
|
||||||
|
private boolean mFlipToMuteEnabled;
|
||||||
|
private boolean mLiftToSilenceEnabled;
|
||||||
|
|
||||||
|
public MotoActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
|
||||||
|
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
loadPreferences(sharedPrefs);
|
||||||
|
sharedPrefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
mContext = context;
|
||||||
|
mUpdatedStateNotifier = updatedStateNotifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCameraGestureEnabled() {
|
||||||
|
return mCameraGestureEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChopChopGestureEnabled() {
|
||||||
|
return mChopChopEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isDozeEnabled(ContentResolver contentResolver) {
|
||||||
|
return (Settings.Secure.getInt(contentResolver, Settings.Secure.DOZE_ENABLED, 1) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDozeEnabled() {
|
||||||
|
return isDozeEnabled(mContext.getContentResolver());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIrWakeupEnabled() {
|
||||||
|
return isDozeEnabled() && mIrWakeUpEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPickUpEnabled() {
|
||||||
|
return isDozeEnabled() && mPickUpGestureEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isIrSilencerEnabled() {
|
||||||
|
return mIrSilencerEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlipToMuteEnabled() {
|
||||||
|
return mFlipToMuteEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLiftToSilenceEnabled() {
|
||||||
|
return mLiftToSilenceEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cameraAction() {
|
||||||
|
new CameraActivationAction(mContext).action();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void chopChopAction() {
|
||||||
|
new TorchAction(mContext).action();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadPreferences(SharedPreferences sharedPreferences) {
|
||||||
|
mCameraGestureEnabled = sharedPreferences.getBoolean(GESTURE_CAMERA_ACTION_KEY, true);
|
||||||
|
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
||||||
|
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, false);
|
||||||
|
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
||||||
|
mIrSilencerEnabled = sharedPreferences.getBoolean(GESTURE_IR_SILENCER_KEY, false);
|
||||||
|
mFlipToMuteEnabled = sharedPreferences.getBoolean(GESTURE_FLIP_TO_MUTE_KEY, false);
|
||||||
|
mLiftToSilenceEnabled = sharedPreferences.getBoolean(GESTURE_LIFT_TO_SILENCE_KEY, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||||
|
boolean updated = true;
|
||||||
|
|
||||||
|
if (GESTURE_CAMERA_ACTION_KEY.equals(key)) {
|
||||||
|
mCameraGestureEnabled = sharedPreferences.getBoolean(GESTURE_CAMERA_ACTION_KEY, true);
|
||||||
|
} else if (GESTURE_CHOP_CHOP_KEY.equals(key)) {
|
||||||
|
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
||||||
|
} else if (GESTURE_IR_WAKEUP_KEY.equals(key)) {
|
||||||
|
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, false);
|
||||||
|
} else if (GESTURE_PICK_UP_KEY.equals(key)) {
|
||||||
|
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
||||||
|
} else if (GESTURE_IR_SILENCER_KEY.equals(key)) {
|
||||||
|
mIrSilencerEnabled = sharedPreferences.getBoolean(GESTURE_IR_SILENCER_KEY, false);
|
||||||
|
} else if (GESTURE_FLIP_TO_MUTE_KEY.equals(key)) {
|
||||||
|
mFlipToMuteEnabled = sharedPreferences.getBoolean(GESTURE_FLIP_TO_MUTE_KEY, false);
|
||||||
|
} else if (GESTURE_LIFT_TO_SILENCE_KEY.equals(key)) {
|
||||||
|
mLiftToSilenceEnabled = sharedPreferences.getBoolean(GESTURE_LIFT_TO_SILENCE_KEY, false);
|
||||||
|
} else if (Constants.FP_HOME_KEY.equals(key) || Constants.FP_HAPTIC_KEY.equals(key) || Constants.FP_HOME_KEY_OFF.equals(key) || Constants.FP_HAPTIC_SCREENOFF_KEY.equals(key) || Constants.FP_KEYS.equals(key) || Constants.FP_KEY_DBLTAP.equals(key) || Constants.FP_KEY_HOLD.equals(key) || Constants.FP_KEY_LEFT.equals(key) || Constants.FP_KEY_RIGHT.equals(key)
|
||||||
|
|| Constants.FP_KEYS_OFF.equals(key) || Constants.FP_KEY_DBLTAP_OFF.equals(key) || Constants.FP_KEY_HOLD_OFF.equals(key) || Constants.FP_KEY_LEFT_OFF.equals(key) || Constants.FP_KEY_RIGHT_OFF.equals(key)) {
|
||||||
|
Constants.writePreference(mContext, key);
|
||||||
|
updated = false;
|
||||||
|
} else {
|
||||||
|
updated = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updated) {
|
||||||
|
mUpdatedStateNotifier.updateState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
MotoActions/src/com/moto/actions/SensorAction.java
Normal file
22
MotoActions/src/com/moto/actions/SensorAction.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
public interface SensorAction {
|
||||||
|
void action();
|
||||||
|
}
|
||||||
105
MotoActions/src/com/moto/actions/SensorHelper.java
Normal file
105
MotoActions/src/com/moto/actions/SensorHelper.java
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.hardware.SensorManager;
|
||||||
|
|
||||||
|
public class SensorHelper {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private static final int SENSOR_TYPE_MMI_CAMERA_ACTIVATION = 65540;
|
||||||
|
private static final int SENSOR_TYPE_MMI_CHOP_CHOP = 65546;
|
||||||
|
private static final int SENSOR_TYPE_MMI_FLAT_UP = 65537;
|
||||||
|
private static final int SENSOR_TYPE_MMI_FLAT_DOWN = 65538;
|
||||||
|
private static final int SENSOR_TYPE_MMI_STOW = 65539;
|
||||||
|
private static final int SENSOR_TYPE_MMI_GLANCE = 65548;
|
||||||
|
|
||||||
|
private static final int BATCH_LATENCY_IN_MS = 100;
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final SensorManager mSensorManager;
|
||||||
|
|
||||||
|
public SensorHelper(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
|
||||||
|
dumpSensorsList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dumpSensorsList() {
|
||||||
|
try {
|
||||||
|
FileOutputStream out = mContext.openFileOutput("sensors.txt", Context.MODE_PRIVATE);
|
||||||
|
OutputStreamWriter writer = new OutputStreamWriter(out);
|
||||||
|
|
||||||
|
List<Sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
|
||||||
|
for (Sensor sensor : sensorList) {
|
||||||
|
writer.write("sensor " + sensor.getType() + " = " + sensor.getName()
|
||||||
|
+ " max batch: " + sensor.getFifoMaxEventCount() + " isWakeUp: " + sensor.isWakeUpSensor() + "\n");
|
||||||
|
}
|
||||||
|
writer.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getCameraActivationSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_CAMERA_ACTIVATION, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getChopChopSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_CHOP_CHOP, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getFlatUpSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_FLAT_UP, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getFlatDownSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_FLAT_DOWN, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getGlanceSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_GLANCE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getProximitySensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Sensor getStowSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_STOW, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerListener(Sensor sensor, SensorEventListener listener) {
|
||||||
|
if (!mSensorManager.registerListener(listener, sensor,
|
||||||
|
SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000)) {
|
||||||
|
throw new RuntimeException("Failed to registerListener for sensor " + sensor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unregisterListener(SensorEventListener listener) {
|
||||||
|
mSensorManager.unregisterListener(listener);
|
||||||
|
}
|
||||||
|
}
|
||||||
66
MotoActions/src/com/moto/actions/ServiceWrapper.java
Normal file
66
MotoActions/src/com/moto/actions/ServiceWrapper.java
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Binder;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public class ServiceWrapper extends android.app.Service {
|
||||||
|
static final String TAG = "MotoActions-ServiceWrapper";
|
||||||
|
|
||||||
|
private final IBinder mBinder = new LocalBinder();
|
||||||
|
private MotoActionsService mMotoActionsService;
|
||||||
|
|
||||||
|
public interface ServiceCallback {
|
||||||
|
void sendResults(int resultCode, Bundle b);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LocalBinder extends Binder {
|
||||||
|
ServiceWrapper getService() {
|
||||||
|
// Return this instance of the service so clients can call public
|
||||||
|
// methods
|
||||||
|
return ServiceWrapper.this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
Log.i(TAG, "onCreate");
|
||||||
|
super.onCreate();
|
||||||
|
mMotoActionsService = new MotoActionsService(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
Log.i(TAG, "onBind");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallback(ServiceCallback callback) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
Log.i(TAG, "start");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.app.KeyguardManager;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.os.PowerManager.WakeLock;
|
||||||
|
import android.os.VibrationEffect;
|
||||||
|
import android.os.Vibrator;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
|
||||||
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CameraActivationAction implements SensorAction {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final KeyguardManager mKeyguardManager;
|
||||||
|
private final PackageManager mPackageManager;
|
||||||
|
private final PowerManager mPowerManager;
|
||||||
|
|
||||||
|
public CameraActivationAction(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
mKeyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE);
|
||||||
|
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
|
mPackageManager = context.getPackageManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void action() {
|
||||||
|
vibrate();
|
||||||
|
turnScreenOn();
|
||||||
|
if (mKeyguardManager.isKeyguardLocked()) {
|
||||||
|
launchSecureCamera();
|
||||||
|
} else {
|
||||||
|
launchCamera();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void vibrate() {
|
||||||
|
Vibrator vib = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
if (vib == null) return;
|
||||||
|
VibrationEffect effect = VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE);
|
||||||
|
vib.vibrate(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void turnScreenOn() {
|
||||||
|
String tag = mContext.getPackageName() + ":CameraWakeLock";
|
||||||
|
WakeLock wl = mPowerManager.newWakeLock(
|
||||||
|
PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, tag);
|
||||||
|
wl.acquire(TURN_SCREEN_ON_WAKE_LOCK_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void launchCamera() {
|
||||||
|
Intent intent = createIntent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
||||||
|
if (getBestActivityInfo(intent) != null) {
|
||||||
|
// Only launch if we can succeed, but let the user pick the action
|
||||||
|
mContext.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void launchSecureCamera() {
|
||||||
|
// Keyguard won't allow a picker, try to pick the secure intent in the package
|
||||||
|
// that would be the one used for a default action of launching the camera
|
||||||
|
Intent normalIntent = createIntent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
||||||
|
Intent secureIntent = createIntent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE);
|
||||||
|
ActivityInfo normalActivity = getBestActivityInfo(normalIntent);
|
||||||
|
ActivityInfo secureActivity = getBestActivityInfo(secureIntent, normalActivity);
|
||||||
|
if (secureActivity != null) {
|
||||||
|
secureIntent.setComponent(componentName(secureActivity));
|
||||||
|
mContext.startActivity(secureIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Intent createIntent(String intentName) {
|
||||||
|
Intent intent = new Intent(intentName);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.addFlags(Intent.FLAG_FROM_BACKGROUND);
|
||||||
|
return intent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActivityInfo getBestActivityInfo(Intent intent) {
|
||||||
|
ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0);
|
||||||
|
if (resolveInfo != null) {
|
||||||
|
return resolveInfo.activityInfo;
|
||||||
|
} else {
|
||||||
|
// If the resolving failed, just find our own best match
|
||||||
|
return getBestActivityInfo(intent, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ActivityInfo getBestActivityInfo(Intent intent, ActivityInfo match) {
|
||||||
|
List <ResolveInfo> activities = mPackageManager.queryIntentActivities(intent, 0);
|
||||||
|
ActivityInfo best = null;
|
||||||
|
if (activities.size() > 0) {
|
||||||
|
best = activities.get(0).activityInfo;
|
||||||
|
if (match != null) {
|
||||||
|
String packageName = match.applicationInfo.packageName;
|
||||||
|
for (int i = activities.size()-1; i >= 0; i--) {
|
||||||
|
ActivityInfo activityInfo = activities.get(i).activityInfo;
|
||||||
|
if (packageName.equals(activityInfo.applicationInfo.packageName)) {
|
||||||
|
best = activityInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ComponentName componentName(ActivityInfo activity) {
|
||||||
|
return new ComponentName(activity.applicationInfo.packageName, activity.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class CameraActivationSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-CameraSensor";
|
||||||
|
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
|
||||||
|
private boolean mIsEnabled;
|
||||||
|
|
||||||
|
public CameraActivationSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
Sensor sensor = sensorHelper.getCameraActivationSensor();
|
||||||
|
sensorHelper.registerListener(sensor, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void updateState() {
|
||||||
|
if (mMotoActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
|
||||||
|
Log.d(TAG, "Enabling");
|
||||||
|
mIsEnabled = true;
|
||||||
|
} else if (! mMotoActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
|
||||||
|
Log.d(TAG, "Disabling");
|
||||||
|
mIsEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent event) {
|
||||||
|
Log.d(TAG, "activate camera");
|
||||||
|
if (mIsEnabled) mMotoActionsSettings.cameraAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||||
|
}
|
||||||
|
}
|
||||||
86
MotoActions/src/com/moto/actions/actions/ChopChopSensor.java
Normal file
86
MotoActions/src/com/moto/actions/actions/ChopChopSensor.java
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015-2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-ChopChopSensor";
|
||||||
|
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final Sensor mSensor;
|
||||||
|
private final Sensor mProx;
|
||||||
|
|
||||||
|
private boolean mIsEnabled;
|
||||||
|
private boolean mProxIsCovered;
|
||||||
|
|
||||||
|
public ChopChopSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mSensor = sensorHelper.getChopChopSensor();
|
||||||
|
mProx = sensorHelper.getProximitySensor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void updateState() {
|
||||||
|
if (mMotoActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
|
||||||
|
Log.d(TAG, "Enabling");
|
||||||
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
|
mSensorHelper.registerListener(mProx, mProxListener);
|
||||||
|
mIsEnabled = true;
|
||||||
|
} else if (! mMotoActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
|
||||||
|
Log.d(TAG, "Disabling");
|
||||||
|
mSensorHelper.unregisterListener(this);
|
||||||
|
mSensorHelper.unregisterListener(mProxListener);
|
||||||
|
mIsEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent event) {
|
||||||
|
Log.d(TAG, "chop chop triggered");
|
||||||
|
if (mProxIsCovered) {
|
||||||
|
Log.d(TAG, "proximity sensor covered, ignoring chop-chop");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mMotoActionsSettings.chopChopAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private SensorEventListener mProxListener = new SensorEventListener() {
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
mProxIsCovered = event.values[0] < mProx.getMaximumRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
219
MotoActions/src/com/moto/actions/actions/Constants.java
Normal file
219
MotoActions/src/com/moto/actions/actions/Constants.java
Normal file
@@ -0,0 +1,219 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.util.FileUtils;
|
||||||
|
|
||||||
|
public class Constants {
|
||||||
|
|
||||||
|
public static final boolean DEBUG = false;
|
||||||
|
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
// FP gestures
|
||||||
|
public static final int FP_TAP_SCANCODE = 616;
|
||||||
|
public static final int FP_HOLD_SCANCODE = 617;
|
||||||
|
public static final int FP_RIGHT_SCANCODE = 620;
|
||||||
|
public static final int FP_LEFT_SCANCODE = 621;
|
||||||
|
public static final int[] sSupportedFPGestures = new int[]{
|
||||||
|
FP_TAP_SCANCODE,
|
||||||
|
FP_HOLD_SCANCODE,
|
||||||
|
FP_RIGHT_SCANCODE,
|
||||||
|
FP_LEFT_SCANCODE
|
||||||
|
};
|
||||||
|
|
||||||
|
// FP actions
|
||||||
|
public static final int ACTION_HOME = 100;
|
||||||
|
public static final int ACTION_POWER = 101;
|
||||||
|
public static final int ACTION_BACK = 102;
|
||||||
|
public static final int ACTION_RECENTS = 103;
|
||||||
|
public static final int ACTION_VOLUME_UP = 104;
|
||||||
|
public static final int ACTION_VOLUME_DOWN = 105;
|
||||||
|
public static final int ACTION_VOICE_ASSISTANT = 106;
|
||||||
|
public static final int ACTION_PLAY_PAUSE = 107;
|
||||||
|
public static final int ACTION_PREVIOUS_TRACK = 108;
|
||||||
|
public static final int ACTION_NEXT_TRACK = 109;
|
||||||
|
public static final int ACTION_FLASHLIGHT = 110;
|
||||||
|
public static final int ACTION_CAMERA = 111;
|
||||||
|
public static final int ACTION_SCREENSHOT = 112;
|
||||||
|
public static final int ACTION_BROWSER = 116;
|
||||||
|
public static final int ACTION_DIALER = 117;
|
||||||
|
public static final int ACTION_EMAIL = 118;
|
||||||
|
public static final int ACTION_MESSAGES = 119;
|
||||||
|
public static final int ACTION_LAST_APP = 121;
|
||||||
|
public static final int[] sFPSupportedActions = new int[]{
|
||||||
|
ACTION_HOME,
|
||||||
|
ACTION_POWER,
|
||||||
|
ACTION_BACK,
|
||||||
|
ACTION_RECENTS,
|
||||||
|
ACTION_VOLUME_UP,
|
||||||
|
ACTION_VOLUME_DOWN,
|
||||||
|
ACTION_VOICE_ASSISTANT,
|
||||||
|
ACTION_PLAY_PAUSE,
|
||||||
|
ACTION_PREVIOUS_TRACK,
|
||||||
|
ACTION_NEXT_TRACK,
|
||||||
|
ACTION_FLASHLIGHT,
|
||||||
|
ACTION_CAMERA,
|
||||||
|
ACTION_SCREENSHOT,
|
||||||
|
ACTION_LAST_APP
|
||||||
|
};
|
||||||
|
public static final int[] sFPSupportedActionsScreenOff = new int[]{
|
||||||
|
ACTION_POWER,
|
||||||
|
ACTION_VOLUME_UP,
|
||||||
|
ACTION_VOLUME_DOWN,
|
||||||
|
ACTION_PLAY_PAUSE,
|
||||||
|
ACTION_PREVIOUS_TRACK,
|
||||||
|
ACTION_NEXT_TRACK,
|
||||||
|
ACTION_FLASHLIGHT,
|
||||||
|
ACTION_CAMERA
|
||||||
|
};
|
||||||
|
|
||||||
|
// Swap keys
|
||||||
|
public static final String FP_HOME_KEY = "fp_home";
|
||||||
|
public static final String FP_HOME_KEY_OFF = "fp_home_scr_off";
|
||||||
|
|
||||||
|
// Swap nodes
|
||||||
|
public static final String FP_HOME_NODE = "/sys/homebutton/enable";
|
||||||
|
public static final String FP_HOME_OFF_NODE = "/sys/homebutton/enable_off";
|
||||||
|
|
||||||
|
// Haptic node
|
||||||
|
public static final String FP_HAPTIC_NODE = "/sys/homebutton/haptic";
|
||||||
|
public static final String FP_HAPTIC_KEY = "fp_haptic";
|
||||||
|
public static final String FP_HAPTIC_SCREENOFF_NODE = "/sys/homebutton/haptic_off";
|
||||||
|
public static final String FP_HAPTIC_SCREENOFF_KEY = "fp_haptic_scr_off";
|
||||||
|
|
||||||
|
// List of keys
|
||||||
|
public static final String FP_KEYS = "fp_keys";
|
||||||
|
public static final String FP_KEY_DBLTAP = "fp_key_dbltap";
|
||||||
|
public static final String FP_KEY_HOLD = "fp_key_hold";
|
||||||
|
public static final String FP_KEY_LEFT = "fp_key_left";
|
||||||
|
public static final String FP_KEY_RIGHT = "fp_key_right";
|
||||||
|
|
||||||
|
public static final String FP_KEYS_OFF = "fp_keys_off";
|
||||||
|
public static final String FP_KEY_DBLTAP_OFF = "fp_key_dbltap_off";
|
||||||
|
public static final String FP_KEY_HOLD_OFF = "fp_key_hold_off";
|
||||||
|
public static final String FP_KEY_LEFT_OFF = "fp_key_left_off";
|
||||||
|
public static final String FP_KEY_RIGHT_OFF = "fp_key_right_off";
|
||||||
|
|
||||||
|
// Keys nodes
|
||||||
|
public static final String FP_KEYS_NODE = "/sys/homebutton/key";
|
||||||
|
public static final String FP_KEY_DBLTAP_NODE = "/sys/homebutton/key_dbltap";
|
||||||
|
public static final String FP_KEY_HOLD_NODE = "/sys/homebutton/key_hold";
|
||||||
|
public static final String FP_KEY_LEFT_NODE = "/sys/homebutton/key_left";
|
||||||
|
public static final String FP_KEY_RIGHT_NODE = "/sys/homebutton/key_right";
|
||||||
|
|
||||||
|
public static final String FP_KEYS_SCREENOFF_NODE = "/sys/homebutton/key_screenoff";
|
||||||
|
public static final String FP_KEY_SCREENOFF_DBLTAP_NODE = "/sys/homebutton/key_screenoff_dbltap";
|
||||||
|
public static final String FP_KEY_SCREENOFF_HOLD_NODE = "/sys/homebutton/key_screenoff_hold";
|
||||||
|
public static final String FP_KEY_SCREENOFF_LEFT_NODE = "/sys/homebutton/key_screenoff_left";
|
||||||
|
public static final String FP_KEY_SCREENOFF_RIGHT_NODE = "/sys/homebutton/key_screenoff_right";
|
||||||
|
|
||||||
|
// Screen off gestures haptic
|
||||||
|
public static final String KEY_GESTURE_ENABLE_HAPTIC_FEEDBACK = "screen_off_gesture_haptic_feedback";
|
||||||
|
|
||||||
|
// Holds <preference_key> -> <proc_node> mapping
|
||||||
|
public static final Map<String, String> sBooleanNodePreferenceMap = new HashMap<>();
|
||||||
|
|
||||||
|
// Holds <preference_key> -> <default_values> mapping
|
||||||
|
public static final Map<String, Object> sNodeDefaultMap = new HashMap<>();
|
||||||
|
|
||||||
|
public static final String[] sPrefKeys = {
|
||||||
|
FP_HOME_KEY,
|
||||||
|
FP_HOME_KEY_OFF,
|
||||||
|
FP_HAPTIC_KEY,
|
||||||
|
FP_HAPTIC_SCREENOFF_KEY,
|
||||||
|
FP_KEYS,
|
||||||
|
FP_KEY_DBLTAP,
|
||||||
|
FP_KEY_HOLD,
|
||||||
|
FP_KEY_RIGHT,
|
||||||
|
FP_KEY_LEFT,
|
||||||
|
FP_KEYS_OFF,
|
||||||
|
FP_KEY_DBLTAP_OFF,
|
||||||
|
FP_KEY_HOLD_OFF,
|
||||||
|
FP_KEY_RIGHT_OFF,
|
||||||
|
FP_KEY_LEFT_OFF,
|
||||||
|
FP_HOME_KEY_OFF,
|
||||||
|
};
|
||||||
|
|
||||||
|
static {
|
||||||
|
sBooleanNodePreferenceMap.put(FP_HOME_KEY, FP_HOME_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_HOME_KEY_OFF, FP_HOME_OFF_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_HAPTIC_KEY, FP_HAPTIC_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_HAPTIC_SCREENOFF_KEY, FP_HAPTIC_SCREENOFF_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEYS, FP_KEYS_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_DBLTAP, FP_KEY_DBLTAP_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_HOLD, FP_KEY_HOLD_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_LEFT, FP_KEY_LEFT_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_RIGHT, FP_KEY_RIGHT_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEYS_OFF, FP_KEYS_SCREENOFF_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_DBLTAP_OFF, FP_KEY_SCREENOFF_DBLTAP_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_HOLD_OFF, FP_KEY_SCREENOFF_HOLD_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_LEFT_OFF, FP_KEY_SCREENOFF_LEFT_NODE);
|
||||||
|
sBooleanNodePreferenceMap.put(FP_KEY_RIGHT_OFF, FP_KEY_SCREENOFF_RIGHT_NODE);
|
||||||
|
sNodeDefaultMap.put(FP_HOME_KEY, false);
|
||||||
|
sNodeDefaultMap.put(FP_HOME_KEY_OFF, false);
|
||||||
|
sNodeDefaultMap.put(FP_HAPTIC_KEY, false);
|
||||||
|
sNodeDefaultMap.put(FP_HAPTIC_SCREENOFF_KEY, false);
|
||||||
|
sNodeDefaultMap.put(FP_KEYS, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_DBLTAP, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_HOLD, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_LEFT, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_RIGHT, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEYS_OFF, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_DBLTAP_OFF, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_HOLD_OFF, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_LEFT_OFF, "0");
|
||||||
|
sNodeDefaultMap.put(FP_KEY_RIGHT_OFF, "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPreferenceEnabled(Context context, String key) {
|
||||||
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
return preferences.getBoolean(key, (Boolean) sNodeDefaultMap.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String GetPreference(Context context, String key) {
|
||||||
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
return preferences.getString(key, (String) sNodeDefaultMap.get(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void writePreference(Context context, String pref) {
|
||||||
|
|
||||||
|
String value = "1";
|
||||||
|
|
||||||
|
if (!pref.equals(FP_KEYS) && !pref.equals(FP_KEY_DBLTAP) && !pref.equals(FP_KEY_HOLD) && !pref.equals(FP_KEY_LEFT) && !pref.equals(FP_KEY_RIGHT) &&
|
||||||
|
!pref.equals(FP_KEYS_OFF) && !pref.equals(FP_KEY_DBLTAP_OFF) && !pref.equals(FP_KEY_HOLD_OFF) && !pref.equals(FP_KEY_LEFT_OFF) && !pref.equals(FP_KEY_RIGHT_OFF))
|
||||||
|
value = isPreferenceEnabled(context, pref) ? "1" : "0";
|
||||||
|
else
|
||||||
|
value = GetPreference(context, pref);
|
||||||
|
|
||||||
|
String node = sBooleanNodePreferenceMap.get(pref);
|
||||||
|
|
||||||
|
if (!FileUtils.writeLine(node, value)) {
|
||||||
|
Log.w(TAG, "Write " + value + " to node " + node +
|
||||||
|
"failed while restoring saved preference values");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
146
MotoActions/src/com/moto/actions/actions/FlipToMute.java
Normal file
146
MotoActions/src/com/moto/actions/actions/FlipToMute.java
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.os.VibrationEffect;
|
||||||
|
import android.os.Vibrator;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class FlipToMute implements UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-FlipToMute";
|
||||||
|
|
||||||
|
private final NotificationManager mNotificationManager;
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final Sensor mFlatDown;
|
||||||
|
private final Sensor mStow;
|
||||||
|
|
||||||
|
private boolean canVibrate = false;
|
||||||
|
private boolean mIsEnabled;
|
||||||
|
private boolean mIsFlatDown;
|
||||||
|
private boolean mIsStowed;
|
||||||
|
private int mFilter;
|
||||||
|
private Context mContext;
|
||||||
|
private Receiver mReceiver;
|
||||||
|
|
||||||
|
public FlipToMute(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
|
SensorHelper sensorHelper) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mContext = context;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mFlatDown = sensorHelper.getFlatDownSensor();
|
||||||
|
mStow = sensorHelper.getStowSensor();
|
||||||
|
mNotificationManager =
|
||||||
|
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
if (mNotificationManager != null) {
|
||||||
|
mFilter = mNotificationManager.getCurrentInterruptionFilter();
|
||||||
|
}
|
||||||
|
mReceiver = new Receiver();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState() {
|
||||||
|
if (mMotoActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
|
||||||
|
Log.d(TAG, "Enabling");
|
||||||
|
mSensorHelper.registerListener(mFlatDown, mFlatDownListener);
|
||||||
|
mSensorHelper.registerListener(mStow, mStowListener);
|
||||||
|
mContext.registerReceiver(mReceiver,
|
||||||
|
new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED));
|
||||||
|
mIsEnabled = true;
|
||||||
|
} else if (!mMotoActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
|
||||||
|
Log.d(TAG, "Disabling");
|
||||||
|
mSensorHelper.unregisterListener(mFlatDownListener);
|
||||||
|
mSensorHelper.unregisterListener(mStowListener);
|
||||||
|
mContext.unregisterReceiver(mReceiver);
|
||||||
|
mIsEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private SensorEventListener mFlatDownListener = new SensorEventListener() {
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
mIsFlatDown = (event.values[0] != 0);
|
||||||
|
sensorChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private SensorEventListener mStowListener = new SensorEventListener() {
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
mIsStowed = (event.values[0] != 0);
|
||||||
|
sensorChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void sensorChange() {
|
||||||
|
|
||||||
|
Log.d(TAG, "event: " + mIsFlatDown + " mIsStowed=" + mIsStowed);
|
||||||
|
|
||||||
|
if (mIsFlatDown && mIsStowed) {
|
||||||
|
vibrate();
|
||||||
|
canVibrate = true;
|
||||||
|
mNotificationManager.setInterruptionFilter(NotificationManager.INTERRUPTION_FILTER_PRIORITY);
|
||||||
|
Log.d(TAG, "Interrupt filter: Allow priority");
|
||||||
|
} else if (!mIsFlatDown) {
|
||||||
|
if (canVibrate) {
|
||||||
|
vibrate();
|
||||||
|
canVibrate = false;
|
||||||
|
}
|
||||||
|
mNotificationManager.setInterruptionFilter(mFilter);
|
||||||
|
Log.d(TAG, "Interrupt filter: Restore");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void vibrate() {
|
||||||
|
Vibrator vib = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
if (vib == null) return;
|
||||||
|
VibrationEffect effect = VibrationEffect.createOneShot(250, VibrationEffect.DEFAULT_AMPLITUDE);
|
||||||
|
vib.vibrate(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Receiver extends BroadcastReceiver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (!mIsFlatDown && !mIsStowed) {
|
||||||
|
if (mNotificationManager == null) return;
|
||||||
|
mFilter = mNotificationManager.getCurrentInterruptionFilter();
|
||||||
|
Log.d(TAG, "Interrupt filter: Backup");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
109
MotoActions/src/com/moto/actions/actions/LiftToSilence.java
Normal file
109
MotoActions/src/com/moto/actions/actions/LiftToSilence.java
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.telecom.TelecomManager;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class LiftToSilence extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-LiftToSilence";
|
||||||
|
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final Sensor mFlatUpSensor;
|
||||||
|
private final Sensor mStowSensor;
|
||||||
|
|
||||||
|
private final TelecomManager mTelecomManager;
|
||||||
|
private final TelephonyManager mTelephonyManager;
|
||||||
|
|
||||||
|
private boolean mIsRinging;
|
||||||
|
private boolean mIsStowed;
|
||||||
|
private boolean mLastFlatUp;
|
||||||
|
|
||||||
|
public LiftToSilence(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
|
SensorHelper sensorHelper) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mFlatUpSensor = sensorHelper.getFlatUpSensor();
|
||||||
|
mStowSensor = sensorHelper.getStowSensor();
|
||||||
|
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
|
||||||
|
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState() {
|
||||||
|
if (mMotoActionsSettings.isLiftToSilenceEnabled()) {
|
||||||
|
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||||
|
} else {
|
||||||
|
mTelephonyManager.listen(this, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void onCallStateChanged(int state, String incomingNumber) {
|
||||||
|
if (state == TelephonyManager.CALL_STATE_RINGING && !mIsRinging) {
|
||||||
|
Log.d(TAG, "Ringing started");
|
||||||
|
mSensorHelper.registerListener(mFlatUpSensor, this);
|
||||||
|
mSensorHelper.registerListener(mStowSensor, mStowListener);
|
||||||
|
mIsRinging = true;
|
||||||
|
} else if (state != TelephonyManager.CALL_STATE_RINGING && mIsRinging) {
|
||||||
|
Log.d(TAG, "Ringing stopped");
|
||||||
|
mSensorHelper.unregisterListener(this);
|
||||||
|
mSensorHelper.unregisterListener(mStowListener);
|
||||||
|
mIsRinging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
boolean thisFlatUp = (event.values[0] != 0);
|
||||||
|
|
||||||
|
Log.d(TAG, "event: " + thisFlatUp + " mLastFlatUp=" + mLastFlatUp + " mIsStowed=" +
|
||||||
|
mIsStowed);
|
||||||
|
|
||||||
|
if (mLastFlatUp && !thisFlatUp && !mIsStowed) {
|
||||||
|
mTelecomManager.silenceRinger();
|
||||||
|
}
|
||||||
|
mLastFlatUp = thisFlatUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private SensorEventListener mStowListener = new SensorEventListener() {
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
mIsStowed = (event.values[0] != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
109
MotoActions/src/com/moto/actions/actions/ProximitySilencer.java
Normal file
109
MotoActions/src/com/moto/actions/actions/ProximitySilencer.java
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.telecom.TelecomManager;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
import static android.telephony.TelephonyManager.*;
|
||||||
|
|
||||||
|
public class ProximitySilencer extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-ProximitySilencer";
|
||||||
|
|
||||||
|
private static final int SILENCE_DELAY_MS = 500;
|
||||||
|
|
||||||
|
private final TelecomManager mTelecomManager;
|
||||||
|
private final TelephonyManager mTelephonyManager;
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final Sensor mSensor;
|
||||||
|
private boolean mIsRinging;
|
||||||
|
private long mRingStartedMs;
|
||||||
|
private boolean mCoveredRinging;
|
||||||
|
|
||||||
|
public ProximitySilencer(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
|
SensorHelper sensorHelper) {
|
||||||
|
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
|
||||||
|
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mSensor = sensorHelper.getProximitySensor();
|
||||||
|
mCoveredRinging = false;
|
||||||
|
mIsRinging = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateState() {
|
||||||
|
if (mMotoActionsSettings.isIrSilencerEnabled()) {
|
||||||
|
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||||
|
} else {
|
||||||
|
mTelephonyManager.listen(this, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void onSensorChanged(SensorEvent event) {
|
||||||
|
boolean isNear = event.values[0] < mSensor.getMaximumRange();
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
|
||||||
|
if (isNear){
|
||||||
|
mCoveredRinging = mIsRinging && (now - mRingStartedMs >= SILENCE_DELAY_MS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mIsRinging) {
|
||||||
|
Log.d(TAG, "event: " + event.values[0] + ", " + " covered " + Boolean.toString(mCoveredRinging));
|
||||||
|
if (mCoveredRinging) {
|
||||||
|
Log.d(TAG, "Silencing ringer");
|
||||||
|
mTelecomManager.silenceRinger();
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "Ignoring silence gesture: " + now + " is too close to " +
|
||||||
|
mRingStartedMs + ", delay=" + SILENCE_DELAY_MS);
|
||||||
|
}
|
||||||
|
mCoveredRinging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized void onCallStateChanged(int state, String incomingNumber) {
|
||||||
|
if (state == CALL_STATE_RINGING && !mIsRinging) {
|
||||||
|
Log.d(TAG, "Ringing started");
|
||||||
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
|
mIsRinging = true;
|
||||||
|
mRingStartedMs = System.currentTimeMillis();
|
||||||
|
} else if (state != CALL_STATE_RINGING && mIsRinging) {
|
||||||
|
Log.d(TAG, "Ringing stopped");
|
||||||
|
mSensorHelper.unregisterListener(this);
|
||||||
|
mIsRinging = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
}
|
||||||
87
MotoActions/src/com/moto/actions/actions/TorchAction.java
Normal file
87
MotoActions/src/com/moto/actions/actions/TorchAction.java
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.camera2.CameraAccessException;
|
||||||
|
import android.hardware.camera2.CameraCharacteristics;
|
||||||
|
import android.hardware.camera2.CameraManager;
|
||||||
|
import android.os.VibrationEffect;
|
||||||
|
import android.os.Vibrator;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
|
public class TorchAction implements SensorAction {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private CameraManager mCameraManager;
|
||||||
|
private final Vibrator mVibrator;
|
||||||
|
private String mRearCameraId;
|
||||||
|
private static boolean mTorchEnabled;
|
||||||
|
|
||||||
|
public TorchAction(Context mContext) {
|
||||||
|
mCameraManager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
||||||
|
mCameraManager.registerTorchCallback(new MyTorchCallback(), null);
|
||||||
|
mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
try {
|
||||||
|
for (final String cameraId : mCameraManager.getCameraIdList()) {
|
||||||
|
CameraCharacteristics characteristics =
|
||||||
|
mCameraManager.getCameraCharacteristics(cameraId);
|
||||||
|
int cOrientation = characteristics.get(CameraCharacteristics.LENS_FACING);
|
||||||
|
if (cOrientation == CameraCharacteristics.LENS_FACING_BACK) {
|
||||||
|
mRearCameraId = cameraId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (CameraAccessException e) {
|
||||||
|
// Noop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void action() {
|
||||||
|
VibrationEffect vibrationEffect = VibrationEffect.createOneShot(250, VibrationEffect.DEFAULT_AMPLITUDE);
|
||||||
|
mVibrator.vibrate(vibrationEffect);
|
||||||
|
if (mRearCameraId != null) {
|
||||||
|
try {
|
||||||
|
mCameraManager.setTorchMode(mRearCameraId, !mTorchEnabled);
|
||||||
|
mTorchEnabled = !mTorchEnabled;
|
||||||
|
} catch (CameraAccessException e) {
|
||||||
|
// Noop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class MyTorchCallback extends CameraManager.TorchCallback {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTorchModeChanged(@NonNull String cameraId, boolean enabled) {
|
||||||
|
if (!cameraId.equals(mRearCameraId))
|
||||||
|
return;
|
||||||
|
mTorchEnabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTorchModeUnavailable(@NonNull String cameraId) {
|
||||||
|
if (!cameraId.equals(mRearCameraId))
|
||||||
|
return;
|
||||||
|
mTorchEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
|
public interface UpdatedStateNotifier {
|
||||||
|
void updateState();
|
||||||
|
}
|
||||||
66
MotoActions/src/com/moto/actions/doze/DozePulseAction.java
Normal file
66
MotoActions/src/com/moto/actions/doze/DozePulseAction.java
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
|
public class DozePulseAction implements SensorAction, ScreenStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
|
private static final int DELAY_BETWEEN_DOZES_IN_MS = 1500;
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
private long mLastDoze;
|
||||||
|
|
||||||
|
public DozePulseAction(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOn() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOff() {
|
||||||
|
mLastDoze = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void action() {
|
||||||
|
if (mayDoze()) {
|
||||||
|
Log.d(TAG, "Sending doze.pulse intent");
|
||||||
|
mContext.sendBroadcast(new Intent("com.android.systemui.doze.pulse"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized boolean mayDoze() {
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
if (now - mLastDoze > DELAY_BETWEEN_DOZES_IN_MS) {
|
||||||
|
Log.d(TAG, "Allowing doze");
|
||||||
|
mLastDoze = now;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "Denying doze");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
76
MotoActions/src/com/moto/actions/doze/GlanceSensor.java
Normal file
76
MotoActions/src/com/moto/actions/doze/GlanceSensor.java
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorAction;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class GlanceSensor implements ScreenStateNotifier {
|
||||||
|
private static final String TAG = "MotoActions-GlanceSensor";
|
||||||
|
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final SensorAction mSensorAction;
|
||||||
|
private final Sensor mSensor;
|
||||||
|
|
||||||
|
private boolean mEnabled;
|
||||||
|
|
||||||
|
public GlanceSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
|
||||||
|
SensorAction action) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mSensorAction = action;
|
||||||
|
|
||||||
|
mSensor = sensorHelper.getGlanceSensor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOn() {
|
||||||
|
if (mEnabled) {
|
||||||
|
Log.d(TAG, "Disabling");
|
||||||
|
mSensorHelper.unregisterListener(mGlanceListener);
|
||||||
|
mEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOff() {
|
||||||
|
if (mMotoActionsSettings.isPickUpEnabled() && !mEnabled) {
|
||||||
|
Log.d(TAG, "Enabling");
|
||||||
|
mSensorHelper.registerListener(mSensor, mGlanceListener);
|
||||||
|
mEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private SensorEventListener mGlanceListener = new SensorEventListener() {
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent event) {
|
||||||
|
Log.d(TAG, "triggered");
|
||||||
|
mSensorAction.action();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
81
MotoActions/src/com/moto/actions/doze/ProximitySensor.java
Normal file
81
MotoActions/src/com/moto/actions/doze/ProximitySensor.java
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.moto.actions.MotoActionsSettings;
|
||||||
|
import com.moto.actions.SensorAction;
|
||||||
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
|
public class ProximitySensor implements ScreenStateNotifier, SensorEventListener {
|
||||||
|
private static final String TAG = "MotoActions-ProximitySensor";
|
||||||
|
|
||||||
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
|
private final SensorHelper mSensorHelper;
|
||||||
|
private final SensorAction mSensorAction;
|
||||||
|
private final Sensor mSensor;
|
||||||
|
|
||||||
|
private boolean mEnabled;
|
||||||
|
|
||||||
|
private boolean mSawNear = false;
|
||||||
|
|
||||||
|
public ProximitySensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
|
||||||
|
SensorAction action) {
|
||||||
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
|
mSensorHelper = sensorHelper;
|
||||||
|
mSensorAction = action;
|
||||||
|
|
||||||
|
mSensor = sensorHelper.getProximitySensor();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOn() {
|
||||||
|
if (mEnabled) {
|
||||||
|
Log.d(TAG, "Disabling");
|
||||||
|
mSensorHelper.unregisterListener(this);
|
||||||
|
mEnabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void screenTurnedOff() {
|
||||||
|
if (mMotoActionsSettings.isIrWakeupEnabled() && !mEnabled) {
|
||||||
|
Log.d(TAG, "Enabling");
|
||||||
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
|
mEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent event) {
|
||||||
|
boolean isNear = event.values[0] < mSensor.getMaximumRange();
|
||||||
|
if (mSawNear && !isNear) {
|
||||||
|
Log.d(TAG, "wave triggered");
|
||||||
|
mSensorAction.action();
|
||||||
|
}
|
||||||
|
mSawNear = isNear;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor mSensor, int accuracy) {
|
||||||
|
}
|
||||||
|
}
|
||||||
50
MotoActions/src/com/moto/actions/doze/ScreenReceiver.java
Normal file
50
MotoActions/src/com/moto/actions/doze/ScreenReceiver.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
|
||||||
|
import com.moto.actions.actions.Constants;
|
||||||
|
|
||||||
|
public class ScreenReceiver extends BroadcastReceiver {
|
||||||
|
private final ScreenStateNotifier mNotifier;
|
||||||
|
|
||||||
|
public ScreenReceiver(Context context, ScreenStateNotifier notifier) {
|
||||||
|
mNotifier = notifier;
|
||||||
|
|
||||||
|
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
||||||
|
filter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||||
|
context.registerReceiver(this, filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
if (intent.getAction() == null) return;
|
||||||
|
|
||||||
|
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
|
||||||
|
mNotifier.screenTurnedOff();
|
||||||
|
} else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
|
||||||
|
mNotifier.screenTurnedOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015 The CyanogenMod Project
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
|
public interface ScreenStateNotifier {
|
||||||
|
void screenTurnedOn();
|
||||||
|
void screenTurnedOff();
|
||||||
|
}
|
||||||
125
MotoActions/src/com/moto/actions/util/FileUtils.java
Normal file
125
MotoActions/src/com/moto/actions/util/FileUtils.java
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.moto.actions.util;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public final class FileUtils {
|
||||||
|
private static final String TAG = "FileUtils";
|
||||||
|
|
||||||
|
private FileUtils() {
|
||||||
|
// This class is not supposed to be instantiated
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reads the first line of text from the given file.
|
||||||
|
* Reference {@link BufferedReader#readLine()} for clarification on what a line is
|
||||||
|
*
|
||||||
|
* @return the read line contents, or null on failure
|
||||||
|
*/
|
||||||
|
public static String readOneLine(String fileName) {
|
||||||
|
String line = "0";
|
||||||
|
BufferedReader reader = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
reader = new BufferedReader(new FileReader(fileName), 512);
|
||||||
|
line = reader.readLine();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.w(TAG, "No such file " + fileName + " for reading", e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(TAG, "Could not read from file " + fileName, e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (reader != null) {
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignored, not much we can do anyway
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the given value into the given file
|
||||||
|
*
|
||||||
|
* @return true on success, false on failure
|
||||||
|
*/
|
||||||
|
public static boolean writeLine(String fileName, String value) {
|
||||||
|
BufferedWriter writer = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
writer = new BufferedWriter(new FileWriter(fileName));
|
||||||
|
writer.write(value);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.w(TAG, "No such file " + fileName + " for writing", e);
|
||||||
|
return false;
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(TAG, "Could not write to file " + fileName, e);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (writer != null) {
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignored, not much we can do anyway
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given file exists
|
||||||
|
*
|
||||||
|
* @return true if exists, false if not
|
||||||
|
*/
|
||||||
|
public static boolean fileExists(String fileName) {
|
||||||
|
final File file = new File(fileName);
|
||||||
|
return file.exists();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given file is readable
|
||||||
|
*
|
||||||
|
* @return true if readable, false if not
|
||||||
|
*/
|
||||||
|
public static boolean isFileReadable(String fileName) {
|
||||||
|
final File file = new File(fileName);
|
||||||
|
return file.exists() && file.canRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given file is writable
|
||||||
|
*
|
||||||
|
* @return true if writable, false if not
|
||||||
|
*/
|
||||||
|
public static boolean isFileWritable(String fileName) {
|
||||||
|
final File file = new File(fileName);
|
||||||
|
return file.exists() && file.canWrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
8
README.md
Normal file
8
README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Copyright 2020 - The PixelExperience Project
|
||||||
|
|
||||||
|
Device configuration for Motorola msm8953 Devices
|
||||||
|
======================================
|
||||||
|
|
||||||
|
Supported devices :
|
||||||
|
|
||||||
|
Ali, Sanders
|
||||||
51
bluetooth/bdroid_buildcfg.h
Normal file
51
bluetooth/bdroid_buildcfg.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _BDROID_BUILDCFG_H
|
||||||
|
#define _BDROID_BUILDCFG_H
|
||||||
|
|
||||||
|
#pragma push_macro("PROPERTY_VALUE_MAX")
|
||||||
|
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static inline const char* BtmGetDefaultName()
|
||||||
|
{
|
||||||
|
char product_device[PROPERTY_VALUE_MAX];
|
||||||
|
property_get("ro.product.device", product_device, "");
|
||||||
|
|
||||||
|
if (strstr(product_device, "ali"))
|
||||||
|
return "Moto G(6)";
|
||||||
|
if (strstr(product_device, "sanders"))
|
||||||
|
return "Moto G(5)S";
|
||||||
|
|
||||||
|
// Fallback to ro.product.model
|
||||||
|
return "Moto MSM8953";
|
||||||
|
}
|
||||||
|
|
||||||
|
#define BTM_DEF_LOCAL_NAME BtmGetDefaultName()
|
||||||
|
#define BLUETOOTH_QTI_SW TRUE
|
||||||
|
|
||||||
|
#define MAX_ACL_CONNECTIONS 16
|
||||||
|
#define MAX_L2CAP_CHANNELS 16
|
||||||
|
#define BLE_VND_INCLUDED TRUE
|
||||||
|
#define BT_CLEAN_TURN_ON_DISABLED TRUE
|
||||||
|
#define BTM_WBS_INCLUDED TRUE
|
||||||
|
#define BTIF_HF_WBS_PREFERRED TRUE
|
||||||
|
#define BTM_SCO_ENHANCED_SYNC_ENABLED FALSE
|
||||||
|
|
||||||
|
#pragma pop_macro("PROPERTY_VALUE_MAX")
|
||||||
|
#endif
|
||||||
209
common_prop.mk
Normal file
209
common_prop.mk
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
#Build FP to be picked by both system and vendor
|
||||||
|
BUILD_FINGERPRINT := "google/walleye/walleye:8.1.0/OPM1.171019.011/4448085:user/release-keys"
|
||||||
|
|
||||||
|
# ART
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
dalvik.vm.boot-dex2oat-threads=8 \
|
||||||
|
dalvik.vm.dex2oat-filter=speed \
|
||||||
|
dalvik.vm.dex2oat-threads=8 \
|
||||||
|
dalvik.vm.image-dex2oat-filter=speed \
|
||||||
|
ro.sys.fw.dex2oat_thread_count=8 \
|
||||||
|
ro.vendor.qti.am.reschedule_service=true
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
af.fast_track_multiplier=2 \
|
||||||
|
audio.deep_buffer.media=true \
|
||||||
|
audio.offload.min.duration.secs=30 \
|
||||||
|
audio.offload.video=true \
|
||||||
|
persist.vendor.audio.dualmic.config=endfire \
|
||||||
|
persist.vendor.audio.fluence.voicecall=true \
|
||||||
|
persist.vendor.audio.fluence.voicecomm=true \
|
||||||
|
persist.vendor.audio.fluence.voicerec=false \
|
||||||
|
persist.vendor.audio.fluence.speaker=false \
|
||||||
|
persist.vendor.audio.hw.binder.size_kbyte=1024 \
|
||||||
|
persist.vendor.audio.ras.enabled=false \
|
||||||
|
vendor.persist.speaker.prot.enable=false \
|
||||||
|
ro.vendor.audio.sdk.ssr=false \
|
||||||
|
ro.vendor.audio.sdk.fluencetype=none \
|
||||||
|
ro.qc.sdk.audio.fluencetype=none \
|
||||||
|
ro.qc.sdk.audio.ssr=false \
|
||||||
|
vendor.audio_hal.period_size=240 \
|
||||||
|
vendor.audio.hw.aac.encoder=true \
|
||||||
|
vendor.audio.offload.buffer.size.kb=64 \
|
||||||
|
vendor.audio.offload.gapless.enabled=false \
|
||||||
|
vendor.audio.offload.multiple.enabled=false \
|
||||||
|
vendor.audio.offload.pcm.16bit.enable=true \
|
||||||
|
vendor.audio.offload.pcm.24bit.enable=true \
|
||||||
|
vendor.audio.offload.track.enable=true \
|
||||||
|
vendor.audio.parser.ip.buffer.size=262144 \
|
||||||
|
vendor.audio.safx.pbe.enabled=true \
|
||||||
|
vendor.audio.use.sw.alac.decoder=false \
|
||||||
|
vendor.audio.use.sw.ape.decoder=false \
|
||||||
|
vendor.voice.path.for.pcm.voip=false \
|
||||||
|
vendor.audio.offload.min.duration.secs=30
|
||||||
|
|
||||||
|
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||||
|
use.voice.path.for.pcm.voip=false
|
||||||
|
|
||||||
|
# Bluetooth
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
bluetooth.hfp.client=1 \
|
||||||
|
vendor.qcom.bluetooth.soc=smd \
|
||||||
|
ro.bluetooth.hfp.ver=1.7
|
||||||
|
|
||||||
|
# Camera
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.vendor.camera.expose.aux=1 \
|
||||||
|
ro.camera.cfa.packagelist=org.codeaurora.snapcam,com.motorola.camera2 \
|
||||||
|
vidc.enc.dcvs.extra-buff-count=2 \
|
||||||
|
vendor.camera.aux.packagelist=com.motorola.camera2
|
||||||
|
|
||||||
|
# Codec2 switch
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
debug.media.codec2=2
|
||||||
|
|
||||||
|
# CNE
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.vendor.cne.feature=1
|
||||||
|
|
||||||
|
# Color Mode
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
vendor.display.enable_default_color_mode=1
|
||||||
|
|
||||||
|
# Display
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
ro.sf.hwc_set_default_colormode=true \
|
||||||
|
debug.sf.enable_hwc_vds=1 \
|
||||||
|
debug.sf.hw=0 \
|
||||||
|
debug.sf.latch_unsignaled=1 \
|
||||||
|
debug.egl.hw=0 \
|
||||||
|
debug.enable.sglscale=1 \
|
||||||
|
dev.pm.dyn_samplingrate=1 \
|
||||||
|
persist.debug.wfd.enable=1 \
|
||||||
|
debug.sf.recomputecrop=0 \
|
||||||
|
persist.hwc.mdpcomp.enable=true \
|
||||||
|
ro.qualcomm.cabl=0 \
|
||||||
|
ro.opengles.version=196610 \
|
||||||
|
sdm.debug.disable_skip_validate=1 \
|
||||||
|
vendor.display.disable_skip_validate=1 \
|
||||||
|
vendor.gralloc.enable_fb_ubwc=1
|
||||||
|
|
||||||
|
# Fingerprint
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.qfp=false
|
||||||
|
|
||||||
|
# FM
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
ro.vendor.fm.use_audio_session=true
|
||||||
|
|
||||||
|
# Media
|
||||||
|
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||||
|
media.stagefright.thumbnail.prefer_hw_codecs=true
|
||||||
|
|
||||||
|
# Media
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
media.aac_51_output_enabled=true \
|
||||||
|
mm.enable.smoothstreaming=true \
|
||||||
|
mmp.enable.3g2=true \
|
||||||
|
vendor.mm.enable.qcom_parser=1048575 \
|
||||||
|
vendor.mm.en.sec.smoothstreaming=false \
|
||||||
|
vendor.vidc.enc.disable_bframes=1 \
|
||||||
|
vendor.vidc.enc.disable.pq=true \
|
||||||
|
vendor.vidc.dec.downscalar_width=1920 \
|
||||||
|
vendor.vidc.dec.downscalar_height=1088 \
|
||||||
|
vendor.vidc.disable.split.mode=1 \
|
||||||
|
vendor.video.disable.ubwc=1
|
||||||
|
|
||||||
|
# NITZ
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.rild.nitz_plmn="" \
|
||||||
|
persist.rild.nitz_long_ons_0="" \
|
||||||
|
persist.rild.nitz_long_ons_1="" \
|
||||||
|
persist.rild.nitz_long_ons_2="" \
|
||||||
|
persist.rild.nitz_long_ons_3="" \
|
||||||
|
persist.rild.nitz_short_ons_0="" \
|
||||||
|
persist.rild.nitz_short_ons_1="" \
|
||||||
|
persist.rild.nitz_short_ons_2="" \
|
||||||
|
persist.rild.nitz_short_ons_3=""
|
||||||
|
|
||||||
|
# Perf
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
ro.vendor.extension_library=libqti-perfd-client.so
|
||||||
|
|
||||||
|
# Time daemon
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.timed.enable=true
|
||||||
|
|
||||||
|
# Radio
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.dbg.volte_avail_ovr=1 \
|
||||||
|
persist.dbg.vt_avail_ovr=1 \
|
||||||
|
persist.dbg.wfc_avail_ovr=1 \
|
||||||
|
persist.vendor.radio.no_wait_for_card=1 \
|
||||||
|
persist.vendor.radio.dfr_mode_set=1 \
|
||||||
|
persist.vendor.radio.relay_oprt_change=1 \
|
||||||
|
persist.vendor.radio.oem_ind_to_both=0 \
|
||||||
|
persist.vendor.radio.qcril_uim_vcc_feature=1 \
|
||||||
|
persist.vendor.radio.0x9e_not_callname=1 \
|
||||||
|
persist.vendor.radio.mt_sms_ack=30 \
|
||||||
|
persist.vendor.radio.force_get_pref=1 \
|
||||||
|
persist.vendor.radio.is_wps_enabled=true \
|
||||||
|
persist.vendor.radio.custom_ecc=1 \
|
||||||
|
persist.vendor.radio.eri64_as_home=1 \
|
||||||
|
persist.vendor.radio.data_con_rprt=1 \
|
||||||
|
persist.vendor.radio.sib16_support=1 \
|
||||||
|
persist.vendor.radio.rat_on=combine \
|
||||||
|
persist.vendor.radio.sw_mbn_update=1 \
|
||||||
|
persist.vendor.radio.jbims=1 \
|
||||||
|
persist.vendor.radio.msgtunnel.start=true \
|
||||||
|
persist.vendor.radio.sar_sensor=1 \
|
||||||
|
persist.vendor.radio.apn_delay=5000 \
|
||||||
|
persist.vendor.radio.calls.on.ims=true \
|
||||||
|
persist.vendor.radio.domain.ps=0 \
|
||||||
|
persist.vendor.radio.fi_supported=1 \
|
||||||
|
persist.vendor.cne.rat.wlan.chip.oem=WCN \
|
||||||
|
persist.vendor.sys.cnd.iwlan=1 \
|
||||||
|
persist.vendor.data.mode=concurrent \
|
||||||
|
persist.data.netmgrd.qos.enable=true \
|
||||||
|
persist.radio.aosp_usr_pref_sel=true \
|
||||||
|
persist.radio.pb.min.match=7 \
|
||||||
|
persist.radio.fi_supported=1 \
|
||||||
|
persist.data.qmi.adb_logmask=0 \
|
||||||
|
persist.radio.adb_log_on=0 \
|
||||||
|
persist.vendor.radio.apm_sim_not_pwdn=1 \
|
||||||
|
persist.vendor.radio.procedure_bytes=SKIP \
|
||||||
|
persist.vendor.radio.aosp_usr_pref_sel=true \
|
||||||
|
persist.vendor.radio.flexmap_type=none \
|
||||||
|
persist.vendor.radio.data_con_rprt=true \
|
||||||
|
persist.vendor.radio.add_power_save=1 \
|
||||||
|
persist.net.doxlat=true \
|
||||||
|
persist.vendor.qc.sub.rdump.on=1 \
|
||||||
|
persist.vendor.qc.sub.rdump.max=3 \
|
||||||
|
ro.telephony.call_ring.multiple=false \
|
||||||
|
ro.telephony.default_network=10,10 \
|
||||||
|
ro.vendor.telephony.default_network=10,10 \
|
||||||
|
ro.vendor.use_data_netmgrd=true \
|
||||||
|
ro.telephony.iwlan_operation_mode=legacy \
|
||||||
|
persist.vendor.ims.dropset_feature=0 \
|
||||||
|
persist.vendor.ims.disableDebugLogs=0 \
|
||||||
|
persist.vendor.ims.disableIMSLogs=0 \
|
||||||
|
persist.vendor.ims.disableDebugDataPathLogs=0 \
|
||||||
|
persist.vendor.ims.disableADBLogs=0 \
|
||||||
|
persist.vendor.ims.vt.enableadb=3 \
|
||||||
|
persist.vendor.ims.disableQXDMLogs=1 \
|
||||||
|
ro.vendor.build.vendorprefix=/vendor \
|
||||||
|
vendor.rild.libpath=/vendor/lib64/libril-qc-qmi-1.so \
|
||||||
|
ro.telephony.use_old_mnc_mcc_format=true
|
||||||
|
|
||||||
|
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
|
||||||
|
persist.sys.fflag.override.settings_network_and_internet_v2=true \
|
||||||
|
persist.vendor.cne.feature=1 \
|
||||||
|
persist.vendor.dpm.feature=0 \
|
||||||
|
DEVICE_PROVISIONED=1 \
|
||||||
|
ril.subscription.types=NV,RUIM \
|
||||||
|
telephony.lteOnCdmaDevice=1
|
||||||
|
|
||||||
|
# RmNet Data
|
||||||
|
PRODUCT_PROPERTY_OVERRIDES += \
|
||||||
|
persist.data.wda.enable=true
|
||||||
77
compatibility_matrix.xml
Normal file
77
compatibility_matrix.xml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<compatibility-matrix version="1.0" type="device">
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.frameworks.schedulerservice</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>ISchedulingPolicyService</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.frameworks.sensorservice</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>ISensorManager</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.hidl.allocator</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IAllocator</name>
|
||||||
|
<instance>ashmem</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.hidl.manager</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IServiceManager</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.hidl.memory</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IMapper</name>
|
||||||
|
<instance>ashmem</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.hidl.token</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>ITokenManager</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl" optional="false">
|
||||||
|
<name>android.system.wifi.keystore</name>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IKeystore</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="native" optional="false">
|
||||||
|
<name>netutils-wrapper</name>
|
||||||
|
<!--
|
||||||
|
netutils-wrapper should only list a single version x.0.
|
||||||
|
netutils-wrapper next version has less functionalities than
|
||||||
|
previous versions, so unlike a HAL, netutils-wrapper are not
|
||||||
|
backwards compatible. Hence the major version must be bumped for
|
||||||
|
each update.
|
||||||
|
Vendor code should switch to (x+1).0 completely before when the
|
||||||
|
requirement is updated here.
|
||||||
|
-->
|
||||||
|
<version>1.0</version>
|
||||||
|
</hal>
|
||||||
|
<vndk>
|
||||||
|
<version>0.0.0</version>
|
||||||
|
</vndk>
|
||||||
|
<avb>
|
||||||
|
<vbmeta-version>0.0</vbmeta-version>
|
||||||
|
</avb>
|
||||||
|
</compatibility-matrix>
|
||||||
152
configs/config.fs
Normal file
152
configs/config.fs
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
[AID_VENDOR_QTI_DIAG]
|
||||||
|
value:2901
|
||||||
|
|
||||||
|
[AID_VENDOR_QDSS]
|
||||||
|
value:2902
|
||||||
|
|
||||||
|
[AID_VENDOR_RFS]
|
||||||
|
value:2903
|
||||||
|
|
||||||
|
[AID_VENDOR_RFS_SHARED]
|
||||||
|
value:2904
|
||||||
|
|
||||||
|
[AID_VENDOR_ADPL_ODL]
|
||||||
|
value:2905
|
||||||
|
|
||||||
|
[AID_VENDOR_QRTR]
|
||||||
|
value:2906
|
||||||
|
|
||||||
|
[AID_VENDOR_THERMAL]
|
||||||
|
value:2907
|
||||||
|
|
||||||
|
[vendor/bin/wcnss_filter]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_BLUETOOTH
|
||||||
|
group: AID_BLUETOOTH
|
||||||
|
caps: BLOCK_SUSPEND
|
||||||
|
|
||||||
|
[system/vendor/bin/wcnss_filter]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_BLUETOOTH
|
||||||
|
group: AID_BLUETOOTH
|
||||||
|
caps: BLOCK_SUSPEND
|
||||||
|
|
||||||
|
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_BLUETOOTH
|
||||||
|
group: AID_BLUETOOTH
|
||||||
|
caps: BLOCK_SUSPEND NET_ADMIN
|
||||||
|
|
||||||
|
[system/bin/cnss-daemon]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_BLUETOOTH
|
||||||
|
group: AID_BLUETOOTH
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[vendor/bin/pm-service]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE SYS_BOOT
|
||||||
|
|
||||||
|
[system/vendor/bin/pm-service]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE SYS_BOOT
|
||||||
|
|
||||||
|
[system/bin/pm-service]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE SYS_BOOT
|
||||||
|
|
||||||
|
[vendor/bin/pd-mapper]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[system/bin/pd-mapper]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[vendor/bin/imsdatadaemon]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_RADIO
|
||||||
|
group: AID_RADIO
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[vendor/bin/ims_rtp_daemon]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_RADIO
|
||||||
|
group: AID_RADIO
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[vendor/bin/cnd]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
|
||||||
|
|
||||||
|
[vendor/bin/slim_daemon]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_GPS
|
||||||
|
group: AID_GPS
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[vendor/bin/loc_launcher]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_GPS
|
||||||
|
group: AID_GPS
|
||||||
|
caps: SETUID SETGID
|
||||||
|
|
||||||
|
[vendor/bin/xtwifi-client]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_GPS
|
||||||
|
group: AID_GPS
|
||||||
|
caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
|
||||||
|
|
||||||
|
[vendor/bin/sensors.qti]
|
||||||
|
mode: 0755
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: NET_BIND_SERVICE
|
||||||
|
|
||||||
|
[firmware/]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: 0
|
||||||
|
|
||||||
|
[firmware/image/*]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: 0
|
||||||
|
|
||||||
|
[vendor/firmware_mnt/image/*]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: 0
|
||||||
|
|
||||||
|
[bt_firmware/]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: 0
|
||||||
|
|
||||||
|
[persist/]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_SYSTEM
|
||||||
|
group: AID_SYSTEM
|
||||||
|
caps: 0
|
||||||
|
|
||||||
|
[dsp/]
|
||||||
|
mode: 0771
|
||||||
|
user: AID_MEDIA
|
||||||
|
group: AID_MEDIA
|
||||||
|
caps: 0
|
||||||
45
configs/gps/apdr.conf
Normal file
45
configs/gps/apdr.conf
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# AP DR SENSOR Configuration file
|
||||||
|
#
|
||||||
|
# SENSOR_SERVICE options are one of below
|
||||||
|
# accel,gyro,vehicle_accel,vehicle_gyro,pedometer,vehicle_odometry,accel_temp,
|
||||||
|
# gyro_temp,baro,mag_calib,mag_uncalib,amd,rmd.
|
||||||
|
#
|
||||||
|
# SENSOR_PROVIDER options is one of -- default,native,ssc,samlite.
|
||||||
|
#
|
||||||
|
# SENSOR_RATE = 1~100 (Hz)
|
||||||
|
#
|
||||||
|
# SENSOR_SAMPLES = 1~N
|
||||||
|
#
|
||||||
|
# SENSOR_STATISTIC_ENABLED
|
||||||
|
# bit 0: Diag Print Enabled
|
||||||
|
# bit 1: Adb Print Enabled
|
||||||
|
# SENSOR_STATISTIC_PRINT_COUNT
|
||||||
|
# Skip Number of Print
|
||||||
|
#
|
||||||
|
|
||||||
|
SENSOR_SERVICE = accel
|
||||||
|
SENSOR_PROVIDER = native
|
||||||
|
SENSOR_RATE = 100
|
||||||
|
SENSOR_SAMPLES = 1
|
||||||
|
SENSOR_STATISTIC_ENABLED = 3
|
||||||
|
SENSOR_STATISTIC_PRINT_COUNT = 50
|
||||||
|
|
||||||
|
SENSOR_SERVICE = vehicle_accel
|
||||||
|
SENSOR_PROVIDER = native
|
||||||
|
SENSOR_RATE = 10
|
||||||
|
SENSOR_SAMPLES = 1
|
||||||
|
SENSOR_STATISTIC_ENABLED = 3
|
||||||
|
SENSOR_STATISTIC_PRINT_COUNT = 50
|
||||||
|
|
||||||
|
SENSOR_SERVICE = gyro
|
||||||
|
SENSOR_PROVIDER = native
|
||||||
|
SENSOR_RATE = 100
|
||||||
|
SENSOR_SAMPLES = 1
|
||||||
|
SENSOR_STATISTIC_ENABLED = 3
|
||||||
|
SENSOR_STATISTIC_PRINT_COUNT = 50
|
||||||
|
|
||||||
|
GNSS_POS_STATISTIC_ENABLED = 3
|
||||||
|
GNSS_POS_STATISTIC_PRNTCNT = 10
|
||||||
|
GNSS_MSR_STATISTIC_ENABLED = 3
|
||||||
|
GNSS_MSR_STATISTIC_PRNTCNT = 10
|
||||||
|
|
||||||
82
configs/gps/flp.conf
Normal file
82
configs/gps/flp.conf
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
###################################
|
||||||
|
##### FLP settings #####
|
||||||
|
###################################
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# FLP BATCHING SIZE
|
||||||
|
###################################
|
||||||
|
# The number of batched locations
|
||||||
|
# requested to modem. The desired number
|
||||||
|
# defined below may not be satisfied, as
|
||||||
|
# the modem can only return the number
|
||||||
|
# of batched locations that can be allocated,
|
||||||
|
# which is limited by memory. The default
|
||||||
|
# batch size defined as 20 as below.
|
||||||
|
BATCH_SIZE=20
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# FLP BATCHING SESSION TIMEOUT
|
||||||
|
###################################
|
||||||
|
# Duration with which batch session timeout
|
||||||
|
# happens in milliseconds. If not specified
|
||||||
|
# or set to zero, batching session timeout
|
||||||
|
# defaults to 20 seconds by the modem.
|
||||||
|
# BATCH_SESSION_TIMEOUT=20000
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# FLP CAPABILITIES BIT MASK
|
||||||
|
###################################
|
||||||
|
# GEOFENCE = 0x01
|
||||||
|
# BATCHING = 0x02
|
||||||
|
# default = GEOFENCE | BATCHING
|
||||||
|
CAPABILITIES=0x03
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# FLP BATCHING ACCURACY
|
||||||
|
###################################
|
||||||
|
# Set to one of the defined values below
|
||||||
|
# to define the accuracy of batching.
|
||||||
|
# If not specified, accuracy defaults
|
||||||
|
# to LOW.
|
||||||
|
# FLP BATCHING ACCURACY values:
|
||||||
|
# Low accuracy = 0
|
||||||
|
# Medium accuracy = 1
|
||||||
|
# High accuracy = 2
|
||||||
|
ACCURACY=1
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# FLP GEOFENCE RESPONSIVENESS
|
||||||
|
###################################
|
||||||
|
# If set to one of the defined values below,
|
||||||
|
# it will override the responsiveness for
|
||||||
|
# FLP geofence, which implements the fused
|
||||||
|
# location API. If not set to a value defined
|
||||||
|
# below, which is default, it will not
|
||||||
|
# override the responsivness.
|
||||||
|
# FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE Values:
|
||||||
|
# 1: LOW responsiveness
|
||||||
|
# 2: MEDIUM responsiveness
|
||||||
|
# 3: HIGH responsiveness
|
||||||
|
FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE = 0
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# By default APPS must support LB only if modem support
|
||||||
|
# LB 1.5 and above. This parameter adds an exception
|
||||||
|
# for targets where modem only supports LB 1.0.
|
||||||
|
# This might be useful for primarily outdoor devices.
|
||||||
|
# 0: MUST NOT ALLOW LB IF MODEM ONLY SUPPORTS
|
||||||
|
# LB 1.0
|
||||||
|
# 1: ALLOW LB IF MODEM ONLY SUPPORTS LB 1.0
|
||||||
|
####################################
|
||||||
|
ALLOW_LB_1_0 = 0
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# By default if network fixes are not sensor assisted
|
||||||
|
# these fixes must be dropped. This parameter adds an exception
|
||||||
|
# for targets where there is no PDR and we still want to
|
||||||
|
# report out network fixes
|
||||||
|
# 0: MUST NOT ALLOW NETWORK FIXES
|
||||||
|
# 1: ALLOW NETWORK FIXES
|
||||||
|
####################################
|
||||||
|
ALLOW_NETWORK_FIXES = 0
|
||||||
|
|
||||||
330
configs/gps/gps.conf
Normal file
330
configs/gps/gps.conf
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
#Uncommenting these urls would only enable
|
||||||
|
#the power up auto injection and force injection(test case).
|
||||||
|
#XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra2.bin
|
||||||
|
#XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra2.bin
|
||||||
|
#XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra2.bin
|
||||||
|
|
||||||
|
#Version check for XTRA
|
||||||
|
#DISABLE = 0
|
||||||
|
#AUTO = 1
|
||||||
|
#XTRA2 = 2
|
||||||
|
#XTRA3 = 3
|
||||||
|
XTRA_VERSION_CHECK=0
|
||||||
|
|
||||||
|
# Error Estimate
|
||||||
|
# _SET = 1
|
||||||
|
# _CLEAR = 0
|
||||||
|
ERR_ESTIMATE=0
|
||||||
|
|
||||||
|
#NTP server
|
||||||
|
NTP_SERVER=time.izatcloud.net
|
||||||
|
|
||||||
|
#XTRA CA path
|
||||||
|
XTRA_CA_PATH=/usr/lib/ssl-1.1/certs
|
||||||
|
|
||||||
|
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
|
||||||
|
# 4 - Debug, 5 - Verbose
|
||||||
|
# If DEBUG_LEVEL is commented, Android's logging levels will be used
|
||||||
|
DEBUG_LEVEL = 3
|
||||||
|
|
||||||
|
# Intermediate position report, 1=enable, 0=disable
|
||||||
|
INTERMEDIATE_POS=0
|
||||||
|
|
||||||
|
# supl version 1.0
|
||||||
|
SUPL_VER=0x10000
|
||||||
|
|
||||||
|
# Emergency SUPL, 1=enable, 0=disable
|
||||||
|
#SUPL_ES=1
|
||||||
|
|
||||||
|
#Choose PDN for Emergency SUPL
|
||||||
|
#1 - Use emergency PDN
|
||||||
|
#0 - Use regular SUPL PDN for Emergency SUPL
|
||||||
|
#USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=0
|
||||||
|
|
||||||
|
#SUPL_MODE is a bit mask set in config.xml per carrier by default.
|
||||||
|
#If it is uncommented here, this value will overwrite the value from
|
||||||
|
#config.xml.
|
||||||
|
#MSA=0X2
|
||||||
|
#MSB=0X1
|
||||||
|
#SUPL_MODE=
|
||||||
|
|
||||||
|
# GPS Capabilities bit mask
|
||||||
|
# SCHEDULING = 0x01
|
||||||
|
# MSB = 0x02
|
||||||
|
# MSA = 0x04
|
||||||
|
# ON_DEMAND_TIME = 0x10
|
||||||
|
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING
|
||||||
|
CAPABILITIES=0x17
|
||||||
|
|
||||||
|
# Accuracy threshold for intermediate positions
|
||||||
|
# less accurate positions are ignored, 0 for passing all positions
|
||||||
|
# ACCURACY_THRES=5000
|
||||||
|
|
||||||
|
################################
|
||||||
|
##### AGPS server settings #####
|
||||||
|
################################
|
||||||
|
|
||||||
|
# FOR SUPL SUPPORT, set the following
|
||||||
|
# SUPL_HOST=supl.host.com or IP
|
||||||
|
# SUPL_PORT=1234
|
||||||
|
|
||||||
|
# FOR MO SUPL SUPPORT, set the following
|
||||||
|
# MO_SUPL_HOST=supl.host.com or IP
|
||||||
|
# MO_SUPL_PORT=1234
|
||||||
|
|
||||||
|
# FOR C2K PDE SUPPORT, set the following
|
||||||
|
# C2K_HOST=c2k.pde.com or IP
|
||||||
|
# C2K_PORT=1234
|
||||||
|
|
||||||
|
# Bitmask of slots that are available
|
||||||
|
# for write/install to, where 1s indicate writable,
|
||||||
|
# and the default value is 0 where no slots
|
||||||
|
# are writable. For example, AGPS_CERT_WRITABLE_MASK
|
||||||
|
# of b1000001010 makes 3 slots available
|
||||||
|
# and the remaining 7 slots unwritable.
|
||||||
|
#AGPS_CERT_WRITABLE_MASK=0
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# LTE Positioning Profile Settings
|
||||||
|
####################################
|
||||||
|
# 0: Enable RRLP on LTE(Default)
|
||||||
|
# 1: Enable LPP_User_Plane on LTE
|
||||||
|
# 2: Enable LPP_Control_Plane
|
||||||
|
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
|
||||||
|
LPP_PROFILE = 2
|
||||||
|
|
||||||
|
####################################
|
||||||
|
#Datum Type
|
||||||
|
####################################
|
||||||
|
# 0: WGS-84
|
||||||
|
# 1: PZ-90
|
||||||
|
DATUM_TYPE = 0
|
||||||
|
|
||||||
|
################################
|
||||||
|
# EXTRA SETTINGS
|
||||||
|
################################
|
||||||
|
# NMEA provider (1=Modem Processor, 0=Application Processor)
|
||||||
|
NMEA_PROVIDER=0
|
||||||
|
|
||||||
|
# Customized NMEA GGA fix quality that can be used to tell
|
||||||
|
# whether SENSOR contributed to the fix.
|
||||||
|
#
|
||||||
|
# When this configuration item is not enabled (set to any value that is not 1),
|
||||||
|
# GGA fix quality conforms to NMEA standard spec as below:
|
||||||
|
# PPP/DGNSS/SBAS correction fix w/ or w/o sensor: 2
|
||||||
|
# RTK fixed fix w/ or w/o sensor: 4
|
||||||
|
# RTK float fix w/ or w/o sensor: 5
|
||||||
|
# SPE fix w/ or w/o sensor: 1
|
||||||
|
# Sensor dead reckoning fix: 6
|
||||||
|
#
|
||||||
|
# When this configuration is enabled (set to 1), GGA fix quality
|
||||||
|
# will be output as below:
|
||||||
|
# PPP fix w/o sensor: 59, w/ sensor: 69
|
||||||
|
# DGNSS/SBAS correction fix w/o sensor: 2, w/ sensor: 62
|
||||||
|
# RTK fixed fix w/o sensor: 4, w/ sensor: 64
|
||||||
|
# RTK float fix w/o sensor: 5, w/ sensor: 65,
|
||||||
|
# SPE fix w/o sensor: 1, and w/ sensor: 61
|
||||||
|
# Sensor dead reckoning fix: 6
|
||||||
|
#
|
||||||
|
# any value that is not 1 - disabled
|
||||||
|
# 1 - enabled
|
||||||
|
CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0
|
||||||
|
|
||||||
|
# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
|
||||||
|
SGLTE_TARGET=0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# Select Positioning Protocol on A-GLONASS system
|
||||||
|
##################################################
|
||||||
|
# 0x1: RRC CPlane
|
||||||
|
# 0x2: RRLP UPlane
|
||||||
|
# 0x4: LLP Uplane
|
||||||
|
A_GLONASS_POS_PROTOCOL_SELECT = 0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# Select technology for LPPe Control Plane
|
||||||
|
##################################################
|
||||||
|
# 0x1: DBH for LPPe CP
|
||||||
|
# 0x2: WLAN AP Measurements for LPPe CP
|
||||||
|
# 0x4: SRN AP measurement for CP
|
||||||
|
# 0x8: Sensor Barometer Measurement LPPe CP
|
||||||
|
#LPPE_CP_TECHNOLOGY = 0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# Select technology for LPPe User Plane
|
||||||
|
##################################################
|
||||||
|
# 0x1: DBH for LPPe UP
|
||||||
|
# 0x2: WLAN AP Measurements for LPPe UP
|
||||||
|
# 0x4: SRN AP measurement for UP
|
||||||
|
# 0x8: Sensor Barometer Measurement LPPe UP
|
||||||
|
#LPPE_UP_TECHNOLOGY = 0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# AGPS_CONFIG_INJECT
|
||||||
|
##################################################
|
||||||
|
# enable/disable injection of AGPS configurations:
|
||||||
|
# SUPL_VER
|
||||||
|
# SUPL_HOST
|
||||||
|
# SUPL_PORT
|
||||||
|
# MO_SUPL_HOST
|
||||||
|
# MO_SUPL_PORT
|
||||||
|
# C2K_HOST
|
||||||
|
# C2K_PORT
|
||||||
|
# LPP_PROFILE
|
||||||
|
# A_GLONASS_POS_PROTOCOL_SELECT
|
||||||
|
# 0: disable
|
||||||
|
# 1: enable
|
||||||
|
AGPS_CONFIG_INJECT = 1
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# GNSS settings for automotive use cases
|
||||||
|
# Configurations in following section are
|
||||||
|
# specific to automotive use cases, others
|
||||||
|
# please do not change, keep the default values
|
||||||
|
##################################################
|
||||||
|
|
||||||
|
# AP Coarse Timestamp Uncertainty
|
||||||
|
##################################################
|
||||||
|
# default : 10
|
||||||
|
# AP time stamp uncertainty, until GNSS receiver
|
||||||
|
# is able to acquire better timing information
|
||||||
|
AP_TIMESTAMP_UNCERTAINTY = 10
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# QDR engine availability status
|
||||||
|
##################################################
|
||||||
|
# 0 : NO QDR (default)
|
||||||
|
# 1 : QDR enabled
|
||||||
|
# This settings enables QDR Configuration for
|
||||||
|
# automotive use case, if enabled then
|
||||||
|
# DR_AP_Service needs to be enabled in izat.conf
|
||||||
|
#EXTERNAL_DR_ENABLED = 0
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# DR_SYNC Pulse Availability
|
||||||
|
#####################################
|
||||||
|
# 0 : DR_SYNC pulse not available (default)
|
||||||
|
# 1 : DR_SYNC pulse available
|
||||||
|
# This configuration enables the driver to make use
|
||||||
|
# of PPS events generated by DR_SYNC pulse
|
||||||
|
# Standard Linux PPS driver needs to be enabled
|
||||||
|
DR_SYNC_ENABLED = 0
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# PPS Device name
|
||||||
|
#####################################
|
||||||
|
PPS_DEVICENAME = /dev/pps0
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Ignore PPS at Startup and after long outage
|
||||||
|
#####################################
|
||||||
|
IGNORE_PPS_PULSE_COUNT = 1
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Long GNSS RF outage in seconds
|
||||||
|
#####################################
|
||||||
|
GNSS_OUTAGE_DURATION = 10
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# AP Clock Accuracy
|
||||||
|
#####################################
|
||||||
|
# Quality of APPS processor clock (in PPM).
|
||||||
|
# Value specified is used for calculation of
|
||||||
|
# APPS time stamp uncertainty
|
||||||
|
AP_CLOCK_PPM = 100
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# MAX ms difference to detect missing pulse
|
||||||
|
#####################################
|
||||||
|
# Specifies time threshold in ms to validate any missing PPS pulses
|
||||||
|
MISSING_PULSE_TIME_DELTA = 900
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Propagation time uncertainty
|
||||||
|
#####################################
|
||||||
|
# This settings enables time uncertainty propagation
|
||||||
|
# logic incase of missing PPS pulse
|
||||||
|
PROPAGATION_TIME_UNCERTAINTY = 1
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# APN / IP Type Configuration
|
||||||
|
# APN and IP Type to use for setting
|
||||||
|
# up WWAN call.
|
||||||
|
# Use below values for IP Type:
|
||||||
|
# v4 = 4
|
||||||
|
# v6 = 6
|
||||||
|
# v4v6 = 10
|
||||||
|
#######################################
|
||||||
|
# INTERNET_APN = abc.xyz
|
||||||
|
# INTERNET_IP_TYPE = 4
|
||||||
|
# SUPL_APN = abc.xyz
|
||||||
|
# SUPL_IP_TYPE = 4
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Modem type
|
||||||
|
#####################################
|
||||||
|
# This setting configures modem type
|
||||||
|
# (external=0 or internal=1)
|
||||||
|
# comment out the next line to vote
|
||||||
|
# for the first modem in the list
|
||||||
|
MODEM_TYPE = 1
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# CONSTRAINED TIME UNCERTAINTY MODE
|
||||||
|
##################################################
|
||||||
|
# 0 : disabled (default)
|
||||||
|
# 1 : enabled
|
||||||
|
# This setting enables GPS engine to keep its time
|
||||||
|
# uncertainty below the specified constraint
|
||||||
|
#CONSTRAINED_TIME_UNCERTAINTY_ENABLED = 0
|
||||||
|
|
||||||
|
# If constrained time uncertainty mode is enabled,
|
||||||
|
# this setting specifies the time uncertainty
|
||||||
|
# threshold that gps engine need to maintain.
|
||||||
|
# In unit of milli-seconds.
|
||||||
|
# Default is 0.0 meaning that modem default value
|
||||||
|
# of time uncertainty threshold will be used.
|
||||||
|
#CONSTRAINED_TIME_UNCERTAINTY_THRESHOLD = 0.0
|
||||||
|
|
||||||
|
# If constrained time uncertainty mode is enabled,
|
||||||
|
# this setting specifies the power budget that
|
||||||
|
# gps engine is allowed to spend to maintain the time
|
||||||
|
# uncertainty.
|
||||||
|
# Default is 0 meaning that GPS engine is not constained
|
||||||
|
# by power budget and can spend as much power as needed.
|
||||||
|
# In unit of 0.1 milli watt second.
|
||||||
|
#CONSTRAINED_TIME_UNCERTAINTY_ENERGY_BUDGET = 0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# POSITION ASSISTED CLOCK ESTIMATOR
|
||||||
|
##################################################
|
||||||
|
# 0 : disabled (default)
|
||||||
|
# 1 : enabled
|
||||||
|
# This setting enables GPS engine to estimate clock
|
||||||
|
# bias and drift when the signal from at least 1
|
||||||
|
# SV is available and the UE’s position is known by
|
||||||
|
# other position engines.
|
||||||
|
#POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED = 0
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# proxyAppPackageName
|
||||||
|
#####################################
|
||||||
|
# This is a string that is sent to the framework
|
||||||
|
# in nfwNotifyCb callback
|
||||||
|
PROXY_APP_PACKAGE_NAME = com.google.android.carrierlocation
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# CP_MTLR_ES
|
||||||
|
#####################################
|
||||||
|
# CP MTLR ES, 1=enable, 0=disable
|
||||||
|
CP_MTLR_ES=0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# GNSS_DEPLOYMENT
|
||||||
|
##################################################
|
||||||
|
# 0 : Enable QTI GNSS (default)
|
||||||
|
# 1 : Enable QCSR SS5
|
||||||
|
# This setting use to select between QTI GNSS
|
||||||
|
# and QCSR SS5 hardware receiver.
|
||||||
|
# By default QTI GNSS receiver is enabled.
|
||||||
|
# GNSS_DEPLOYMENT = 0
|
||||||
307
configs/gps/izat.conf
Normal file
307
configs/gps/izat.conf
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
#########################################
|
||||||
|
# Log verbosity control for izat modules
|
||||||
|
#########################################
|
||||||
|
# OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5
|
||||||
|
IZAT_DEBUG_LEVEL = 2
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# Select WIFI Wait Timeout value in seconds for SUPL
|
||||||
|
##################################################
|
||||||
|
WIFI_WAIT_TIMEOUT_SELECT = 0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# Time interval of injecting SRN scan data to modem
|
||||||
|
# time in seconds.
|
||||||
|
# Note: recommended value is between 1-5 sec
|
||||||
|
##################################################
|
||||||
|
LPPE_SRN_DATA_SCAN_INJECT_TIME=2
|
||||||
|
|
||||||
|
################################
|
||||||
|
# NLP Settings
|
||||||
|
################################
|
||||||
|
# NLP_MODE 1: OSNLP Only, 2: QNP Only, 3: Combo, 4: QNP preferred
|
||||||
|
# For Automotive products, please use NLP_MODE = 4 only.
|
||||||
|
# NLP_TOLERANCE_TIME_FIRST: Time in ms used in Combo mode
|
||||||
|
# to determine how much Tolerance for first position
|
||||||
|
# NLP_TOLERANCE_TIME_AFTER: Time in ms used in Combo mode
|
||||||
|
# to determine how much Tolerance for positions after first
|
||||||
|
# NLP_THRESHOLD: Sets how many failures needed before
|
||||||
|
# switching preferred NLP in Combo mode
|
||||||
|
# NLP_ACCURACY_MULTIPLE: Determines how far off the accuracy
|
||||||
|
# must be, in multiples, between two NLP location reports to
|
||||||
|
# be considered much worse accuracy. Used in switching logic
|
||||||
|
# NLP COMBO MODE USES QNP WITH NO EULA CONSENT: Determines
|
||||||
|
# whether or not to still send network location requests to
|
||||||
|
# QNP when the EULA is not consented to by the user. QNP can
|
||||||
|
# still return ZPP locations or injected locations even
|
||||||
|
# without EULA consent, but the uncertainty can be high.
|
||||||
|
# QNP preferred mode prefers QNP when there is EULA consent,
|
||||||
|
# otherwise OSNLP is used.
|
||||||
|
NLP_MODE = 1
|
||||||
|
NLP_MODE_EMERGENCY = 2
|
||||||
|
NLP_TOLERANCE_TIME_FIRST = 5000
|
||||||
|
NLP_TOLERANCE_TIME_AFTER = 20000
|
||||||
|
NLP_THRESHOLD = 3
|
||||||
|
NLP_ACCURACY_MULTIPLE = 2
|
||||||
|
NLP_COMBO_MODE_USES_QNP_WITH_NO_EULA_CONSENT = 1
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# NLP PACKAGE AND ACTION SETTINGS
|
||||||
|
#########################################
|
||||||
|
# OSNLP_PACKAGE/OSNLP_ACTION: name/action of default NLP package
|
||||||
|
OSNLP_PACKAGE = com.google.android.gms
|
||||||
|
OSNLP_ACTION = com.android.location.service.v3.NetworkLocationProvider
|
||||||
|
# REGION_OSNLP_PACKAGE/REGION_OSNLP_ACTION:
|
||||||
|
# These two values will be used as alternative
|
||||||
|
# for particular region where default NLP is not functional.
|
||||||
|
REGION_OSNLP_PACKAGE = com.amap.android.location
|
||||||
|
REGION_OSNLP_ACTION = com.android.location.service.v3.NetworkLocationProvider
|
||||||
|
|
||||||
|
# Threshold period for ZPP triggers
|
||||||
|
ZPP_TRIGGER_THRESHOLD=60000
|
||||||
|
|
||||||
|
###################################
|
||||||
|
# GEOFENCE SERVICES
|
||||||
|
###################################
|
||||||
|
# If set to one of the defined values below, it will override
|
||||||
|
# the responsiveness for geofence services, which implements
|
||||||
|
# the Proximity Alert API. If not set to a value defined below,
|
||||||
|
# which is default, it will not override the responsivness.
|
||||||
|
# The geofence HAL API is unaffected by this value.
|
||||||
|
# GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE Values:
|
||||||
|
# 1: LOW responsiveness
|
||||||
|
# 2: MEDIUM responsiveness
|
||||||
|
# 3: HIGH responsiveness
|
||||||
|
GEOFENCE_SERVICES_RESPONSIVENESS_OVERRIDE = 0
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
#GTP Opt-In app
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
#GTP privacy policy version url
|
||||||
|
#https support is required
|
||||||
|
GTP_PRIVACY_VERSION_URL = https://info.izatcloud.net/privacy/version.html
|
||||||
|
|
||||||
|
#GTP privacy policy version download retry interval
|
||||||
|
#unit is second. default is 86400
|
||||||
|
GTP_PRIVACY_RETRY_INTERVAL = 86400
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# IZAT PREMIUM FEATURE SETTINGS
|
||||||
|
#####################################
|
||||||
|
#Possible states of a feature:
|
||||||
|
#DISABLED
|
||||||
|
#BASIC
|
||||||
|
#PREMIUM
|
||||||
|
|
||||||
|
#GTP_MODE valid modes:
|
||||||
|
# DISABLED
|
||||||
|
# LEGACY_WWAN
|
||||||
|
# SDK (WWAN not available for Modems before LocTech 10.0)
|
||||||
|
GTP_MODE=DISABLED
|
||||||
|
|
||||||
|
#GTP_CELL_PROC valid options:
|
||||||
|
# AP
|
||||||
|
# MODEM
|
||||||
|
GTP_CELL_PROC=MODEM
|
||||||
|
|
||||||
|
#GTP_CELL valid modes:
|
||||||
|
# DISABLED
|
||||||
|
# BASIC
|
||||||
|
GTP_CELL=BASIC
|
||||||
|
|
||||||
|
#GTP_WIFI valid modes:
|
||||||
|
# DISABLED
|
||||||
|
# BASIC
|
||||||
|
GTP_WIFI=BASIC
|
||||||
|
|
||||||
|
#GTP_WAA valid modes:
|
||||||
|
# DISABLED
|
||||||
|
# BASIC
|
||||||
|
GTP_WAA=DISABLED
|
||||||
|
|
||||||
|
#SAP valid modes:
|
||||||
|
# DISABLED
|
||||||
|
# BASIC
|
||||||
|
# PREMIUM
|
||||||
|
# MODEM_DEFAULT
|
||||||
|
SAP=DISABLED
|
||||||
|
|
||||||
|
#ODCPI valid modes:
|
||||||
|
#DISABLED
|
||||||
|
#BASIC
|
||||||
|
ODCPI=BASIC
|
||||||
|
|
||||||
|
#FREE_WIFI_SCAN_INJECT valid modes:
|
||||||
|
#DISABLED
|
||||||
|
#BASIC
|
||||||
|
FREE_WIFI_SCAN_INJECT=BASIC
|
||||||
|
|
||||||
|
#SUPL_WIFI valid modes:
|
||||||
|
#DISABLED
|
||||||
|
#BASIC
|
||||||
|
SUPL_WIFI=BASIC
|
||||||
|
|
||||||
|
#WIFI_SUPPLICANT_INFO valid modes:
|
||||||
|
#DISABLED
|
||||||
|
#BASIC
|
||||||
|
WIFI_SUPPLICANT_INFO=BASIC
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Location process launcher settings
|
||||||
|
#####################################
|
||||||
|
# DO NOT MODIFY
|
||||||
|
# Modifying below attributes without
|
||||||
|
# caution can have serious implications.
|
||||||
|
|
||||||
|
#Values for PROCESS_STATE:
|
||||||
|
# ENABLED
|
||||||
|
# DISABLED
|
||||||
|
|
||||||
|
#Values for LOW_RAM_TARGETS:
|
||||||
|
# ENABLED
|
||||||
|
# DISABLED
|
||||||
|
# Property to enable/disable processes for low ram targets. Uses ro.config.low_ram property
|
||||||
|
# to identify low ram targets.
|
||||||
|
|
||||||
|
#PROCESS_NAME
|
||||||
|
# Name of the executable file.
|
||||||
|
|
||||||
|
#FEATURE MASKS:
|
||||||
|
# GTP-WIFI 0X03
|
||||||
|
# GTP-AP-CELL 0X0c
|
||||||
|
# GTP-MP-CELL 0xc00
|
||||||
|
# GTP-WAA 0x100
|
||||||
|
# SAP 0Xc0
|
||||||
|
# ODCPI 0x1000
|
||||||
|
# FREE_WIFI_SCAN_INJECT 0x2000
|
||||||
|
# SUPL_WIFI 0x4000
|
||||||
|
# WIFI_SUPPLICANT_INFO 0x8000
|
||||||
|
|
||||||
|
#Values for PLATFORMS can be:
|
||||||
|
#1. Any valid values obtained from ro.board.platform separated by single space. For example: msm8960 msm8226
|
||||||
|
#2. 'all' or 'all exclude' -> for All platforms
|
||||||
|
#3. 'all exclude XXXX' -> All platforms exclude XXXX. For example: all exclude msm8937
|
||||||
|
|
||||||
|
#Values for SOC_IDS can be:
|
||||||
|
#1. Any valid values obtained from soc_id node separated by single space. For example: 339 386 436
|
||||||
|
## soc_id value can be obtained from any one of below node:
|
||||||
|
## - /sys/devices/soc0/soc_id
|
||||||
|
## - /sys/devices/system/soc/soc0/id
|
||||||
|
#2. 'all' or 'all exclude' -> for All soc id's
|
||||||
|
#3. 'all exclude XXXX' -> All soc id's exclude XXXX. For example: all exclude 339 386
|
||||||
|
|
||||||
|
#Values for BASEBAND can be:
|
||||||
|
#1. Any valid values obtained from ro.baseband separated by single space. For example: sglte sglte2
|
||||||
|
#2. 'all' or 'all exclude' -> for all basebands
|
||||||
|
#3. 'all exclude XXXX' -> All basebands exclude XXXX. For example: all exclude sglte
|
||||||
|
PROCESS_NAME=DR_AP_Service
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=DISABLED
|
||||||
|
PROCESS_GROUPS=gps diag
|
||||||
|
PREMIUM_FEATURE=0
|
||||||
|
IZAT_FEATURE_MASK=0
|
||||||
|
PLATFORMS=all
|
||||||
|
BASEBAND=all
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=automotive
|
||||||
|
|
||||||
|
#Valyes for LEAN_TARGETS can be:
|
||||||
|
#ENABLED -> if this process is supposed to run on lean and mean targets
|
||||||
|
#DISABLED -> if this process is to be disabled on lean and mean targets
|
||||||
|
PROCESS_NAME=garden_app
|
||||||
|
PROCESS_ARGUMENT=-l 0 -T 1
|
||||||
|
PROCESS_STATE=ENABLED
|
||||||
|
PROCESS_GROUPS=gps diag
|
||||||
|
PREMIUM_FEATURE=0
|
||||||
|
IZAT_FEATURE_MASK=0
|
||||||
|
PLATFORMS=all
|
||||||
|
BASEBAND=all
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=automotive
|
||||||
|
|
||||||
|
PROCESS_NAME=gpsone_daemon
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=ENABLED
|
||||||
|
PROCESS_GROUPS=inet
|
||||||
|
PREMIUM_FEATURE=0
|
||||||
|
IZAT_FEATURE_MASK=0
|
||||||
|
PLATFORMS=msm7630_fusion
|
||||||
|
BASEBAND=svlte2a sglte sglte2
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
|
||||||
|
PROCESS_NAME=lowi-server
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=DISABLED
|
||||||
|
PROCESS_GROUPS=gps net_admin wifi inet oem_2901
|
||||||
|
PREMIUM_FEATURE=0
|
||||||
|
IZAT_FEATURE_MASK=0xf303
|
||||||
|
PLATFORMS=all
|
||||||
|
SOC_IDS=all
|
||||||
|
BASEBAND=all
|
||||||
|
LOW_RAM_TARGETS=DISABLED
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
|
||||||
|
PROCESS_NAME=xtwifi-inet-agent
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=DISABLED
|
||||||
|
PROCESS_GROUPS=inet gps
|
||||||
|
PREMIUM_FEATURE=1
|
||||||
|
IZAT_FEATURE_MASK=0xc0f
|
||||||
|
PLATFORMS=all
|
||||||
|
SOC_IDS=all exclude 386 436
|
||||||
|
BASEBAND=all
|
||||||
|
LOW_RAM_TARGETS=DISABLED
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
|
||||||
|
PROCESS_NAME=xtwifi-client
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=DISABLED
|
||||||
|
PROCESS_GROUPS=wifi inet gps rfs_shared system
|
||||||
|
PREMIUM_FEATURE=1
|
||||||
|
IZAT_FEATURE_MASK=0xf0f
|
||||||
|
PLATFORMS=all
|
||||||
|
SOC_IDS=all exclude 386 436
|
||||||
|
BASEBAND=all
|
||||||
|
LOW_RAM_TARGETS=DISABLED
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
|
||||||
|
PROCESS_NAME=slim_daemon
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=DISABLED
|
||||||
|
PROCESS_GROUPS=gps oem_2901 can
|
||||||
|
PREMIUM_FEATURE=1
|
||||||
|
IZAT_FEATURE_MASK=0xf0
|
||||||
|
PLATFORMS=all
|
||||||
|
SOC_IDS=all exclude 386 436
|
||||||
|
BASEBAND=all
|
||||||
|
LOW_RAM_TARGETS=DISABLED
|
||||||
|
LEAN_TARGETS=DISABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
|
||||||
|
PROCESS_NAME=xtra-daemon
|
||||||
|
PROCESS_ARGUMENT=
|
||||||
|
PROCESS_STATE=ENABLED
|
||||||
|
PROCESS_GROUPS=inet gps system
|
||||||
|
PREMIUM_FEATURE=0
|
||||||
|
IZAT_FEATURE_MASK=0
|
||||||
|
PLATFORMS=all
|
||||||
|
SOC_IDS=all
|
||||||
|
BASEBAND=all
|
||||||
|
LOW_RAM_TARGETS=ENABLED
|
||||||
|
HARDWARE_TYPE=all
|
||||||
|
VENDOR_ENHANCED_PROCESS=0
|
||||||
|
|
||||||
|
##################################################
|
||||||
|
# The name of process which launches XTRA client.
|
||||||
|
# Default process name in software which launches
|
||||||
|
# XTRA client is system-server. Uncomment the below
|
||||||
|
# to set the desired process which will start the
|
||||||
|
# XTRA client.
|
||||||
|
##################################################
|
||||||
|
# XC20_LAUNCH_PROCESS_NAME=garden_app
|
||||||
|
|
||||||
68
configs/gps/sap.conf
Normal file
68
configs/gps/sap.conf
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
################################
|
||||||
|
# Sensor Settings
|
||||||
|
################################
|
||||||
|
#The following parameters are optional.
|
||||||
|
#Internal defaults support MEMS sensors
|
||||||
|
#native to most handset devices.
|
||||||
|
#Device specific sensor characterization
|
||||||
|
#for improved performance is possible as
|
||||||
|
#described in SAP application notes.
|
||||||
|
#GYRO_BIAS_RANDOM_WALK=
|
||||||
|
#ACCEL_RANDOM_WALK_SPECTRAL_DENSITY=
|
||||||
|
#ANGLE_RANDOM_WALK_SPECTRAL_DENSITY=
|
||||||
|
#RATE_RANDOM_WALK_SPECTRAL_DENSITY=
|
||||||
|
#VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY=
|
||||||
|
|
||||||
|
# Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0)
|
||||||
|
# used in loc_eng_reinit
|
||||||
|
SENSOR_ACCEL_BATCHES_PER_SEC=2
|
||||||
|
SENSOR_ACCEL_SAMPLES_PER_BATCH=5
|
||||||
|
SENSOR_GYRO_BATCHES_PER_SEC=2
|
||||||
|
SENSOR_GYRO_SAMPLES_PER_BATCH=5
|
||||||
|
# Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0)
|
||||||
|
SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4
|
||||||
|
SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25
|
||||||
|
SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4
|
||||||
|
SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25
|
||||||
|
|
||||||
|
# Sensor Control Mode (0=AUTO, 1=FORCE_ON)
|
||||||
|
# used in loc_eng_reinit
|
||||||
|
SENSOR_CONTROL_MODE=0
|
||||||
|
|
||||||
|
# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable)
|
||||||
|
# used in loc_eng_reinit
|
||||||
|
SENSOR_USAGE=1
|
||||||
|
|
||||||
|
# Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK)
|
||||||
|
SENSOR_PROVIDER=1
|
||||||
|
|
||||||
|
# Bit mask used to define which sensor algorithms are used.
|
||||||
|
# Setting each bit has the following definition:
|
||||||
|
# 0x1 - DISABLE_INS_POSITIONING_FILTER
|
||||||
|
# 0x0 - ENABLE_INS_POSITIONING_FILTER
|
||||||
|
SENSOR_ALGORITHM_CONFIG_MASK=0x1
|
||||||
|
|
||||||
|
#Service configuration strings
|
||||||
|
#The number before colon in VN_X items defines version of the format of the rest of the string
|
||||||
|
#VN_ACCEL_CFG=0:5
|
||||||
|
#VN_GYRO_CFG=0:5.5
|
||||||
|
#VN_ODOMETRY_CFG=0:2,4.5
|
||||||
|
VN_ACCEL_CFG=1:128,0,12,0.0048828125,12,12,0.0048828125,24,12,0.0048828125
|
||||||
|
VN_GYRO_CFG=1:129,0,16,0.00006103515625,16,16,0.00006103515625,32,16,0.00006103515625
|
||||||
|
VN_ODOMETRY_CFG=1:130,0,1,5,6,32
|
||||||
|
VN_SPEED_CFG=1:131,5,8,1,2,3,1,1,9,2,14,2
|
||||||
|
VN_DWS_CFG=1:132,5,8,1,2,3,1,1,5,2,7,2,9,2,11,2,13,2,15,2,17,2,19,2
|
||||||
|
VN_GEAR_CFG=1:422,20,4,0,4,1,9,0,1,2,3,4,5,6,7,8
|
||||||
|
|
||||||
|
#Procesors clock ratio: AP and CAN bus microcontroller
|
||||||
|
VN_PROC_CLOCK_RATIO=1.93165618815148
|
||||||
|
|
||||||
|
# Time source used by Sensor HAL
|
||||||
|
# Setting this value controls accuracy of location sensor services.
|
||||||
|
# 0 - Unknown
|
||||||
|
# 1 - CLOCK_BOOTTIME
|
||||||
|
# 2 - CLOCK_MONOTONIC
|
||||||
|
# 3 - CLOCK_REALTIME
|
||||||
|
# 4 - CLOCK_BOOTTIME using Alarm timer interface
|
||||||
|
NDK_PROVIDER_TIME_SOURCE=1
|
||||||
|
|
||||||
78
configs/gps/xtwifi.conf
Normal file
78
configs/gps/xtwifi.conf
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#GTP AP Project client core config file
|
||||||
|
#
|
||||||
|
#GENERAL DESCRIPTION
|
||||||
|
#This is used by client core
|
||||||
|
#
|
||||||
|
#Copyright (c) 2012-2014 Qualcomm Atheros, Inc.
|
||||||
|
#All Rights Reserved.
|
||||||
|
#Qualcomm Atheros Confidential and Proprietary.
|
||||||
|
#
|
||||||
|
#Copyright (c) 2017 Qualcomm Technologies, Inc.
|
||||||
|
#All Rights Reserved.
|
||||||
|
#Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# non-IOT devices configuration items #
|
||||||
|
# For non-IOT devices, configure below configuration items #
|
||||||
|
# according to the app note: 80-NK218-1 and remove the configuration items #
|
||||||
|
# in section of "IOT devices configuration items". #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# ASN URI v2 to be used by some GTP AP modules that
|
||||||
|
# need to run with ASN URI v2 protocol.
|
||||||
|
XT_SERVER_ROOT_URL = https://gtp1.izatcloud.net:443/uds/v2
|
||||||
|
|
||||||
|
# ASN URI v3 to be used by GTP AP modules that
|
||||||
|
# can support ASN URI v3 protocol.
|
||||||
|
XT_SERVER_ROOT_URL_V3 = https://gtp1.izatcloud.net:443/uds/v3
|
||||||
|
|
||||||
|
# size, in bytes, of the cache on device
|
||||||
|
SIZE_BYTE_TOTAL_CACHE = 5000000
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# IOT devices configuration items #
|
||||||
|
# For IOT devices, configure below configuration items #
|
||||||
|
# according to the app note and remove the configuration items in section of #
|
||||||
|
# "non-IOT devices configuration items". #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# ASN URI v3 to be used by GTP AP modules that
|
||||||
|
# can support ASN URI v3 protocol.
|
||||||
|
# XT_SERVER_ROOT_URL_V3 = https://gtpma1.izatcloud.net:443/uds/v3
|
||||||
|
|
||||||
|
# 3: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed
|
||||||
|
# for any GTP requests, instead notification is sent to Izat SDK.
|
||||||
|
# WiFi crowdsourcing module is disabled.
|
||||||
|
# 4: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed
|
||||||
|
# for any GTP requests, instead notification is sent to Izat SDK.
|
||||||
|
# WiFi crowdsourcing module is active, also accessed via Izat SDK.
|
||||||
|
# GTP_AP_MODE = 4
|
||||||
|
|
||||||
|
# 1: MP cell features relies on GTP AP for either download or upload
|
||||||
|
# 0: MP cell features does not rely on GTP AP
|
||||||
|
# GTP_AP_NEEDED_BY_MP_CELL = 1
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Configuration items applicable to all devices #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Log verbosity control for most of the GTP WiFi system, including native and
|
||||||
|
# Java componenets
|
||||||
|
# OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5, ALL = 100
|
||||||
|
DEBUG_GLOBAL_LOG_LEVEL = 2
|
||||||
|
|
||||||
|
# this is used at the server side to distinguish uploads from different maker/model
|
||||||
|
# default "Qualcomm"
|
||||||
|
OEM_ID_IN_REQUEST_TO_SERVER = "Qualcomm"
|
||||||
|
|
||||||
|
# this is used at the server side to distinguish uploads from different maker/model
|
||||||
|
# default "UNKNOWN"
|
||||||
|
MODEL_ID_IN_REQUEST_TO_SERVER = "UNKNOWN"
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Qualcomm Network Location Provider config #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Accuracy Threshold for NLP position. Position exceeds thsi threshold will be filtered out.
|
||||||
|
# Default is 25000 meters.
|
||||||
|
LARGE_ACCURACY_THRESHOLD_TO_FILTER_NLP_POSITION = 25000
|
||||||
16
configs/idc/uinput-fpc.idc
Normal file
16
configs/idc/uinput-fpc.idc
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# FPC1020 Touch sensor driver
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013,2014 Fingerprint Cards AB <tech@fingerprints.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License Version 2
|
||||||
|
# as published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
|
||||||
|
device.internal = 1
|
||||||
|
|
||||||
|
keyboard.layout = uinput-fpc
|
||||||
|
keyboard.builtIn = 1
|
||||||
|
keyboard.orientationAware = 0
|
||||||
|
|
||||||
31
configs/keylayout/ft5x06_ts.kl
Normal file
31
configs/keylayout/ft5x06_ts.kl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following
|
||||||
|
# disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived
|
||||||
|
# from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
key 158 BACK
|
||||||
|
key 139 APP_SWITCH
|
||||||
|
key 172 HOME
|
||||||
|
key 217 SEARCH
|
||||||
32
configs/keylayout/gpio-keys.kl
Normal file
32
configs/keylayout/gpio-keys.kl
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following
|
||||||
|
# disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived
|
||||||
|
# from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
key 115 VOLUME_UP
|
||||||
|
key 114 VOLUME_DOWN
|
||||||
|
key 102 HOME WAKE
|
||||||
|
key 528 FOCUS
|
||||||
|
key 766 CAMERA
|
||||||
31
configs/keylayout/synaptics_dsx.kl
Normal file
31
configs/keylayout/synaptics_dsx.kl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following
|
||||||
|
# disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived
|
||||||
|
# from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
key 158 BACK
|
||||||
|
key 139 APP_SWITCH
|
||||||
|
key 172 HOME
|
||||||
|
key 217 SEARCH
|
||||||
31
configs/keylayout/synaptics_dsxv26.kl
Normal file
31
configs/keylayout/synaptics_dsxv26.kl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Copyright (c) 2014,2016, The Linux Foundation. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following
|
||||||
|
# disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived
|
||||||
|
# from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
key 158 BACK
|
||||||
|
key 139 APP_SWITCH
|
||||||
|
key 172 HOME
|
||||||
|
key 217 SEARCH
|
||||||
31
configs/keylayout/synaptics_rmi4_i2c.kl
Normal file
31
configs/keylayout/synaptics_rmi4_i2c.kl
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Copyright (c) 2014, The Linux Foundation. All rights reserved.
|
||||||
|
#
|
||||||
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
# modification, are permitted provided that the following conditions are
|
||||||
|
# met:
|
||||||
|
# * Redistributions of source code must retain the above copyright
|
||||||
|
# notice, this list of conditions and the following disclaimer.
|
||||||
|
# * Redistributions in binary form must reproduce the above
|
||||||
|
# copyright notice, this list of conditions and the following
|
||||||
|
# disclaimer in the documentation and/or other materials provided
|
||||||
|
# with the distribution.
|
||||||
|
# * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
# contributors may be used to endorse or promote products derived
|
||||||
|
# from this software without specific prior written permission.
|
||||||
|
#
|
||||||
|
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
key 158 BACK
|
||||||
|
key 139 APP_SWITCH
|
||||||
|
key 172 HOME
|
||||||
|
key 217 SEARCH
|
||||||
15
configs/keylayout/uinput-fpc.kl
Normal file
15
configs/keylayout/uinput-fpc.kl
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# FPC1020 Touch sensor driver
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013,2014 Fingerprint Cards AB <tech@fingerprints.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License Version 2
|
||||||
|
# as published by the Free Software Foundation.
|
||||||
|
#
|
||||||
|
|
||||||
|
# fpc1020 "finger present"
|
||||||
|
key 616 HOME VIRTUAL
|
||||||
|
key 617 VOICE_ASSIST VIRTUAL
|
||||||
|
key 620 APP_SWITCH VIRTUAL
|
||||||
|
key 621 BACK VIRTUAL
|
||||||
188
configs/media/media_codecs.xml
Executable file
188
configs/media/media_codecs.xml
Executable file
@@ -0,0 +1,188 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2013 The Android Open Source Project
|
||||||
|
Copyright (C) 2015-2016 The Linux Foundation. All rights reserved.
|
||||||
|
Not a contribution.
|
||||||
|
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<MediaCodecs>
|
||||||
|
<Include href="media_codecs_google_audio.xml" />
|
||||||
|
<Include href="media_codecs_google_telephony.xml" />
|
||||||
|
<Settings>
|
||||||
|
<Setting name="max-video-encoder-input-buffers" value="11" />
|
||||||
|
</Settings>
|
||||||
|
<Encoders>
|
||||||
|
<!-- Video Hardware -->
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||||
|
<Limit name="size" min="176x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||||
|
<Limit name="size" min="96x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Quirk name="requires-loaded-to-idle-after-allocation"/>
|
||||||
|
<Limit name="size" min="96x64" max="1920x1088" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||||
|
<Limit name="bitrate" range="1-40000000" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-1920x1088" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||||
|
<Limit name="size" min="96x64" max="864x480" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="48600" />
|
||||||
|
<Limit name="bitrate" range="1-2000000" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-720x480" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||||
|
<Limit name="size" min="96x64" max="1920x1088" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||||
|
<Limit name="bitrate" range="1-40000000" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-1920x1088" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
</Encoders>
|
||||||
|
<Decoders>
|
||||||
|
<!-- Video Hardware -->
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="1920x1088" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||||
|
<Limit name="bitrate" range="1-60000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Feature name="secure-playback" required="true" />
|
||||||
|
<Limit name="concurrent-instances" max="3" />
|
||||||
|
<Limit name="performance-point-1920x1088" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="96x64" max="1920x1088" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||||
|
<Limit name="bitrate" range="1-40000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-1920x1088" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="1920x1088" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||||
|
<Limit name="bitrate" range="1-60000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-1920x1088" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="864x480" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="48600" />
|
||||||
|
<Limit name="bitrate" range="1-2000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-720x480" value="30" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
|
||||||
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
|
<Quirk name="requires-allocate-on-output-ports" />
|
||||||
|
<Limit name="size" min="64x64" max="3840x2160" />
|
||||||
|
<Limit name="alignment" value="2x2" />
|
||||||
|
<Limit name="block-size" value="16x16" />
|
||||||
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
|
<Feature name="adaptive-playback" />
|
||||||
|
<Limit name="concurrent-instances" max="16" />
|
||||||
|
<Limit name="performance-point-3840x2160" value="24" />
|
||||||
|
</MediaCodec>
|
||||||
|
</Decoders>
|
||||||
|
<Include href="media_codecs_google_video.xml" />
|
||||||
|
</MediaCodecs>
|
||||||
146
configs/media/media_codecs_performance.xml
Normal file
146
configs/media/media_codecs_performance.xml
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!-- Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||||
|
|
||||||
|
Not a Contribution.
|
||||||
|
|
||||||
|
Copyright 2016 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<MediaCodecs>
|
||||||
|
<Encoders>
|
||||||
|
<MediaCodec name="c2.android.h263.encoder" type="video/3gpp" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="374-377" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.avc.encoder" type="video/avc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="245-250" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="96-97" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="48-48" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="24-24" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.mpeg4.encoder" type="video/mp4v-es" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="382-385" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="85-86" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="39-39" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="20-20" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="9-9" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.vp9.encoder" type="video/x-vnd.on2.vp9" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="80-80" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="25-25" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="7-7" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.hevc.encoder" type="video/hevc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="31-33" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="282-285" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="83-83" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="36-36" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="32-32" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="355-358" />
|
||||||
|
<Limit name="measured-frame-rate-352x288" range="283-284" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="269-272" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="83-83" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="36-36" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="32-32" />
|
||||||
|
<Limit name="measured-frame-rate-3840x2160" range="9-9" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="356-359" />
|
||||||
|
<Limit name="measured-frame-rate-352x288" range="277-278" />
|
||||||
|
<Limit name="measured-frame-rate-640x480" range="149-150" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="267-271" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="126-126" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="34-34" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="30-30" />
|
||||||
|
</MediaCodec>
|
||||||
|
</Encoders>
|
||||||
|
<Decoders>
|
||||||
|
<MediaCodec name="c2.android.h263.decoder" type="video/3gpp" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="431-441" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.avc.decoder" type="video/avc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="208-212" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="101-101" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="41-41" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="18-18" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.hevc.decoder" type="video/hevc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-352x288" range="199-203" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="131-131" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="122-123" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="63-64" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="38-38" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.mpeg4.decoder" type="video/mp4v-es" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="435-446" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="302-307" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="118-118" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="40-41" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="17-17" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="c2.android.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="270-274" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="132-133" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="73-75" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="44-44" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x240" range="439-444" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="223-224" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="283-284" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="153-153" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="584-600" />
|
||||||
|
<Limit name="measured-frame-rate-352x288" range="563-575" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
|
||||||
|
<Limit name="measured-frame-rate-352x288" range="460-467" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="339-340" />
|
||||||
|
<Limit name="measured-frame-rate-720x480" range="258-259" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="346-347" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="179-179" />
|
||||||
|
<Limit name="measured-frame-rate-3840x2160" range="44-44" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" update="true">
|
||||||
|
<Limit name="measured-frame-rate-176x144" range="576-590" />
|
||||||
|
<Limit name="measured-frame-rate-480x360" range="512-520" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="434-436" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="357-358" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="321-321" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="148-148" />
|
||||||
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
|
||||||
|
<Limit name="measured-frame-rate-320x180" range="422-424" />
|
||||||
|
<Limit name="measured-frame-rate-640x360" range="305-306" />
|
||||||
|
<Limit name="measured-frame-rate-1280x720" range="308-309" />
|
||||||
|
<Limit name="measured-frame-rate-1920x1080" range="161-161" />
|
||||||
|
<Limit name="measured-frame-rate-3840x2160" range="36-36" />
|
||||||
|
</MediaCodec>
|
||||||
|
</Decoders>
|
||||||
|
</MediaCodecs>
|
||||||
867
configs/media/media_profiles_V1_0.xml
Executable file
867
configs/media/media_profiles_V1_0.xml
Executable file
@@ -0,0 +1,867 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright 2013 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.
|
||||||
|
-->
|
||||||
|
<!DOCTYPE MediaSettings [
|
||||||
|
<!ELEMENT MediaSettings (CamcorderProfiles,
|
||||||
|
EncoderOutputFileFormat+,
|
||||||
|
VideoEncoderCap+,
|
||||||
|
AudioEncoderCap+,
|
||||||
|
VideoDecoderCap,
|
||||||
|
AudioDecoderCap)>
|
||||||
|
<!ELEMENT CamcorderProfiles (EncoderProfile+, ImageEncoding+, ImageDecoding, Camera)>
|
||||||
|
<!ELEMENT EncoderProfile (Video, Audio)>
|
||||||
|
<!ATTLIST EncoderProfile quality (high|low) #REQUIRED>
|
||||||
|
<!ATTLIST EncoderProfile fileFormat (mp4|3gp) #REQUIRED>
|
||||||
|
<!ATTLIST EncoderProfile duration (30|60) #REQUIRED>
|
||||||
|
<!ATTLIST EncoderProfile cameraId (0|1|2|3|4|5) #REQUIRED>
|
||||||
|
<!ELEMENT Video EMPTY>
|
||||||
|
<!ATTLIST Video codec (h264|h263|m4v) #REQUIRED>
|
||||||
|
<!ATTLIST Video bitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Video width CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Video height CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Video frameRate CDATA #REQUIRED>
|
||||||
|
<!ELEMENT Audio EMPTY>
|
||||||
|
<!ATTLIST Audio codec (amrnb|amrwb|aac) #REQUIRED>
|
||||||
|
<!ATTLIST Audio bitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Audio sampleRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Audio channels (1|2) #REQUIRED>
|
||||||
|
<!ELEMENT ImageEncoding EMPTY>
|
||||||
|
<!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
|
||||||
|
<!ELEMENT ImageDecoding EMPTY>
|
||||||
|
<!ATTLIST ImageDecoding memCap CDATA #REQUIRED>
|
||||||
|
<!ELEMENT Camera EMPTY>
|
||||||
|
<!ELEMENT EncoderOutputFileFormat EMPTY>
|
||||||
|
<!ATTLIST EncoderOutputFileFormat name (mp4|3gp) #REQUIRED>
|
||||||
|
<!ELEMENT VideoEncoderCap EMPTY>
|
||||||
|
<!ATTLIST VideoEncoderCap name (h264|h263|m4v|wmv) #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap enabled (true|false) #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap minBitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxBitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap minFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap minFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap minFrameRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxFrameRate CDATA #REQUIRED>
|
||||||
|
<!ELEMENT AudioEncoderCap EMPTY>
|
||||||
|
<!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma) #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap enabled (true|false) #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap minBitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap maxBitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap minSampleRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap maxSampleRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap minChannels (1|2) #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap maxChannels (1|2) #REQUIRED>
|
||||||
|
<!ELEMENT VideoDecoderCap EMPTY>
|
||||||
|
<!ATTLIST VideoDecoderCap name (wmv) #REQUIRED>
|
||||||
|
<!ATTLIST VideoDecoderCap enabled (true|false) #REQUIRED>
|
||||||
|
<!ELEMENT AudioDecoderCap EMPTY>
|
||||||
|
<!ATTLIST AudioDecoderCap name (wma) #REQUIRED>
|
||||||
|
<!ATTLIST AudioDecoderCap enabled (true|false) #REQUIRED>
|
||||||
|
]>
|
||||||
|
<!--
|
||||||
|
This file is used to declare the multimedia profiles and capabilities
|
||||||
|
on an android-powered device.
|
||||||
|
-->
|
||||||
|
<MediaSettings>
|
||||||
|
<!-- Each camcorder profile defines a set of predefined configuration parameters -->
|
||||||
|
<CamcorderProfiles cameraId="0">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
|
||||||
|
<CamcorderProfiles cameraId="1">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
<CamcorderProfiles cameraId="2">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
|
||||||
|
<CamcorderProfiles cameraId="3">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
<CamcorderProfiles cameraId="4">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="17000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
|
||||||
|
<CamcorderProfiles cameraId="5">
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="3gp" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="1200000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="6000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="12000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="96000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
|
||||||
|
<EncoderOutputFileFormat name="3gp" />
|
||||||
|
<EncoderOutputFileFormat name="mp4" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If a codec is not enabled, it is invisible to the applications
|
||||||
|
In other words, the applications won't be able to use the codec
|
||||||
|
or query the capabilities of the codec at all if it is disabled
|
||||||
|
-->
|
||||||
|
<VideoEncoderCap name="h264" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="40000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="1920"
|
||||||
|
minFrameHeight="144" maxFrameHeight="1080"
|
||||||
|
minFrameRate="15" maxFrameRate="30" />
|
||||||
|
|
||||||
|
<VideoEncoderCap name="h263" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="2000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="800"
|
||||||
|
minFrameHeight="144" maxFrameHeight="480"
|
||||||
|
minFrameRate="15" maxFrameRate="30" />
|
||||||
|
|
||||||
|
<VideoEncoderCap name="m4v" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="40000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="1920"
|
||||||
|
minFrameHeight="144" maxFrameHeight="1080"
|
||||||
|
minFrameRate="15" maxFrameRate="30" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="aac" enabled="true"
|
||||||
|
minBitRate="758" maxBitRate="288000"
|
||||||
|
minSampleRate="8000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="2" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="heaac" enabled="true"
|
||||||
|
minBitRate="8000" maxBitRate="64000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="2" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="aaceld" enabled="true"
|
||||||
|
minBitRate="16000" maxBitRate="192000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="2" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="amrwb" enabled="true"
|
||||||
|
minBitRate="6600" maxBitRate="23050"
|
||||||
|
minSampleRate="16000" maxSampleRate="16000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="amrnb" enabled="true"
|
||||||
|
minBitRate="5525" maxBitRate="12200"
|
||||||
|
minSampleRate="8000" maxSampleRate="8000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
FIXME:
|
||||||
|
We do not check decoder capabilities at present
|
||||||
|
At present, we only check whether windows media is visible
|
||||||
|
for TEST applications. For other applications, we do
|
||||||
|
not perform any checks at all.
|
||||||
|
-->
|
||||||
|
<VideoDecoderCap name="wmv" enabled="false"/>
|
||||||
|
<AudioDecoderCap name="wma" enabled="false"/>
|
||||||
|
</MediaSettings>
|
||||||
80
configs/mot_aids.fs
Normal file
80
configs/mot_aids.fs
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_ACCY]
|
||||||
|
value: 5000
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_PWRIC]
|
||||||
|
value: 5001
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_USB]
|
||||||
|
value: 5002
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_DRM]
|
||||||
|
value: 5003
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_TCMD]
|
||||||
|
value: 5004
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_SEC_RTC]
|
||||||
|
value: 5005
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_TOMBSTONE]
|
||||||
|
value: 5006
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_TPAPI]
|
||||||
|
value: 5007
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_SECCLKD]
|
||||||
|
value: 5008
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_WHISPER]
|
||||||
|
value: 5009
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_CAIF]
|
||||||
|
value: 5010
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_DLNA]
|
||||||
|
value: 5011
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_ATVC]
|
||||||
|
value: 5012
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_DBVC]
|
||||||
|
value: 5014
|
||||||
|
|
||||||
|
[AID_VENDOR_FINGERP]
|
||||||
|
value: 5015
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_ESDFS]
|
||||||
|
value: 5016
|
||||||
|
|
||||||
|
[AID_VENDOR_POWER]
|
||||||
|
value: 5017
|
||||||
|
|
||||||
|
[AID_VENDOR_ITSON]
|
||||||
|
value: 5018
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_DTV]
|
||||||
|
value: 5019
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_MOD]
|
||||||
|
value: 5020
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_SHARED]
|
||||||
|
value: 5323
|
||||||
|
|
||||||
|
[AID_VENDOR_MOT_COMMON]
|
||||||
|
value: 5341
|
||||||
2
configs/msm_irqbalance.conf
Normal file
2
configs/msm_irqbalance.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PRIO=0,0,0,0,1,1,1,1
|
||||||
|
IGNORED_IRQ=20,39
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user