Compare commits
122 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31de3dd1ce | ||
|
|
aac335cb58 | ||
|
|
39262126ce | ||
|
|
db39bda965 | ||
|
|
d56eab61ff | ||
|
|
9a96ded3f5 | ||
|
|
eb1a87033f | ||
|
|
1af861c1bc | ||
|
|
d1015bea67 | ||
|
|
f5caeb7c79 | ||
|
|
ed71980826 | ||
|
|
50adf58370 | ||
|
|
93b545d19d | ||
|
|
365063b5fa | ||
|
|
9818d39a16 | ||
|
|
afeaf50833 | ||
|
|
fa6d44cab3 | ||
|
|
65a670a120 | ||
|
|
4297fc997e | ||
|
|
6b3519493c | ||
|
|
757f14a128 | ||
|
|
f0ec66ea17 | ||
|
|
ac8092d603 | ||
|
|
59313ce8f4 | ||
|
|
2b4ceabd16 | ||
|
|
1f70fe7596 | ||
|
|
bf1a55c009 | ||
|
|
9da1099ed6 | ||
|
|
fcefe81e3c | ||
|
|
b5fb157109 | ||
|
|
760b050f25 | ||
|
|
c93c27c631 | ||
|
|
30188ef76a | ||
|
|
a5ef4a468e | ||
|
|
5541f10f9b | ||
|
|
ca47b272ab | ||
|
|
663bd057c6 | ||
|
|
3e8c790568 | ||
|
|
32d520a2ab | ||
|
|
ad56f6fb78 | ||
|
|
8d7fe952a9 | ||
|
|
17530f7111 | ||
|
|
d859b9bf2d | ||
|
|
c9d77c075b | ||
|
|
2181592463 | ||
|
|
ae72fd85b3 | ||
|
|
e8d1e807b3 | ||
|
|
0e42d461e5 | ||
|
|
8e3a098379 | ||
|
|
df0130358e | ||
|
|
5cd6fae534 | ||
|
|
5dd980d9c2 | ||
|
|
7174dd3530 | ||
|
|
14c0a592e7 | ||
|
|
a0dbeeccfc | ||
|
|
fb1f775d88 | ||
|
|
2030016da3 | ||
|
|
8b11e4a70b | ||
|
|
6f0e584044 | ||
|
|
f7e3f15e7b | ||
|
|
9d3b8a1e30 | ||
|
|
b8831c9162 | ||
|
|
794cf8b6c2 | ||
|
|
0d53255cc3 | ||
|
|
e8e8df65f5 | ||
|
|
9c84b48a59 | ||
|
|
a40c1443f5 | ||
|
|
fdd4075f6c | ||
|
|
00f58574c5 | ||
|
|
70290609e7 | ||
|
|
1598f78c99 | ||
|
|
9a82df78aa | ||
|
|
8459690a52 | ||
|
|
1ca0f23e5d | ||
|
|
abed536c00 | ||
|
|
177320f711 | ||
|
|
6ffa9a3512 | ||
|
|
29825aab62 | ||
|
|
36352e4542 | ||
|
|
1d03566432 | ||
|
|
3424f39336 | ||
|
|
0f1e782f0c | ||
|
|
8cf6cebb9e | ||
|
|
e5e0c3fc16 | ||
|
|
fbc49b3d8b | ||
|
|
257c8300ae | ||
|
|
50bc24aa12 | ||
|
|
462fe6df98 | ||
|
|
e144a3d701 | ||
|
|
0357ac4f82 | ||
|
|
50a81a383f | ||
|
|
f82d0fb3c3 | ||
|
|
63e904f3d7 | ||
|
|
d7de007636 | ||
|
|
e25dcf3632 | ||
|
|
cea15f2d7b | ||
|
|
fac236a501 | ||
|
|
0ff1352559 | ||
|
|
8b78736022 | ||
|
|
7c88aadccc | ||
|
|
33f55353f1 | ||
|
|
bbc3935e59 | ||
|
|
0b59614277 | ||
|
|
b72a890f23 | ||
|
|
ff4fa261e2 | ||
|
|
6f7b559b65 | ||
|
|
a169c7cf66 | ||
|
|
7601d64207 | ||
|
|
53bfe718ae | ||
|
|
566e67dafa | ||
|
|
5bf3421cdf | ||
|
|
bd37d7c55f | ||
|
|
9297fa3b93 | ||
|
|
ef4b2b36b1 | ||
|
|
5d8ed33094 | ||
|
|
2725662273 | ||
|
|
59b7108aa2 | ||
|
|
fabb0ade08 | ||
|
|
1e25b25524 | ||
|
|
aa68669332 | ||
|
|
fc5155379f | ||
|
|
a632d88af4 |
@@ -146,6 +146,13 @@ $(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
|||||||
|
|
||||||
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
||||||
|
|
||||||
|
NUKE_NOTEPAD := $(TARGET_OUT)/app/Notepadv3Solution
|
||||||
|
$(NUKE_NOTEPAD): $(LOCAL_INSTALLED_MODULE)
|
||||||
|
@echo "Removing: $@"
|
||||||
|
@rm -rf $@
|
||||||
|
|
||||||
|
ALL_DEFAULT_INSTALLED_MODULES += $(NUKE_NOTEPAD)
|
||||||
|
|
||||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -39,19 +39,12 @@ TARGET_ARCH_VARIANT := armv8-a
|
|||||||
TARGET_CPU_ABI := arm64-v8a
|
TARGET_CPU_ABI := arm64-v8a
|
||||||
TARGET_CPU_ABI2 :=
|
TARGET_CPU_ABI2 :=
|
||||||
TARGET_CPU_VARIANT := cortex-a53
|
TARGET_CPU_VARIANT := cortex-a53
|
||||||
|
|
||||||
TARGET_2ND_ARCH := arm
|
TARGET_2ND_ARCH := arm
|
||||||
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
|
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
|
||||||
TARGET_2ND_CPU_ABI := armeabi-v7a
|
TARGET_2ND_CPU_ABI := armeabi-v7a
|
||||||
TARGET_2ND_CPU_ABI2 := armeabi
|
TARGET_2ND_CPU_ABI2 := armeabi
|
||||||
TARGET_2ND_CPU_VARIANT := cortex-a53
|
TARGET_2ND_CPU_VARIANT := cortex-a53
|
||||||
|
|
||||||
TARGET_CPU_CORTEX_A53 := true
|
TARGET_CPU_CORTEX_A53 := true
|
||||||
|
|
||||||
# TARGET_PREFER_32_BIT := true
|
|
||||||
# TARGET_SUPPORTS_32_BIT_APPS := true
|
|
||||||
# TARGET_SUPPORTS_64_BIT_APPS := true
|
|
||||||
# TARGET_BOARD_SUFFIX := _64
|
|
||||||
TARGET_USES_64_BIT_BINDER := true
|
TARGET_USES_64_BIT_BINDER := true
|
||||||
|
|
||||||
# Asserts
|
# Asserts
|
||||||
@@ -60,8 +53,12 @@ TARGET_OTA_ASSERT_DEVICE := sanders,sanders_retail
|
|||||||
# GPS
|
# GPS
|
||||||
TARGET_NO_RPC := true
|
TARGET_NO_RPC := true
|
||||||
USE_DEVICE_SPECIFIC_GPS := true
|
USE_DEVICE_SPECIFIC_GPS := true
|
||||||
|
USING_DEVICE_GPS := true
|
||||||
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
|
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
|
||||||
|
|
||||||
|
# HDIL - enable this for ROMs build base/transport hidl in their sources
|
||||||
|
#BUILD_DEVICE_LIBHIDL := false
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
TARGET_INIT_VENDOR_LIB := libinit_sanders
|
TARGET_INIT_VENDOR_LIB := libinit_sanders
|
||||||
TARGET_RECOVERY_DEVICE_MODULES := libinit_sanders
|
TARGET_RECOVERY_DEVICE_MODULES := libinit_sanders
|
||||||
@@ -76,13 +73,16 @@ BOARD_KERNEL_SEPARATED_DT := true
|
|||||||
TARGET_CUSTOM_DTBTOOL := dtbTool_custom
|
TARGET_CUSTOM_DTBTOOL := dtbTool_custom
|
||||||
BOARD_DTBTOOL_ARGS := --force-v3 --motorola 1
|
BOARD_DTBTOOL_ARGS := --force-v3 --motorola 1
|
||||||
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100
|
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100
|
||||||
TARGET_KERNEL_ARCH := arm64
|
|
||||||
TARGET_KERNEL_HEADER_ARCH := arm64
|
TARGET_KERNEL_HEADER_ARCH := arm64
|
||||||
TARGET_KERNEL_CONFIG := sanders_defconfig
|
TARGET_KERNEL_CONFIG := sanders_defconfig
|
||||||
TARGET_KERNEL_SOURCE := kernel/motorola/msm8953
|
TARGET_KERNEL_SOURCE := kernel/motorola/msm8953
|
||||||
|
|
||||||
KERNEL_TOOLCHAIN := $(ANDROID_BUILD_TOP)/prebuilts/gcc/$(HOST_OS)-x86/aarch64/aarch64-linux-android-4.9/bin
|
# CLANG
|
||||||
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-androidkernel-
|
TARGET_KERNEL_CLANG_COMPILE := true
|
||||||
|
TARGET_KERNEL_CLANG_PATH := $(ANDROID_BUILD_TOP)/prebuilts/clang/host/$(HOST_OS)-x86/7.0-DragonTC/bin
|
||||||
|
|
||||||
|
# SDCLANG
|
||||||
|
TARGET_USE_SDCLANG := true
|
||||||
|
|
||||||
# Audio
|
# Audio
|
||||||
AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
|
AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
|
||||||
@@ -121,7 +121,6 @@ BOARD_HAVE_BLUETOOTH := true
|
|||||||
BOARD_HAVE_BLUETOOTH_QCOM := true
|
BOARD_HAVE_BLUETOOTH_QCOM := true
|
||||||
|
|
||||||
# Camera
|
# Camera
|
||||||
# TARGET_CAMERASERVICE_CLOSES_NATIVE_HANDLES := true
|
|
||||||
USE_DEVICE_SPECIFIC_CAMERA := true
|
USE_DEVICE_SPECIFIC_CAMERA := true
|
||||||
BOARD_QTI_CAMERA_32BIT_ONLY := true
|
BOARD_QTI_CAMERA_32BIT_ONLY := true
|
||||||
|
|
||||||
@@ -131,19 +130,20 @@ BOARD_CHARGER_ENABLE_SUSPEND := true
|
|||||||
BOARD_NO_CHARGER_LED := true
|
BOARD_NO_CHARGER_LED := true
|
||||||
|
|
||||||
# DT2W
|
# DT2W
|
||||||
TARGET_TAP_TO_WAKE_NODE := "/sys/android_touch/doubletap2wake"
|
#TARGET_TAP_TO_WAKE_NODE := "/sys/android_touch/doubletap2wake"
|
||||||
|
|
||||||
# CNE / DPM
|
|
||||||
BOARD_USES_QCNE := true
|
|
||||||
|
|
||||||
# CPUsets
|
|
||||||
ENABLE_CPUSETS := true
|
|
||||||
|
|
||||||
# Crypto
|
# Crypto
|
||||||
TARGET_HW_DISK_ENCRYPTION := true
|
TARGET_HW_DISK_ENCRYPTION := true
|
||||||
|
|
||||||
# Enable dexpreopt to speed boot time
|
# Enable dexpreopt to speed boot time
|
||||||
|
ifeq ($(HOST_OS),linux)
|
||||||
|
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
||||||
|
ifeq ($(WITH_DEXPREOPT),)
|
||||||
WITH_DEXPREOPT := true
|
WITH_DEXPREOPT := true
|
||||||
|
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Display
|
# Display
|
||||||
BOARD_USES_ADRENO := true
|
BOARD_USES_ADRENO := true
|
||||||
@@ -164,6 +164,9 @@ TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
|
|||||||
VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
|
VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
|
||||||
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
|
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
|
||||||
|
|
||||||
|
# exfat
|
||||||
|
TARGET_EXFAT_DRIVER := exfat
|
||||||
|
|
||||||
# FM
|
# FM
|
||||||
BOARD_HAVE_QCOM_FM := true
|
BOARD_HAVE_QCOM_FM := true
|
||||||
|
|
||||||
@@ -177,9 +180,7 @@ TARGET_PROVIDES_LIBLIGHT := true
|
|||||||
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/manifest.xml
|
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/manifest.xml
|
||||||
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/compatibility_matrix.xml
|
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/compatibility_matrix.xml
|
||||||
|
|
||||||
# Media
|
# NFC
|
||||||
# TARGET_USES_MEDIA_EXTENSIONS := true
|
|
||||||
|
|
||||||
NXP_CHIP_TYPE := PN551
|
NXP_CHIP_TYPE := PN551
|
||||||
BOARD_NFC_HAL_SUFFIX := $(TARGET_BOARD_PLATFORM)
|
BOARD_NFC_HAL_SUFFIX := $(TARGET_BOARD_PLATFORM)
|
||||||
|
|
||||||
@@ -195,15 +196,19 @@ BOARD_USERDATAIMAGE_PARTITION_SIZE := 25614597120 # 25014255 * 1024 mmcblk0p54
|
|||||||
# Peripheral manager
|
# Peripheral manager
|
||||||
TARGET_PER_MGR_ENABLED := true
|
TARGET_PER_MGR_ENABLED := true
|
||||||
|
|
||||||
|
# Power
|
||||||
|
TARGET_HAS_NO_WIFI_STATS := true
|
||||||
|
|
||||||
# QC flags
|
# QC flags
|
||||||
BOARD_USES_QCOM_HARDWARE := true
|
BOARD_USES_QCOM_HARDWARE := true
|
||||||
BOARD_USES_QC_TIME_SERVICES := true
|
BOARD_USES_QC_TIME_SERVICES := true
|
||||||
|
|
||||||
# Recovery
|
# Recovery
|
||||||
BOARD_HAS_NO_SELECT_BUTTON := true
|
BOARD_HAS_NO_SELECT_BUTTON := true
|
||||||
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
|
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.recovery
|
||||||
TARGET_USERIMAGES_USE_EXT4 := true
|
TARGET_USERIMAGES_USE_EXT4 := true
|
||||||
TARGET_USERIMAGES_USE_F2FS := true
|
TARGET_USERIMAGES_USE_F2FS := true
|
||||||
|
LZMA_RAMDISK_TARGETS := recovery
|
||||||
|
|
||||||
# Releasetools
|
# Releasetools
|
||||||
TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)/releasetools
|
TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)/releasetools
|
||||||
@@ -212,8 +217,16 @@ TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)/releasetools
|
|||||||
#include device/qcom/sepolicy/sepolicy.mk
|
#include device/qcom/sepolicy/sepolicy.mk
|
||||||
#BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy
|
#BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy
|
||||||
|
|
||||||
# Sensor
|
# Shim
|
||||||
USE_SENSOR_MULTI_HAL := true
|
TARGET_LD_SHIM_LIBS := \
|
||||||
|
/system/vendor/bin/adspd|libshim_adsp.so \
|
||||||
|
/system/vendor/lib64/libmdmcutback.so|libqsap_shim.so
|
||||||
|
|
||||||
|
# Thermal
|
||||||
|
USE_DEVICE_SPECIFIC_THERMAL := true
|
||||||
|
|
||||||
|
# Use mke2fs to create ext4 images
|
||||||
|
TARGET_USES_MKE2FS := true
|
||||||
|
|
||||||
# Wifi
|
# Wifi
|
||||||
BOARD_HAS_QCOM_WLAN := true
|
BOARD_HAS_QCOM_WLAN := true
|
||||||
@@ -228,3 +241,5 @@ WIFI_DRIVER_FW_PATH_STA := "sta"
|
|||||||
WIFI_DRIVER_FW_PATH_P2P := "p2p"
|
WIFI_DRIVER_FW_PATH_P2P := "p2p"
|
||||||
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||||
|
|
||||||
|
# MISSING_DEPENDENCIES
|
||||||
|
ALLOW_MISSING_DEPENDENCIES=true
|
||||||
|
|||||||
10
GoogleCameraMod/Android.mk
Normal file
10
GoogleCameraMod/Android.mk
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := GoogleCameraMod
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_SRC_FILES := GoogleCameraMod/Arnova_V6bt5_mod_jhenrique09.apk
|
||||||
|
LOCAL_CERTIFICATE := PRESIGNED
|
||||||
|
LOCAL_MODULE_CLASS := APPS
|
||||||
|
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
|
||||||
|
LOCAL_DEX_PREOPT := false
|
||||||
|
LOCAL_OVERRIDES_PACKAGES := Camera2
|
||||||
|
include $(BUILD_PREBUILT)
|
||||||
BIN
GoogleCameraMod/Arnova_V6bt5_mod_jhenrique09.apk
Executable file
BIN
GoogleCameraMod/Arnova_V6bt5_mod_jhenrique09.apk
Executable file
Binary file not shown.
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<java-symbol type="string" name="app_does_not_support_pip" />
|
|
||||||
</resources>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 org.lineageos.settings.device;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v14.preference.PreferenceFragment;
|
|
||||||
|
|
||||||
public class GestureSettingsFragment extends PreferenceFragment {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
|
||||||
super.onActivityCreated(savedInstanceState);
|
|
||||||
getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
|
||||||
addPreferencesFromResource(R.xml.actions_panel);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 org.lineageos.settings.device.doze;
|
|
||||||
|
|
||||||
import android.hardware.Sensor;
|
|
||||||
import android.hardware.SensorEvent;
|
|
||||||
import android.hardware.SensorEventListener;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.lang.System;
|
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
|
||||||
import org.lineageos.settings.device.SensorAction;
|
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
|
||||||
|
|
||||||
public class StowSensor implements ScreenStateNotifier, SensorEventListener {
|
|
||||||
private static final String TAG = "LineageActions-StowSensor";
|
|
||||||
private static final int IN_POCKET_MIN_TIME = 5000;
|
|
||||||
|
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
|
||||||
private final SensorHelper mSensorHelper;
|
|
||||||
private final SensorAction mSensorAction;
|
|
||||||
private final Sensor mSensor;
|
|
||||||
|
|
||||||
private boolean mEnabled;
|
|
||||||
private boolean mLastStowed;
|
|
||||||
private long isStowedTime;
|
|
||||||
|
|
||||||
public StowSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper,
|
|
||||||
SensorAction action) {
|
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
|
||||||
mSensorHelper = sensorHelper;
|
|
||||||
mSensorAction = action;
|
|
||||||
|
|
||||||
mSensor = sensorHelper.getStowSensor();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void screenTurnedOn() {
|
|
||||||
if (mEnabled) {
|
|
||||||
Log.d(TAG, "Disabling");
|
|
||||||
mSensorHelper.unregisterListener(this);
|
|
||||||
mEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void screenTurnedOff() {
|
|
||||||
if (!mLineageActionsSettings.isIrWakeupEnabled() &&
|
|
||||||
mLineageActionsSettings.isPickUpEnabled() && !mEnabled) {
|
|
||||||
Log.d(TAG, "Enabling");
|
|
||||||
mSensorHelper.registerListener(mSensor, this);
|
|
||||||
mEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSensorChanged(SensorEvent event) {
|
|
||||||
boolean thisStowed = (event.values[0] != 0);
|
|
||||||
if(thisStowed){
|
|
||||||
isStowedTime = System.currentTimeMillis();
|
|
||||||
} else if (mLastStowed && !thisStowed) {
|
|
||||||
long inPocketTime = System.currentTimeMillis() - isStowedTime;
|
|
||||||
if(inPocketTime >= IN_POCKET_MIN_TIME){
|
|
||||||
Log.d(TAG, "Triggered after " + inPocketTime / 1000 + " seconds");
|
|
||||||
mSensorAction.action();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mLastStowed = thisStowed;
|
|
||||||
Log.d(TAG, "event: " + thisStowed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@ LOCAL_MODULE_TAGS := optional
|
|||||||
|
|
||||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||||
|
|
||||||
LOCAL_PACKAGE_NAME := LineageActions
|
LOCAL_PACKAGE_NAME := MotoActions
|
||||||
LOCAL_CERTIFICATE := platform
|
LOCAL_CERTIFICATE := platform
|
||||||
LOCAL_PRIVILEGED_MODULE := true
|
LOCAL_PRIVILEGED_MODULE := true
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
|||||||
|
|
||||||
LOCAL_RESOURCE_DIR := \
|
LOCAL_RESOURCE_DIR := \
|
||||||
$(LOCAL_PATH)/res \
|
$(LOCAL_PATH)/res \
|
||||||
$(LOCAL_PATH)/../../../../packages/resources/devicesettings/res \
|
$(LOCAL_PATH)/../../../../packages/resources/MotoActions/res \
|
||||||
frameworks/support/v14/preference/res \
|
frameworks/support/v14/preference/res \
|
||||||
frameworks/support/v7/appcompat/res \
|
frameworks/support/v7/appcompat/res \
|
||||||
frameworks/support/v7/preference/res \
|
frameworks/support/v7/preference/res \
|
||||||
@@ -29,7 +29,6 @@ LOCAL_AAPT_FLAGS := --auto-add-overlay \
|
|||||||
--extra-packages android.support.v14.preference:android.support.v7.appcompat:android.support.v7.preference:android.support.v7.recyclerview
|
--extra-packages android.support.v14.preference:android.support.v7.appcompat:android.support.v7.preference:android.support.v7.recyclerview
|
||||||
|
|
||||||
LOCAL_PROGUARD_ENABLED := disabled
|
LOCAL_PROGUARD_ENABLED := disabled
|
||||||
LOCAL_DEX_PREOPT := false
|
|
||||||
|
|
||||||
include frameworks/base/packages/SettingsLib/common.mk
|
include frameworks/base/packages/SettingsLib/common.mk
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.lineageos.settings.device"
|
package="com.moto.actions"
|
||||||
android:sharedUserId="android.uid.system"
|
android:sharedUserId="android.uid.system"
|
||||||
>
|
>
|
||||||
|
|
||||||
@@ -15,18 +15,18 @@
|
|||||||
<protected-broadcast android:name="com.android.systemui.doze.pulse" />
|
<protected-broadcast android:name="com.android.systemui.doze.pulse" />
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="27"
|
||||||
android:targetSdkVersion="26" />
|
android:targetSdkVersion="27" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:label="@string/moto_actions_title"
|
android:label="@string/screen_gestures_panel_title"
|
||||||
android:icon="@drawable/ic_gesture"
|
android:icon="@drawable/ic_gesture"
|
||||||
android:persistent="true">
|
android:persistent="true">
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name=".LineageActionsSearchIndexablesProvider"
|
android:name=".MotoActionsSearchIndexablesProvider"
|
||||||
android:authorities="org.lineageos.settings.device"
|
android:authorities="com.moto.actions"
|
||||||
android:multiprocess="false"
|
android:multiprocess="false"
|
||||||
android:grantUriPermissions="true"
|
android:grantUriPermissions="true"
|
||||||
android:permission="android.permission.READ_SEARCH_INDEXABLES"
|
android:permission="android.permission.READ_SEARCH_INDEXABLES"
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<receiver android:name="org.lineageos.settings.device.BootCompletedReceiver">
|
<receiver android:name="com.moto.actions.BootCompletedReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
@@ -52,42 +52,30 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".DozeSettingsActivity"
|
android:name=".DozeSettingsActivity"
|
||||||
android:label="@string/ambient_display_title"
|
android:label="@string/ambient_display_title"
|
||||||
android:theme="@style/LineageActions">
|
android:theme="@style/MotoActions">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="org.lineageos.settings.device.DOZE_SETTINGS" />
|
<action android:name="com.moto.actions.DOZE_SETTINGS" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ActionsPreferenceActivity"
|
android:name=".ActionsPreferenceActivity"
|
||||||
android:label="@string/moto_actions_title"
|
android:label="@string/screen_gestures_panel_title"
|
||||||
android:summary="@string/device_gestures_summary"
|
android:summary="@string/device_gestures_summary"
|
||||||
android:theme="@style/LineageActions">
|
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" />
|
|
||||||
<meta-data
|
|
||||||
android:name="com.android.settings.summary"
|
|
||||||
android:resource="@string/device_gestures_summary" />
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".GestureSettingsActivity"
|
android:name=".GestureSettingsActivity"
|
||||||
android:label="@string/device_gestures_title"
|
android:label="@string/device_gestures_title"
|
||||||
android:theme="@style/LineageActions">
|
android:theme="@style/MotoActions">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".FPGestureSettingsActivity"
|
android:name=".FPGestureSettingsActivity"
|
||||||
android:label="@string/fingerprint_gestures_title"
|
android:label="@string/fingerprint_gestures_title"
|
||||||
android:theme="@style/LineageActions">
|
android:theme="@style/MotoActions">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -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>
|
||||||
@@ -43,6 +43,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:theme="@style/LineageActions.SwitchBar" />
|
android:theme="@style/MotoActions.SwitchBar" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -68,7 +68,6 @@
|
|||||||
<string name="action_dialer">Abrir discador</string>
|
<string name="action_dialer">Abrir discador</string>
|
||||||
<string name="action_email">Abrir app de mail</string>
|
<string name="action_email">Abrir app de mail</string>
|
||||||
<string name="action_messages">Abrir app de mensagens</string>
|
<string name="action_messages">Abrir app de mensagens</string>
|
||||||
<string name="action_pip">Modo picture-in-picture</string>
|
|
||||||
|
|
||||||
<!-- Screen off gestures -->
|
<!-- Screen off gestures -->
|
||||||
<string name="screen_off_gestures_title">Gestos com a tela desligada</string>
|
<string name="screen_off_gestures_title">Gestos com a tela desligada</string>
|
||||||
@@ -90,6 +89,4 @@
|
|||||||
<string name="haptic_feedback">Retorno tátil</string>
|
<string name="haptic_feedback">Retorno tátil</string>
|
||||||
<string name="haptic_feedback_summary">Vibrar quando um gesto for detectado</string>
|
<string name="haptic_feedback_summary">Vibrar quando um gesto for detectado</string>
|
||||||
|
|
||||||
<!-- Pip -->
|
|
||||||
<string name="app_does_not_support_pip">O aplicativo não tem suporte ao modo picture-in-picture.</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -31,7 +31,6 @@
|
|||||||
<item>@string/action_flashlight</item>
|
<item>@string/action_flashlight</item>
|
||||||
<item>@string/action_camera</item>
|
<item>@string/action_camera</item>
|
||||||
<item>@string/action_screenshot</item>
|
<item>@string/action_screenshot</item>
|
||||||
<item>@string/action_pip</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="fp_keys_listValues">
|
<string-array name="fp_keys_listValues">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
@@ -49,7 +48,6 @@
|
|||||||
<item>110</item> <!-- flashlight -->
|
<item>110</item> <!-- flashlight -->
|
||||||
<item>111</item> <!-- camera -->
|
<item>111</item> <!-- camera -->
|
||||||
<item>112</item> <!-- screenshot -->
|
<item>112</item> <!-- screenshot -->
|
||||||
<item>120</item> <!-- pip -->
|
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="fp_keys_screen_off_listArray">
|
<string-array name="fp_keys_screen_off_listArray">
|
||||||
@@ -68,7 +68,6 @@
|
|||||||
<string name="action_dialer">Open dialer</string>
|
<string name="action_dialer">Open dialer</string>
|
||||||
<string name="action_email">Open email app</string>
|
<string name="action_email">Open email app</string>
|
||||||
<string name="action_messages">Open messages app</string>
|
<string name="action_messages">Open messages app</string>
|
||||||
<string name="action_pip">Picture-in-Picture mode</string>
|
|
||||||
|
|
||||||
<!-- Screen off gestures -->
|
<!-- Screen off gestures -->
|
||||||
<string name="screen_off_gestures_title">Screen off gestures</string>
|
<string name="screen_off_gestures_title">Screen off gestures</string>
|
||||||
@@ -90,6 +89,4 @@
|
|||||||
<string name="haptic_feedback">Haptic feedback</string>
|
<string name="haptic_feedback">Haptic feedback</string>
|
||||||
<string name="haptic_feedback_summary">Vibrate when a touchscreen gesture is detected</string>
|
<string name="haptic_feedback_summary">Vibrate when a touchscreen gesture is detected</string>
|
||||||
|
|
||||||
<!-- Pip -->
|
|
||||||
<string name="app_does_not_support_pip">App does not support picture-in-picture mode.</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -17,42 +17,42 @@
|
|||||||
-->
|
-->
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
|
||||||
<style name="LineageActions" parent="@android:style/Theme.DeviceDefault.Settings">
|
<style name="MotoActions" parent="@android:style/Theme.DeviceDefault.Settings">
|
||||||
<item name="dialogPreferenceStyle">@style/LineageActions.DialogPreferenceStyle</item>
|
<item name="dialogPreferenceStyle">@style/MotoActions.DialogPreferenceStyle</item>
|
||||||
<item name="preferenceCategoryStyle">@style/LineageActions.PreferenceCategoryStyle</item>
|
<item name="preferenceCategoryStyle">@style/MotoActions.PreferenceCategoryStyle</item>
|
||||||
<item name="preferenceFragmentStyle">@style/LineageActions.PreferenceFragmentStyle</item>
|
<item name="preferenceFragmentStyle">@style/MotoActions.PreferenceFragmentStyle</item>
|
||||||
<item name="preferenceStyle">@style/LineageActions.PreferenceStyle</item>
|
<item name="preferenceStyle">@style/MotoActions.PreferenceStyle</item>
|
||||||
<item name="preferenceTheme">@style/LineageActions.PreferenceTheme</item>
|
<item name="preferenceTheme">@style/MotoActions.PreferenceTheme</item>
|
||||||
<item name="switchPreferenceStyle">@style/LineageActions.SwitchPreferenceStyle</item>
|
<item name="switchPreferenceStyle">@style/MotoActions.SwitchPreferenceStyle</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.DialogPreferenceStyle" parent="@style/LineageActions.PreferenceStyle">
|
<style name="MotoActions.DialogPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
<style name="MotoActions.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
||||||
<item name="allowDividerAbove">true</item>
|
<item name="allowDividerAbove">true</item>
|
||||||
<item name="allowDividerBelow">true</item>
|
<item name="allowDividerBelow">true</item>
|
||||||
<item name="android:layout">@layout/preference_category_material_settings</item>
|
<item name="android:layout">@layout/preference_category_material_settings</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
<style name="MotoActions.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
||||||
<item name="allowDividerAfterLastItem">false</item>
|
<item name="allowDividerAfterLastItem">false</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
<style name="MotoActions.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
||||||
<item name="allowDividerAbove">false</item>
|
<item name="allowDividerAbove">false</item>
|
||||||
<item name="allowDividerBelow">true</item>
|
<item name="allowDividerBelow">true</item>
|
||||||
<item name="singleLineTitle">false</item>
|
<item name="singleLineTitle">false</item>
|
||||||
<item name="android:layout">@layout/preference_material_settings</item>
|
<item name="android:layout">@layout/preference_material_settings</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.PreferenceTheme">
|
<style name="MotoActions.PreferenceTheme">
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.SwitchPreferenceStyle" parent="@style/LineageActions.PreferenceStyle">
|
<style name="MotoActions.SwitchPreferenceStyle" parent="@style/MotoActions.PreferenceStyle">
|
||||||
<item name="widgetLayout">@*android:layout/preference_widget_switch</item>
|
<item name="widgetLayout">@*android:layout/preference_widget_switch</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="LineageActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
<style name="MotoActions.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||||
|
|
||||||
|
<SwitchPreference
|
||||||
|
android:key="gesture_double_tap_power"
|
||||||
|
android:title="@string/double_tap_power_for_camera_title"
|
||||||
|
android:summary="@string/double_tap_power_for_camera_summary"/>
|
||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="gesture_camera_action"
|
android:key="gesture_camera_action"
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:key="gesture_hand_wave"
|
android:key="gesture_hand_wave"
|
||||||
android:defaultValue="true"
|
android:defaultValue="false"
|
||||||
android:title="@string/hand_wave_gesture_title"
|
android:title="@string/hand_wave_gesture_title"
|
||||||
android:summary="@string/hand_wave_gesture_summary" />
|
android:summary="@string/hand_wave_gesture_summary" />
|
||||||
|
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
android:summary="@string/device_gestures_summary"
|
android:summary="@string/device_gestures_summary"
|
||||||
android:icon="@drawable/ic_settings_gestures">
|
android:icon="@drawable/ic_settings_gestures">
|
||||||
<intent
|
<intent
|
||||||
android:targetPackage="org.lineageos.settings.device"
|
android:targetPackage="com.moto.actions"
|
||||||
android:targetClass="org.lineageos.settings.device.GestureSettingsActivity" />
|
android:targetClass="com.moto.actions.GestureSettingsActivity" />
|
||||||
</Preference>
|
</Preference>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
android:summary="@string/ambient_display_manage_summary"
|
android:summary="@string/ambient_display_manage_summary"
|
||||||
android:icon="@drawable/ic_settings_doze">
|
android:icon="@drawable/ic_settings_doze">
|
||||||
<intent
|
<intent
|
||||||
android:targetPackage="org.lineageos.settings.device"
|
android:targetPackage="com.moto.actions"
|
||||||
android:targetClass="org.lineageos.settings.device.DozeSettingsActivity" />
|
android:targetClass="com.moto.actions.DozeSettingsActivity" />
|
||||||
</Preference>
|
</Preference>
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
@@ -44,8 +44,8 @@
|
|||||||
android:summary="@string/fingerprint_gestures_manage_summary"
|
android:summary="@string/fingerprint_gestures_manage_summary"
|
||||||
android:icon="@drawable/ic_settings_fingerprint">
|
android:icon="@drawable/ic_settings_fingerprint">
|
||||||
<intent
|
<intent
|
||||||
android:targetPackage="org.lineageos.settings.device"
|
android:targetPackage="com.moto.actions"
|
||||||
android:targetClass="org.lineageos.settings.device.FPGestureSettingsActivity" />
|
android:targetClass="com.moto.actions.FPGestureSettingsActivity" />
|
||||||
</Preference>
|
</Preference>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v14.preference.PreferenceFragment;
|
import android.support.v14.preference.PreferenceFragment;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -27,12 +27,12 @@ import android.content.ServiceConnection;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.util.FileUtils;
|
import com.moto.actions.util.FileUtils;
|
||||||
import org.lineageos.settings.device.actions.Constants;
|
import com.moto.actions.actions.Constants;
|
||||||
import org.lineageos.settings.device.ServiceWrapper.LocalBinder;
|
import com.moto.actions.ServiceWrapper.LocalBinder;
|
||||||
|
|
||||||
public class BootCompletedReceiver extends BroadcastReceiver {
|
public class BootCompletedReceiver extends BroadcastReceiver {
|
||||||
static final String TAG = "LineageActions";
|
static final String TAG = "MotoActions";
|
||||||
final String NAVBAR_SHOWN = "navbar_shown";
|
final String NAVBAR_SHOWN = "navbar_shown";
|
||||||
|
|
||||||
private ServiceWrapper mServiceWrapper;
|
private ServiceWrapper mServiceWrapper;
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -63,7 +63,7 @@ public class DozeSettingsFragment extends PreferenceFragment {
|
|||||||
|
|
||||||
View switchBar = view.findViewById(R.id.switch_bar);
|
View switchBar = view.findViewById(R.id.switch_bar);
|
||||||
mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
|
mAmbientDisplaySwitch = (Switch) switchBar.findViewById(android.R.id.switch_widget);
|
||||||
mAmbientDisplaySwitch.setChecked(LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
|
mAmbientDisplaySwitch.setChecked(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()));
|
||||||
mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener);
|
mAmbientDisplaySwitch.setOnCheckedChangeListener(mAmbientDisplayPrefListener);
|
||||||
|
|
||||||
switchBar.setOnClickListener(new View.OnClickListener() {
|
switchBar.setOnClickListener(new View.OnClickListener() {
|
||||||
@@ -74,14 +74,14 @@ public class DozeSettingsFragment extends PreferenceFragment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mSwitchBarText = switchBar.findViewById(R.id.switch_text);
|
mSwitchBarText = switchBar.findViewById(R.id.switch_text);
|
||||||
mSwitchBarText.setText(LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver()) ? R.string.switch_bar_on :
|
mSwitchBarText.setText(MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver()) ? R.string.switch_bar_on :
|
||||||
R.string.switch_bar_off);
|
R.string.switch_bar_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
addPreferencesFromResource(R.xml.doze_panel);
|
addPreferencesFromResource(R.xml.doze_panel);
|
||||||
boolean dozeEnabled = LineageActionsSettings.isDozeEnabled(getActivity().getContentResolver());
|
boolean dozeEnabled = MotoActionsSettings.isDozeEnabled(getActivity().getContentResolver());
|
||||||
mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE);
|
mHandwavePreference = (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE);
|
||||||
mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP);
|
mPickupPreference = (SwitchPreference) findPreference(KEY_GESTURE_PICK_UP);
|
||||||
updatePrefs(dozeEnabled);
|
updatePrefs(dozeEnabled);
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -33,10 +33,10 @@ import android.widget.CompoundButton;
|
|||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.lineageos.settings.device.actions.Constants;
|
import com.moto.actions.actions.Constants;
|
||||||
|
|
||||||
import static org.lineageos.settings.device.actions.Constants.FP_HOME_KEY;
|
import static com.moto.actions.actions.Constants.FP_HOME_KEY;
|
||||||
import static org.lineageos.settings.device.actions.Constants.FP_HOME_KEY_OFF;
|
import static com.moto.actions.actions.Constants.FP_HOME_KEY_OFF;
|
||||||
|
|
||||||
public class FPGestureSettingsFragment extends PreferenceFragment {
|
public class FPGestureSettingsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* 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.support.v7.preference.Preference;
|
||||||
|
import android.support.v14.preference.PreferenceFragment;
|
||||||
|
import android.support.v14.preference.SwitchPreference;
|
||||||
|
import android.os.UserHandle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
|
||||||
|
public class GestureSettingsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
|
private SwitchPreference mGestureDoubleTapPower;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||||
|
addPreferencesFromResource(R.xml.actions_panel);
|
||||||
|
mGestureDoubleTapPower = (SwitchPreference) findPreference("gesture_double_tap_power");
|
||||||
|
if (isCameraDoubleTapPowerAllowed()){
|
||||||
|
mGestureDoubleTapPower.setChecked(isCameraDoubleTapPowerEnabled());
|
||||||
|
mGestureDoubleTapPower.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||||
|
boolean value = (Boolean) objValue;
|
||||||
|
setCameraDoubleTapPowerEnabled(value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
Resources settingsRes = getActivity().createPackageContext("com.android.settings", 0).getResources();
|
||||||
|
mGestureDoubleTapPower.setTitle(settingsRes.getString(
|
||||||
|
settingsRes.getIdentifier("double_tap_power_for_camera_title", "string", "com.android.settings")));
|
||||||
|
mGestureDoubleTapPower.setSummary(settingsRes.getString(
|
||||||
|
settingsRes.getIdentifier("double_tap_power_for_camera_summary", "string", "com.android.settings")));
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
getPreferenceScreen().removePreference(mGestureDoubleTapPower);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCameraDoubleTapPowerAllowed() {
|
||||||
|
return getActivity().getResources().getBoolean(
|
||||||
|
com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCameraDoubleTapPowerEnabled(){
|
||||||
|
return Settings.Secure.getIntForUser(getActivity().getContentResolver(),
|
||||||
|
Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0, UserHandle.USER_CURRENT) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setCameraDoubleTapPowerEnabled(boolean enabled){
|
||||||
|
Settings.Secure.putInt(getActivity().getContentResolver(),
|
||||||
|
Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, enabled ? 0 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
@@ -59,16 +59,15 @@ import android.view.InputDevice;
|
|||||||
import android.view.KeyCharacterMap;
|
import android.view.KeyCharacterMap;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.ViewConfiguration;
|
import android.view.ViewConfiguration;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.android.internal.os.DeviceKeyHandler;
|
import com.android.internal.os.DeviceKeyHandler;
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
|
|
||||||
import org.lineageos.settings.device.util.FileUtils;
|
import com.moto.actions.util.FileUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.lineageos.settings.device.actions.Constants.*;
|
import static com.moto.actions.actions.Constants.*;
|
||||||
|
|
||||||
public class KeyHandler implements DeviceKeyHandler {
|
public class KeyHandler implements DeviceKeyHandler {
|
||||||
|
|
||||||
@@ -439,7 +438,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleKeyEvent(KeyEvent event) {
|
public KeyEvent handleKeyEvent(KeyEvent event) {
|
||||||
int scanCode = event.getScanCode();
|
int scanCode = event.getScanCode();
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
@@ -453,7 +452,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
|
|
||||||
boolean isFPScanCode = ArrayUtils.contains(sSupportedFPGestures, scanCode);
|
boolean isFPScanCode = ArrayUtils.contains(sSupportedFPGestures, scanCode);
|
||||||
if (!isFPScanCode) {
|
if (!isFPScanCode) {
|
||||||
return false;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isFPGestureEnabled = FileUtils.readOneLine(FP_HOME_NODE).equals("1");
|
boolean isFPGestureEnabled = FileUtils.readOneLine(FP_HOME_NODE).equals("1");
|
||||||
@@ -463,12 +462,12 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
|
|
||||||
// We only want ACTION_UP event
|
// We only want ACTION_UP event
|
||||||
if (event.getAction() != KeyEvent.ACTION_UP) {
|
if (event.getAction() != KeyEvent.ACTION_UP) {
|
||||||
return true;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFPScanCode){
|
if (isFPScanCode){
|
||||||
if (fpGesturePending) {
|
if (fpGesturePending) {
|
||||||
return false;
|
return event;
|
||||||
} else {
|
} else {
|
||||||
resetFPGestureDelay();
|
resetFPGestureDelay();
|
||||||
fpGesturePending = true;
|
fpGesturePending = true;
|
||||||
@@ -483,7 +482,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
if (isFPScanCode) {
|
if (isFPScanCode) {
|
||||||
if ((!isFPGestureEnabled) || (!isScreenOn && !isFPGestureEnabledOnScreenOff)) {
|
if ((!isFPGestureEnabled) || (!isScreenOn && !isFPGestureEnabledOnScreenOff)) {
|
||||||
resetDoubleTapOnFP();
|
resetDoubleTapOnFP();
|
||||||
return false;
|
return event;
|
||||||
}
|
}
|
||||||
if (!isScreenOn && isFPGestureEnabledOnScreenOff) {
|
if (!isScreenOn && isFPGestureEnabledOnScreenOff) {
|
||||||
processFPScreenOffScancode(scanCode);
|
processFPScreenOffScancode(scanCode);
|
||||||
@@ -491,7 +490,7 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
processFPScancode(scanCode);
|
processFPScancode(scanCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processFPScancode(int scanCode) {
|
private void processFPScancode(int scanCode) {
|
||||||
@@ -582,11 +581,6 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
case ACTION_SCREENSHOT:
|
case ACTION_SCREENSHOT:
|
||||||
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_SYSRQ);
|
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_SYSRQ);
|
||||||
break;
|
break;
|
||||||
case ACTION_PIP:
|
|
||||||
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
|
||||||
goToPipMode();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ACTION_LAST_APP:
|
case ACTION_LAST_APP:
|
||||||
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
|
||||||
switchToLastApp(mContext);
|
switchToLastApp(mContext);
|
||||||
@@ -602,26 +596,6 @@ public class KeyHandler implements DeviceKeyHandler {
|
|||||||
mVibrator.vibrate(intensity);
|
mVibrator.vibrate(intensity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void goToPipMode() {
|
|
||||||
ActivityInfo ai = getRunningActivityInfo(mContext);
|
|
||||||
if (ai != null && !ai.supportsPictureInPicture()) {
|
|
||||||
try {
|
|
||||||
PackageManager pm = mContext.getPackageManager();
|
|
||||||
Resources resources = pm.getResourcesForApplication("org.lineageos.settings.device");
|
|
||||||
int resId = resources.getIdentifier("app_does_not_support_pip", "string", "org.lineageos.settings.device");
|
|
||||||
final String text = resources.getString(resId);
|
|
||||||
mHandler.post(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(mContext, text, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
triggerVirtualKeypress(mHandler, 171);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void toggleScreenState() {
|
private void toggleScreenState() {
|
||||||
if (mPowerManager.isScreenOn()) {
|
if (mPowerManager.isScreenOn()) {
|
||||||
mPowerManager.goToSleep(SystemClock.uptimeMillis());
|
mPowerManager.goToSleep(SystemClock.uptimeMillis());
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.MatrixCursor;
|
import android.database.MatrixCursor;
|
||||||
@@ -33,8 +33,8 @@ import static android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS;
|
|||||||
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
|
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
|
||||||
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
|
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
|
||||||
|
|
||||||
public class LineageActionsSearchIndexablesProvider extends SearchIndexablesProvider {
|
public class MotoActionsSearchIndexablesProvider extends SearchIndexablesProvider {
|
||||||
private static final String TAG = "LineageActionsSearchIndexablesProvider";
|
private static final String TAG = "MotoActionsSearchIndexablesProvider";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
@@ -73,7 +73,7 @@ public class LineageActionsSearchIndexablesProvider extends SearchIndexablesProv
|
|||||||
ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null;
|
ref[COLUMN_INDEX_XML_RES_CLASS_NAME] = null;
|
||||||
ref[COLUMN_INDEX_XML_RES_ICON_RESID] = sir.iconResId;
|
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_ACTION] = "com.android.settings.action.EXTRA_SETTINGS";
|
||||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "org.lineageos.settings.device";
|
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE] = "com.moto.actions";
|
||||||
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
|
ref[COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS] = sir.className;
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.app.IntentService;
|
import android.app.IntentService;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -27,23 +27,22 @@ import android.util.Log;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import org.lineageos.settings.device.actions.UpdatedStateNotifier;
|
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||||
import org.lineageos.settings.device.actions.CameraActivationSensor;
|
import com.moto.actions.actions.CameraActivationSensor;
|
||||||
import org.lineageos.settings.device.actions.ChopChopSensor;
|
import com.moto.actions.actions.ChopChopSensor;
|
||||||
import org.lineageos.settings.device.actions.FlipToMute;
|
import com.moto.actions.actions.FlipToMute;
|
||||||
import org.lineageos.settings.device.actions.LiftToSilence;
|
import com.moto.actions.actions.LiftToSilence;
|
||||||
import org.lineageos.settings.device.actions.ProximitySilencer;
|
import com.moto.actions.actions.ProximitySilencer;
|
||||||
|
|
||||||
import org.lineageos.settings.device.doze.DozePulseAction;
|
import com.moto.actions.doze.DozePulseAction;
|
||||||
//import org.lineageos.settings.device.doze.GlanceSensor;
|
import com.moto.actions.doze.GlanceSensor;
|
||||||
import org.lineageos.settings.device.doze.ProximitySensor;
|
import com.moto.actions.doze.ProximitySensor;
|
||||||
import org.lineageos.settings.device.doze.ScreenReceiver;
|
import com.moto.actions.doze.ScreenReceiver;
|
||||||
import org.lineageos.settings.device.doze.ScreenStateNotifier;
|
import com.moto.actions.doze.ScreenStateNotifier;
|
||||||
import org.lineageos.settings.device.doze.StowSensor;
|
|
||||||
|
|
||||||
public class LineageActionsService extends IntentService implements ScreenStateNotifier,
|
public class MotoActionsService extends IntentService implements ScreenStateNotifier,
|
||||||
UpdatedStateNotifier {
|
UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
@@ -57,13 +56,13 @@ public class LineageActionsService extends IntentService implements ScreenStateN
|
|||||||
private final List<UpdatedStateNotifier> mUpdatedStateNotifiers =
|
private final List<UpdatedStateNotifier> mUpdatedStateNotifiers =
|
||||||
new LinkedList<UpdatedStateNotifier>();
|
new LinkedList<UpdatedStateNotifier>();
|
||||||
|
|
||||||
public LineageActionsService(Context context) {
|
public MotoActionsService(Context context) {
|
||||||
super("LineageActionService");
|
super("MotoActionService");
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
|
||||||
Log.d(TAG, "Starting");
|
Log.d(TAG, "Starting");
|
||||||
|
|
||||||
LineageActionsSettings lineageActionsSettings = new LineageActionsSettings(context, this);
|
MotoActionsSettings motoActionsSettings = new MotoActionsSettings(context, this);
|
||||||
mSensorHelper = new SensorHelper(context);
|
mSensorHelper = new SensorHelper(context);
|
||||||
mScreenReceiver = new ScreenReceiver(context, this);
|
mScreenReceiver = new ScreenReceiver(context, this);
|
||||||
|
|
||||||
@@ -71,19 +70,18 @@ public class LineageActionsService extends IntentService implements ScreenStateN
|
|||||||
mScreenStateNotifiers.add(mDozePulseAction);
|
mScreenStateNotifiers.add(mDozePulseAction);
|
||||||
|
|
||||||
// Actionable sensors get screen on/off notifications
|
// Actionable sensors get screen on/off notifications
|
||||||
//mScreenStateNotifiers.add(new GlanceSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
mScreenStateNotifiers.add(new GlanceSensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
|
||||||
mScreenStateNotifiers.add(new ProximitySensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
mScreenStateNotifiers.add(new ProximitySensor(motoActionsSettings, mSensorHelper, mDozePulseAction));
|
||||||
mScreenStateNotifiers.add(new StowSensor(lineageActionsSettings, mSensorHelper, mDozePulseAction));
|
|
||||||
|
|
||||||
// Other actions that are always enabled
|
// Other actions that are always enabled
|
||||||
mUpdatedStateNotifiers.add(new CameraActivationSensor(lineageActionsSettings, mSensorHelper));
|
mUpdatedStateNotifiers.add(new CameraActivationSensor(motoActionsSettings, mSensorHelper));
|
||||||
mUpdatedStateNotifiers.add(new ChopChopSensor(lineageActionsSettings, mSensorHelper));
|
mUpdatedStateNotifiers.add(new ChopChopSensor(motoActionsSettings, mSensorHelper));
|
||||||
mUpdatedStateNotifiers.add(new ProximitySilencer(lineageActionsSettings, context, mSensorHelper));
|
mUpdatedStateNotifiers.add(new ProximitySilencer(motoActionsSettings, context, mSensorHelper));
|
||||||
mUpdatedStateNotifiers.add(new FlipToMute(lineageActionsSettings, context, mSensorHelper));
|
mUpdatedStateNotifiers.add(new FlipToMute(motoActionsSettings, context, mSensorHelper));
|
||||||
mUpdatedStateNotifiers.add(new LiftToSilence(lineageActionsSettings, context, mSensorHelper));
|
mUpdatedStateNotifiers.add(new LiftToSilence(motoActionsSettings, context, mSensorHelper));
|
||||||
|
|
||||||
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "LineageActionsWakeLock");
|
mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "MotoActionsWakeLock");
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -25,13 +25,13 @@ import android.provider.Settings;
|
|||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.actions.Constants;
|
import com.moto.actions.actions.Constants;
|
||||||
import org.lineageos.settings.device.actions.UpdatedStateNotifier;
|
import com.moto.actions.actions.UpdatedStateNotifier;
|
||||||
import org.lineageos.settings.device.actions.CameraActivationAction;
|
import com.moto.actions.actions.CameraActivationAction;
|
||||||
import org.lineageos.settings.device.actions.TorchAction;
|
import com.moto.actions.actions.TorchAction;
|
||||||
|
|
||||||
public class LineageActionsSettings {
|
public class MotoActionsSettings {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private static final String GESTURE_CAMERA_ACTION_KEY = "gesture_camera_action";
|
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_CHOP_CHOP_KEY = "gesture_chop_chop";
|
||||||
@@ -52,7 +52,7 @@ public class LineageActionsSettings {
|
|||||||
private boolean mFlipToMuteEnabled;
|
private boolean mFlipToMuteEnabled;
|
||||||
private boolean mLiftToSilenceEnabled;
|
private boolean mLiftToSilenceEnabled;
|
||||||
|
|
||||||
public LineageActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
|
public MotoActionsSettings(Context context, UpdatedStateNotifier updatedStateNotifier) {
|
||||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
loadPreferences(sharedPrefs);
|
loadPreferences(sharedPrefs);
|
||||||
sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener);
|
sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener);
|
||||||
@@ -107,7 +107,7 @@ public class LineageActionsSettings {
|
|||||||
private void loadPreferences(SharedPreferences sharedPreferences) {
|
private void loadPreferences(SharedPreferences sharedPreferences) {
|
||||||
mCameraGestureEnabled = sharedPreferences.getBoolean(GESTURE_CAMERA_ACTION_KEY, true);
|
mCameraGestureEnabled = sharedPreferences.getBoolean(GESTURE_CAMERA_ACTION_KEY, true);
|
||||||
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
||||||
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, true);
|
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, false);
|
||||||
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
||||||
mIrSilencerEnabled = sharedPreferences.getBoolean(GESTURE_IR_SILENCER_KEY, false);
|
mIrSilencerEnabled = sharedPreferences.getBoolean(GESTURE_IR_SILENCER_KEY, false);
|
||||||
mFlipToMuteEnabled = sharedPreferences.getBoolean(GESTURE_FLIP_TO_MUTE_KEY, false);
|
mFlipToMuteEnabled = sharedPreferences.getBoolean(GESTURE_FLIP_TO_MUTE_KEY, false);
|
||||||
@@ -125,7 +125,7 @@ public class LineageActionsSettings {
|
|||||||
} else if (GESTURE_CHOP_CHOP_KEY.equals(key)) {
|
} else if (GESTURE_CHOP_CHOP_KEY.equals(key)) {
|
||||||
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
mChopChopEnabled = sharedPreferences.getBoolean(GESTURE_CHOP_CHOP_KEY, true);
|
||||||
} else if (GESTURE_IR_WAKEUP_KEY.equals(key)) {
|
} else if (GESTURE_IR_WAKEUP_KEY.equals(key)) {
|
||||||
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, true);
|
mIrWakeUpEnabled = sharedPreferences.getBoolean(GESTURE_IR_WAKEUP_KEY, false);
|
||||||
} else if (GESTURE_PICK_UP_KEY.equals(key)) {
|
} else if (GESTURE_PICK_UP_KEY.equals(key)) {
|
||||||
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
mPickUpGestureEnabled = sharedPreferences.getBoolean(GESTURE_PICK_UP_KEY, true);
|
||||||
} else if (GESTURE_IR_SILENCER_KEY.equals(key)) {
|
} else if (GESTURE_IR_SILENCER_KEY.equals(key)) {
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
public interface SensorAction {
|
public interface SensorAction {
|
||||||
public void action();
|
public void action();
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -26,17 +26,17 @@ import android.content.Context;
|
|||||||
import android.hardware.Sensor;
|
import android.hardware.Sensor;
|
||||||
import android.hardware.SensorEventListener;
|
import android.hardware.SensorEventListener;
|
||||||
import android.hardware.SensorManager;
|
import android.hardware.SensorManager;
|
||||||
import android.hardware.TriggerEventListener;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class SensorHelper {
|
public class SensorHelper {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private static final int SENSOR_TYPE_MMI_CAMERA_ACTIVATION = 65540;
|
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_CHOP_CHOP = 65546;
|
||||||
private static final int SENSOR_TYPE_MMI_FLAT_UP = 65537;
|
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_FLAT_DOWN = 65538;
|
||||||
private static final int SENSOR_TYPE_MMI_STOW = 65539;
|
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 static final int BATCH_LATENCY_IN_MS = 100;
|
||||||
|
|
||||||
@@ -81,6 +81,10 @@ public class SensorHelper {
|
|||||||
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_FLAT_DOWN, true);
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_FLAT_DOWN, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Sensor getGlanceSensor() {
|
||||||
|
return mSensorManager.getDefaultSensor(SENSOR_TYPE_MMI_GLANCE, true);
|
||||||
|
}
|
||||||
|
|
||||||
public Sensor getProximitySensor() {
|
public Sensor getProximitySensor() {
|
||||||
return mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, true);
|
return mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, true);
|
||||||
}
|
}
|
||||||
@@ -99,15 +103,4 @@ public class SensorHelper {
|
|||||||
public void unregisterListener(SensorEventListener listener) {
|
public void unregisterListener(SensorEventListener listener) {
|
||||||
mSensorManager.unregisterListener(listener);
|
mSensorManager.unregisterListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TriggerSensor */
|
|
||||||
public void requestTriggerSensor(Sensor sensor, TriggerEventListener listener) {
|
|
||||||
if (!mSensorManager.requestTriggerSensor(listener, sensor)) {
|
|
||||||
throw new RuntimeException("Failed to requestTriggerSensor for sensor " + sensor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancelTriggerSensor(Sensor sensor, TriggerEventListener listener) {
|
|
||||||
mSensorManager.cancelTriggerSensor(listener, sensor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device;
|
package com.moto.actions;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
@@ -24,10 +24,10 @@ import android.os.IBinder;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class ServiceWrapper extends android.app.Service {
|
public class ServiceWrapper extends android.app.Service {
|
||||||
static final String TAG = "LineageActions-ServiceWrapper";
|
static final String TAG = "MotoActions-ServiceWrapper";
|
||||||
|
|
||||||
private final IBinder mBinder = new LocalBinder();
|
private final IBinder mBinder = new LocalBinder();
|
||||||
private LineageActionsService mLineageActionsService;
|
private MotoActionsService mMotoActionsService;
|
||||||
|
|
||||||
public interface ServiceCallback {
|
public interface ServiceCallback {
|
||||||
void sendResults(int resultCode, Bundle b);
|
void sendResults(int resultCode, Bundle b);
|
||||||
@@ -45,7 +45,7 @@ public class ServiceWrapper extends android.app.Service {
|
|||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
Log.i(TAG, "onCreate");
|
Log.i(TAG, "onCreate");
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
mLineageActionsService = new LineageActionsService(this);
|
mMotoActionsService = new MotoActionsService(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@ import android.os.Vibrator;
|
|||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.SensorAction;
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
public class CameraActivationAction implements SensorAction {
|
public class CameraActivationAction implements SensorAction {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -25,23 +25,23 @@ import android.hardware.SensorEventListener;
|
|||||||
import android.hardware.SensorManager;
|
import android.hardware.SensorManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
public class CameraActivationSensor implements SensorEventListener, UpdatedStateNotifier {
|
public class CameraActivationSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions-CameraSensor";
|
private static final String TAG = "MotoActions-CameraSensor";
|
||||||
|
|
||||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||||
|
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
|
|
||||||
private final Sensor mSensor;
|
private final Sensor mSensor;
|
||||||
|
|
||||||
private boolean mIsEnabled;
|
private boolean mIsEnabled;
|
||||||
|
|
||||||
public CameraActivationSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) {
|
public CameraActivationSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mSensor = sensorHelper.getCameraActivationSensor();
|
mSensor = sensorHelper.getCameraActivationSensor();
|
||||||
mSensorHelper.registerListener(mSensor, this);
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
@@ -49,10 +49,10 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void updateState() {
|
public synchronized void updateState() {
|
||||||
if (mLineageActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
|
if (mMotoActionsSettings.isCameraGestureEnabled() && !mIsEnabled) {
|
||||||
Log.d(TAG, "Enabling");
|
Log.d(TAG, "Enabling");
|
||||||
mIsEnabled = true;
|
mIsEnabled = true;
|
||||||
} else if (! mLineageActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
|
} else if (! mMotoActionsSettings.isCameraGestureEnabled() && mIsEnabled) {
|
||||||
Log.d(TAG, "Disabling");
|
Log.d(TAG, "Disabling");
|
||||||
mIsEnabled = false;
|
mIsEnabled = false;
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class CameraActivationSensor implements SensorEventListener, UpdatedState
|
|||||||
@Override
|
@Override
|
||||||
public void onSensorChanged(SensorEvent event) {
|
public void onSensorChanged(SensorEvent event) {
|
||||||
Log.d(TAG, "activate camera");
|
Log.d(TAG, "activate camera");
|
||||||
if (mIsEnabled) mLineageActionsSettings.cameraAction();
|
if (mIsEnabled) mMotoActionsSettings.cameraAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -25,15 +25,15 @@ import android.hardware.SensorEventListener;
|
|||||||
import android.hardware.SensorManager;
|
import android.hardware.SensorManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier {
|
public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions-ChopChopSensor";
|
private static final String TAG = "MotoActions-ChopChopSensor";
|
||||||
|
|
||||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||||
|
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
private final Sensor mSensor;
|
private final Sensor mSensor;
|
||||||
private final Sensor mProx;
|
private final Sensor mProx;
|
||||||
@@ -41,8 +41,8 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
|||||||
private boolean mIsEnabled;
|
private boolean mIsEnabled;
|
||||||
private boolean mProxIsCovered;
|
private boolean mProxIsCovered;
|
||||||
|
|
||||||
public ChopChopSensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper) {
|
public ChopChopSensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper) {
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mSensor = sensorHelper.getChopChopSensor();
|
mSensor = sensorHelper.getChopChopSensor();
|
||||||
mProx = sensorHelper.getProximitySensor();
|
mProx = sensorHelper.getProximitySensor();
|
||||||
@@ -50,12 +50,12 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void updateState() {
|
public synchronized void updateState() {
|
||||||
if (mLineageActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
|
if (mMotoActionsSettings.isChopChopGestureEnabled() && !mIsEnabled) {
|
||||||
Log.d(TAG, "Enabling");
|
Log.d(TAG, "Enabling");
|
||||||
mSensorHelper.registerListener(mSensor, this);
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
mSensorHelper.registerListener(mProx, mProxListener);
|
mSensorHelper.registerListener(mProx, mProxListener);
|
||||||
mIsEnabled = true;
|
mIsEnabled = true;
|
||||||
} else if (! mLineageActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
|
} else if (! mMotoActionsSettings.isChopChopGestureEnabled() && mIsEnabled) {
|
||||||
Log.d(TAG, "Disabling");
|
Log.d(TAG, "Disabling");
|
||||||
mSensorHelper.unregisterListener(this);
|
mSensorHelper.unregisterListener(this);
|
||||||
mSensorHelper.unregisterListener(mProxListener);
|
mSensorHelper.unregisterListener(mProxListener);
|
||||||
@@ -70,7 +70,7 @@ public class ChopChopSensor implements SensorEventListener, UpdatedStateNotifier
|
|||||||
Log.d(TAG, "proximity sensor covered, ignoring chop-chop");
|
Log.d(TAG, "proximity sensor covered, ignoring chop-chop");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mLineageActionsSettings.chopChopAction();
|
mMotoActionsSettings.chopChopAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -25,13 +25,13 @@ import android.content.SharedPreferences;
|
|||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.util.FileUtils;
|
import com.moto.actions.util.FileUtils;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
public static final boolean DEBUG = false;
|
public static final boolean DEBUG = false;
|
||||||
|
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
// FP gestures
|
// FP gestures
|
||||||
public static final int FP_TAP_SCANCODE = 616;
|
public static final int FP_TAP_SCANCODE = 616;
|
||||||
@@ -63,7 +63,6 @@ public class Constants {
|
|||||||
public static final int ACTION_DIALER = 117;
|
public static final int ACTION_DIALER = 117;
|
||||||
public static final int ACTION_EMAIL = 118;
|
public static final int ACTION_EMAIL = 118;
|
||||||
public static final int ACTION_MESSAGES = 119;
|
public static final int ACTION_MESSAGES = 119;
|
||||||
public static final int ACTION_PIP = 120;
|
|
||||||
public static final int ACTION_LAST_APP = 121;
|
public static final int ACTION_LAST_APP = 121;
|
||||||
public static final int[] sFPSupportedActions = new int[]{
|
public static final int[] sFPSupportedActions = new int[]{
|
||||||
ACTION_HOME,
|
ACTION_HOME,
|
||||||
@@ -79,7 +78,6 @@ public class Constants {
|
|||||||
ACTION_FLASHLIGHT,
|
ACTION_FLASHLIGHT,
|
||||||
ACTION_CAMERA,
|
ACTION_CAMERA,
|
||||||
ACTION_SCREENSHOT,
|
ACTION_SCREENSHOT,
|
||||||
ACTION_PIP,
|
|
||||||
ACTION_LAST_APP
|
ACTION_LAST_APP
|
||||||
};
|
};
|
||||||
public static final int[] sFPSupportedActionsScreenOff = new int[]{
|
public static final int[] sFPSupportedActionsScreenOff = new int[]{
|
||||||
@@ -204,7 +202,7 @@ public class Constants {
|
|||||||
public static void writePreference(Context context, String pref) {
|
public static void writePreference(Context context, String pref) {
|
||||||
|
|
||||||
String value = "1";
|
String value = "1";
|
||||||
Log.e(TAG, "Write Pref: " + pref);
|
|
||||||
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) &&
|
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))
|
!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";
|
value = isPreferenceEnabled(context, pref) ? "1" : "0";
|
||||||
@@ -212,7 +210,6 @@ public class Constants {
|
|||||||
value = GetPreference(context, pref);
|
value = GetPreference(context, pref);
|
||||||
|
|
||||||
String node = sBooleanNodePreferenceMap.get(pref);
|
String node = sBooleanNodePreferenceMap.get(pref);
|
||||||
Log.e(TAG, "Write " + value + " to node " + node);
|
|
||||||
|
|
||||||
if (!FileUtils.writeLine(node, value)) {
|
if (!FileUtils.writeLine(node, value)) {
|
||||||
Log.w(TAG, "Write " + value + " to node " + node +
|
Log.w(TAG, "Write " + value + " to node " + node +
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@@ -27,14 +27,14 @@ import android.hardware.SensorEvent;
|
|||||||
import android.hardware.SensorEventListener;
|
import android.hardware.SensorEventListener;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
public class FlipToMute implements UpdatedStateNotifier {
|
public class FlipToMute implements UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions-FlipToMute";
|
private static final String TAG = "MotoActions-FlipToMute";
|
||||||
|
|
||||||
private final NotificationManager mNotificationManager;
|
private final NotificationManager mNotificationManager;
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
private final Sensor mFlatDown;
|
private final Sensor mFlatDown;
|
||||||
private final Sensor mStow;
|
private final Sensor mStow;
|
||||||
@@ -46,9 +46,9 @@ public class FlipToMute implements UpdatedStateNotifier {
|
|||||||
private Context mContext;
|
private Context mContext;
|
||||||
private Receiver mReceiver;
|
private Receiver mReceiver;
|
||||||
|
|
||||||
public FlipToMute(LineageActionsSettings lineageActionsSettings, Context context,
|
public FlipToMute(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
SensorHelper sensorHelper) {
|
SensorHelper sensorHelper) {
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mFlatDown = sensorHelper.getFlatDownSensor();
|
mFlatDown = sensorHelper.getFlatDownSensor();
|
||||||
@@ -61,14 +61,14 @@ public class FlipToMute implements UpdatedStateNotifier {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateState() {
|
public void updateState() {
|
||||||
if (mLineageActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
|
if (mMotoActionsSettings.isFlipToMuteEnabled() && !mIsEnabled) {
|
||||||
Log.d(TAG, "Enabling");
|
Log.d(TAG, "Enabling");
|
||||||
mSensorHelper.registerListener(mFlatDown, mFlatDownListener);
|
mSensorHelper.registerListener(mFlatDown, mFlatDownListener);
|
||||||
mSensorHelper.registerListener(mStow, mStowListener);
|
mSensorHelper.registerListener(mStow, mStowListener);
|
||||||
mContext.registerReceiver(mReceiver,
|
mContext.registerReceiver(mReceiver,
|
||||||
new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED));
|
new IntentFilter(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED));
|
||||||
mIsEnabled = true;
|
mIsEnabled = true;
|
||||||
} else if (!mLineageActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
|
} else if (!mMotoActionsSettings.isFlipToMuteEnabled() && mIsEnabled) {
|
||||||
Log.d(TAG, "Disabling");
|
Log.d(TAG, "Disabling");
|
||||||
mSensorHelper.unregisterListener(mFlatDownListener);
|
mSensorHelper.unregisterListener(mFlatDownListener);
|
||||||
mSensorHelper.unregisterListener(mStowListener);
|
mSensorHelper.unregisterListener(mStowListener);
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.hardware.Sensor;
|
import android.hardware.Sensor;
|
||||||
@@ -26,13 +26,13 @@ import android.telecom.TelecomManager;
|
|||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
public class LiftToSilence extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
public class LiftToSilence extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions-LiftToSilence";
|
private static final String TAG = "MotoActions-LiftToSilence";
|
||||||
|
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
private final Sensor mFlatUpSensor;
|
private final Sensor mFlatUpSensor;
|
||||||
private final Sensor mStowSensor;
|
private final Sensor mStowSensor;
|
||||||
@@ -44,9 +44,9 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
|
|||||||
private boolean mIsStowed;
|
private boolean mIsStowed;
|
||||||
private boolean mLastFlatUp;
|
private boolean mLastFlatUp;
|
||||||
|
|
||||||
public LiftToSilence(LineageActionsSettings lineageActionsSettings, Context context,
|
public LiftToSilence(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
SensorHelper sensorHelper) {
|
SensorHelper sensorHelper) {
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mFlatUpSensor = sensorHelper.getFlatUpSensor();
|
mFlatUpSensor = sensorHelper.getFlatUpSensor();
|
||||||
mStowSensor = sensorHelper.getStowSensor();
|
mStowSensor = sensorHelper.getStowSensor();
|
||||||
@@ -56,7 +56,7 @@ public class LiftToSilence extends PhoneStateListener implements SensorEventList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateState() {
|
public void updateState() {
|
||||||
if (mLineageActionsSettings.isLiftToSilenceEnabled()) {
|
if (mMotoActionsSettings.isLiftToSilenceEnabled()) {
|
||||||
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||||
} else {
|
} else {
|
||||||
mTelephonyManager.listen(this, 0);
|
mTelephonyManager.listen(this, 0);
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.hardware.Sensor;
|
import android.hardware.Sensor;
|
||||||
@@ -26,31 +26,31 @@ import android.telecom.TelecomManager;
|
|||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
import static android.telephony.TelephonyManager.*;
|
import static android.telephony.TelephonyManager.*;
|
||||||
|
|
||||||
public class ProximitySilencer extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
public class ProximitySilencer extends PhoneStateListener implements SensorEventListener, UpdatedStateNotifier {
|
||||||
private static final String TAG = "LineageActions-ProximitySilencer";
|
private static final String TAG = "MotoActions-ProximitySilencer";
|
||||||
|
|
||||||
private static final int SILENCE_DELAY_MS = 500;
|
private static final int SILENCE_DELAY_MS = 500;
|
||||||
|
|
||||||
private final TelecomManager mTelecomManager;
|
private final TelecomManager mTelecomManager;
|
||||||
private final TelephonyManager mTelephonyManager;
|
private final TelephonyManager mTelephonyManager;
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
private final Sensor mSensor;
|
private final Sensor mSensor;
|
||||||
private boolean mIsRinging;
|
private boolean mIsRinging;
|
||||||
private long mRingStartedMs;
|
private long mRingStartedMs;
|
||||||
private boolean mCoveredRinging;
|
private boolean mCoveredRinging;
|
||||||
|
|
||||||
public ProximitySilencer(LineageActionsSettings lineageActionsSettings, Context context,
|
public ProximitySilencer(MotoActionsSettings motoActionsSettings, Context context,
|
||||||
SensorHelper sensorHelper) {
|
SensorHelper sensorHelper) {
|
||||||
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
|
mTelecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
|
||||||
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mSensor = sensorHelper.getProximitySensor();
|
mSensor = sensorHelper.getProximitySensor();
|
||||||
mCoveredRinging = false;
|
mCoveredRinging = false;
|
||||||
@@ -59,7 +59,7 @@ public class ProximitySilencer extends PhoneStateListener implements SensorEvent
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateState() {
|
public void updateState() {
|
||||||
if (mLineageActionsSettings.isIrSilencerEnabled()) {
|
if (mMotoActionsSettings.isIrSilencerEnabled()) {
|
||||||
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
mTelephonyManager.listen(this, LISTEN_CALL_STATE);
|
||||||
} else {
|
} else {
|
||||||
mTelephonyManager.listen(this, 0);
|
mTelephonyManager.listen(this, 0);
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.hardware.camera2.CameraManager;
|
import android.hardware.camera2.CameraManager;
|
||||||
@@ -24,10 +24,10 @@ import android.hardware.camera2.CameraAccessException;
|
|||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.SensorAction;
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
public class TorchAction implements SensorAction {
|
public class TorchAction implements SensorAction {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
private static final int TURN_SCREEN_ON_WAKE_LOCK_MS = 500;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.actions;
|
package com.moto.actions.actions;
|
||||||
|
|
||||||
public interface UpdatedStateNotifier {
|
public interface UpdatedStateNotifier {
|
||||||
public void updateState();
|
public void updateState();
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.doze;
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.SensorAction;
|
import com.moto.actions.SensorAction;
|
||||||
|
|
||||||
public class DozePulseAction implements SensorAction, ScreenStateNotifier {
|
public class DozePulseAction implements SensorAction, ScreenStateNotifier {
|
||||||
private static final String TAG = "LineageActions";
|
private static final String TAG = "MotoActions";
|
||||||
|
|
||||||
private static final int DELAY_BETWEEN_DOZES_IN_MS = 1500;
|
private static final int DELAY_BETWEEN_DOZES_IN_MS = 1500;
|
||||||
|
|
||||||
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) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -15,21 +15,21 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.doze;
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
import android.hardware.Sensor;
|
import android.hardware.Sensor;
|
||||||
import android.hardware.SensorEvent;
|
import android.hardware.SensorEvent;
|
||||||
import android.hardware.SensorEventListener;
|
import android.hardware.SensorEventListener;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.lineageos.settings.device.LineageActionsSettings;
|
import com.moto.actions.MotoActionsSettings;
|
||||||
import org.lineageos.settings.device.SensorAction;
|
import com.moto.actions.SensorAction;
|
||||||
import org.lineageos.settings.device.SensorHelper;
|
import com.moto.actions.SensorHelper;
|
||||||
|
|
||||||
public class ProximitySensor implements ScreenStateNotifier, SensorEventListener {
|
public class ProximitySensor implements ScreenStateNotifier, SensorEventListener {
|
||||||
private static final String TAG = "LineageActions-ProximitySensor";
|
private static final String TAG = "MotoActions-ProximitySensor";
|
||||||
|
|
||||||
private final LineageActionsSettings mLineageActionsSettings;
|
private final MotoActionsSettings mMotoActionsSettings;
|
||||||
private final SensorHelper mSensorHelper;
|
private final SensorHelper mSensorHelper;
|
||||||
private final SensorAction mSensorAction;
|
private final SensorAction mSensorAction;
|
||||||
private final Sensor mSensor;
|
private final Sensor mSensor;
|
||||||
@@ -38,9 +38,9 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
|
|||||||
|
|
||||||
private boolean mSawNear = false;
|
private boolean mSawNear = false;
|
||||||
|
|
||||||
public ProximitySensor(LineageActionsSettings lineageActionsSettings, SensorHelper sensorHelper,
|
public ProximitySensor(MotoActionsSettings motoActionsSettings, SensorHelper sensorHelper,
|
||||||
SensorAction action) {
|
SensorAction action) {
|
||||||
mLineageActionsSettings = lineageActionsSettings;
|
mMotoActionsSettings = motoActionsSettings;
|
||||||
mSensorHelper = sensorHelper;
|
mSensorHelper = sensorHelper;
|
||||||
mSensorAction = action;
|
mSensorAction = action;
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public class ProximitySensor implements ScreenStateNotifier, SensorEventListener
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void screenTurnedOff() {
|
public void screenTurnedOff() {
|
||||||
if (mLineageActionsSettings.isIrWakeupEnabled() && !mEnabled) {
|
if (mMotoActionsSettings.isIrWakeupEnabled() && !mEnabled) {
|
||||||
Log.d(TAG, "Enabling");
|
Log.d(TAG, "Enabling");
|
||||||
mSensorHelper.registerListener(mSensor, this);
|
mSensorHelper.registerListener(mSensor, this);
|
||||||
mEnabled = true;
|
mEnabled = true;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.doze;
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
|
||||||
import org.lineageos.settings.device.actions.Constants;
|
import com.moto.actions.actions.Constants;
|
||||||
|
|
||||||
public class ScreenReceiver extends BroadcastReceiver {
|
public class ScreenReceiver extends BroadcastReceiver {
|
||||||
private final ScreenStateNotifier mNotifier;
|
private final ScreenStateNotifier mNotifier;
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.doze;
|
package com.moto.actions.doze;
|
||||||
|
|
||||||
public interface ScreenStateNotifier {
|
public interface ScreenStateNotifier {
|
||||||
public void screenTurnedOn();
|
public void screenTurnedOn();
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.lineageos.settings.device.util;
|
package com.moto.actions.util;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -9,9 +9,9 @@ Basic | Spec Sheet
|
|||||||
CPU | Octa-core 2.0 GHz Cortex-A53
|
CPU | Octa-core 2.0 GHz Cortex-A53
|
||||||
Chipset | Qualcomm MSM8953 Snapdragon 625
|
Chipset | Qualcomm MSM8953 Snapdragon 625
|
||||||
GPU | Adreno 506
|
GPU | Adreno 506
|
||||||
Memory | 4 GB RAM
|
Memory | 3/4 GB RAM
|
||||||
Shipped Android Version | 7.0.0
|
Shipped Android Version | 7.1.1
|
||||||
Storage | 32 GB
|
Storage | 64/32 GB
|
||||||
MicroSD | Up to 256 GB
|
MicroSD | Up to 256 GB
|
||||||
Battery | Li-Ion 3000mAh battery
|
Battery | Li-Ion 3000mAh battery
|
||||||
Display | 1080 x 1920 pixels, 5.2 inches (~402 ppi pixel density)
|
Display | 1080 x 1920 pixels, 5.2 inches (~402 ppi pixel density)
|
||||||
|
|||||||
26
aosp.dependencies
Normal file
26
aosp.dependencies
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"remote": "github",
|
||||||
|
"repository": "Keertesh19/kernel_motorola_msm8953",
|
||||||
|
"target_path": "kernel/motorola/msm8953",
|
||||||
|
"branch": "8.1-moto"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote": "github",
|
||||||
|
"repository": "Keertesh19/vendor_motorola_sanders",
|
||||||
|
"target_path": "vendor/motorola/sanders",
|
||||||
|
"branch": "oreo-mr1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"remote": "github",
|
||||||
|
"repository": "PixelExperience/packages_resources_MotoActions",
|
||||||
|
"target_path": "packages/resources/MotoActions",
|
||||||
|
"branch": "oreo-mr1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"repository": "jhenrique09/prebuilts_clang_host_linux-x86_7.0-DragonTC",
|
||||||
|
"target_path": "prebuilts/clang/host/linux-x86/7.0-DragonTC",
|
||||||
|
"branch": "master",
|
||||||
|
"remote": "github"
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -18,12 +18,11 @@
|
|||||||
# Inherit from those products. Most specific first.
|
# Inherit from those products. Most specific first.
|
||||||
$(call inherit-product, device/motorola/sanders/full_sanders.mk)
|
$(call inherit-product, device/motorola/sanders/full_sanders.mk)
|
||||||
|
|
||||||
# Inherit some common CM stuff.
|
# Inherit some common PixelExperience stuff.
|
||||||
$(call inherit-product, vendor/aosp/common.mk)
|
TARGET_GAPPS_ARCH := arm64
|
||||||
|
TARGET_BOOT_ANIMATION_RES := 1080
|
||||||
# Boot animation
|
TARGET_INCLUDE_ARCORE := true
|
||||||
TARGET_SCREEN_WIDTH := 1080
|
$(call inherit-product, vendor/aosp/config/common_full_phone.mk)
|
||||||
TARGET_SCREEN_HEIGHT := 1920
|
|
||||||
|
|
||||||
## Device identifier. This must come after all inclusions
|
## Device identifier. This must come after all inclusions
|
||||||
PRODUCT_DEVICE := sanders
|
PRODUCT_DEVICE := sanders
|
||||||
@@ -35,3 +34,4 @@ PRODUCT_SYSTEM_PROPERTY_BLACKLIST := ro.product.model
|
|||||||
|
|
||||||
PRODUCT_BUILD_PROP_OVERRIDES += \
|
PRODUCT_BUILD_PROP_OVERRIDES += \
|
||||||
PRODUCT_NAME="Moto G5S Plus"
|
PRODUCT_NAME="Moto G5S Plus"
|
||||||
|
DEVICE_MAINTAINERS="Keertesh"
|
||||||
|
|||||||
@@ -53,6 +53,8 @@
|
|||||||
<device name="SND_DEVICE_OUT_SPEAKER_AND_LINE" backend="speaker-and-headphones" />
|
<device name="SND_DEVICE_OUT_SPEAKER_AND_LINE" backend="speaker-and-headphones" />
|
||||||
<device name="SND_DEVICE_OUT_SPEAKER_SAFE_AND_HEADPHONES" backend="speaker-and-headphones" />
|
<device name="SND_DEVICE_OUT_SPEAKER_SAFE_AND_HEADPHONES" backend="speaker-and-headphones" />
|
||||||
<device name="SND_DEVICE_OUT_SPEAKER_SAFE_AND_LINE" backend="speaker-and-headphones" />
|
<device name="SND_DEVICE_OUT_SPEAKER_SAFE_AND_LINE" backend="speaker-and-headphones" />
|
||||||
|
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO" backend="speaker-and-bt-sco"/>
|
||||||
|
<device name="SND_DEVICE_OUT_SPEAKER_AND_BT_SCO_WB" backend="speaker-and-bt-sco-wb"/>
|
||||||
</backend_names>
|
</backend_names>
|
||||||
|
|
||||||
<pcm_ids>
|
<pcm_ids>
|
||||||
@@ -66,7 +68,7 @@
|
|||||||
<usecase name="USECASE_VOLTE_CALL" type="out" id="15"/>
|
<usecase name="USECASE_VOLTE_CALL" type="out" id="15"/>
|
||||||
<usecase name="USECASE_VOWLAN_CALL" type="in" id="16"/>
|
<usecase name="USECASE_VOWLAN_CALL" type="in" id="16"/>
|
||||||
<usecase name="USECASE_VOWLAN_CALL" type="out" id="16"/>
|
<usecase name="USECASE_VOWLAN_CALL" type="out" id="16"/>
|
||||||
<usecase name="USECASE_AUDIO_DSM_FEEDBACK" type="in" id="55" />
|
<usecase name="USECASE_AUDIO_DSM_FEEDBACK" type="in" id="60" />
|
||||||
</pcm_ids>
|
</pcm_ids>
|
||||||
|
|
||||||
<config_params>
|
<config_params>
|
||||||
|
|||||||
@@ -90,15 +90,15 @@ audio_hw_modules {
|
|||||||
sampling_rates dynamic
|
sampling_rates dynamic
|
||||||
channel_masks dynamic
|
channel_masks dynamic
|
||||||
formats dynamic
|
formats dynamic
|
||||||
devices AUDIO_DEVICE_OUT_USB_DEVICE
|
devices AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inputs {
|
inputs {
|
||||||
usb_device {
|
usb_device {
|
||||||
sampling_rates dynamic
|
sampling_rates dynamic
|
||||||
channel_masks AUDIO_CHANNEL_IN_STEREO
|
channel_masks dynamic
|
||||||
formats AUDIO_FORMAT_PCM_16_BIT
|
formats dynamic
|
||||||
devices AUDIO_DEVICE_IN_USB_DEVICE
|
devices AUDIO_DEVICE_IN_USB_DEVICE|AUDIO_DEVICE_IN_USB_HEADSET
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,6 +267,16 @@
|
|||||||
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia1" value="1" />
|
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia1" value="1" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="deep-buffer-playback speaker-and-bt-sco">
|
||||||
|
<path name="deep-buffer-playback speaker" />
|
||||||
|
<path name="deep-buffer-playback bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="deep-buffer-playback speaker-and-bt-sco-wb">
|
||||||
|
<path name="deep-buffer-playback speaker" />
|
||||||
|
<path name="deep-buffer-playback bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="low-latency-playback">
|
<path name="low-latency-playback">
|
||||||
<ctl name="PRI_MI2S_RX Audio Mixer MultiMedia5" value="1" />
|
<ctl name="PRI_MI2S_RX Audio Mixer MultiMedia5" value="1" />
|
||||||
</path>
|
</path>
|
||||||
@@ -293,6 +303,16 @@
|
|||||||
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia5" value="1" />
|
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia5" value="1" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="low-latency-playback speaker-and-bt-sco">
|
||||||
|
<path name="low-latency-playback speaker" />
|
||||||
|
<path name="low-latency-playback bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="low-latency-playback speaker-and-bt-sco-wb">
|
||||||
|
<path name="low-latency-playback speaker" />
|
||||||
|
<path name="low-latency-playback bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="audio-ull-playback">
|
<path name="audio-ull-playback">
|
||||||
<ctl name="PRI_MI2S_RX Audio Mixer MultiMedia3" value="1" />
|
<ctl name="PRI_MI2S_RX Audio Mixer MultiMedia3" value="1" />
|
||||||
</path>
|
</path>
|
||||||
@@ -323,6 +343,16 @@
|
|||||||
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia3" value="1" />
|
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia3" value="1" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="audio-ull-playback speaker-and-bt-sco">
|
||||||
|
<path name="audio-ull-playback speaker" />
|
||||||
|
<path name="audio-ull-playback bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="audio-ull-playback speaker-and-bt-sco-wb">
|
||||||
|
<path name="audio-ull-playback speaker" />
|
||||||
|
<path name="audio-ull-playback bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="audio-tts-playback speaker">
|
<path name="audio-tts-playback speaker">
|
||||||
<!-- audio-tts-playback usecase is only valid on speaker backend -->
|
<!-- audio-tts-playback usecase is only valid on speaker backend -->
|
||||||
<ctl name="QUIN_MI2S_RX Audio Mixer MultiMedia2" value="1" />
|
<ctl name="QUIN_MI2S_RX Audio Mixer MultiMedia2" value="1" />
|
||||||
@@ -354,6 +384,16 @@
|
|||||||
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia4" value="1" />
|
<ctl name="AFE_PCM_RX Audio Mixer MultiMedia4" value="1" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="compress-offload-playback speaker-and-bt-sco">
|
||||||
|
<path name="compress-offload-playback speaker" />
|
||||||
|
<path name="compress-offload-playback bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="compress-offload-playback speaker-and-bt-sco-wb">
|
||||||
|
<path name="compress-offload-playback speaker" />
|
||||||
|
<path name="compress-offload-playback bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="audio-record">
|
<path name="audio-record">
|
||||||
<ctl name="MultiMedia1 Mixer TERT_MI2S_TX" value="1" />
|
<ctl name="MultiMedia1 Mixer TERT_MI2S_TX" value="1" />
|
||||||
</path>
|
</path>
|
||||||
@@ -531,6 +571,14 @@
|
|||||||
<path name="voicemmode1-call usb-headphones" />
|
<path name="voicemmode1-call usb-headphones" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="voicemmode1-call speaker-and-bt-sco">
|
||||||
|
<path name="voicemmode1-call bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="voicemmode1-call speaker-and-bt-sco-wb">
|
||||||
|
<path name="voicemmode1-call bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="voicemmode2-call">
|
<path name="voicemmode2-call">
|
||||||
<ctl name="PRI_MI2S_RX_Voice Mixer VoiceMMode2" value="1" />
|
<ctl name="PRI_MI2S_RX_Voice Mixer VoiceMMode2" value="1" />
|
||||||
<ctl name="VoiceMMode2_Tx Mixer TERT_MI2S_TX_MMode2" value="1" />
|
<ctl name="VoiceMMode2_Tx Mixer TERT_MI2S_TX_MMode2" value="1" />
|
||||||
@@ -564,6 +612,14 @@
|
|||||||
<path name="voicemmode2-call usb-headphones" />
|
<path name="voicemmode2-call usb-headphones" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
|
<path name="voicemmode2-call speaker-and-bt-sco">
|
||||||
|
<path name="voicemmode2-call bt-sco" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path name="voicemmode2-call speaker-and-bt-sco-wb">
|
||||||
|
<path name="voicemmode2-call bt-sco-wb" />
|
||||||
|
</path>
|
||||||
|
|
||||||
<path name="hfp-sco">
|
<path name="hfp-sco">
|
||||||
<ctl name="PRI_MI2S_RX Port Mixer INTERNAL_BT_SCO_TX" value="1" />
|
<ctl name="PRI_MI2S_RX Port Mixer INTERNAL_BT_SCO_TX" value="1" />
|
||||||
<ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia6" value="1" />
|
<ctl name="INTERNAL_BT_SCO_RX Audio Mixer MultiMedia6" value="1" />
|
||||||
|
|||||||
@@ -28,5 +28,5 @@
|
|||||||
#define BT_CLEAN_TURN_ON_DISABLED TRUE
|
#define BT_CLEAN_TURN_ON_DISABLED TRUE
|
||||||
#define BTM_WBS_INCLUDED TRUE
|
#define BTM_WBS_INCLUDED TRUE
|
||||||
#define BTIF_HF_WBS_PREFERRED TRUE
|
#define BTIF_HF_WBS_PREFERRED TRUE
|
||||||
#define BTM_SCO_ENHANCED_SYNC_DISABLED TRUE
|
#define BTM_SCO_ENHANCED_SYNC_ENABLED FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
59
configs/calibration_cad.xml
Normal file
59
configs/calibration_cad.xml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<!-- This calibration file was created by fidning an average of the factory
|
||||||
|
calibration for 12 different marlin devices -->
|
||||||
|
<rig>
|
||||||
|
<device_id>0</device_id>
|
||||||
|
<camera>
|
||||||
|
<camera_model name="" index="3" type="calibu_fu_fv_u0_v0_k1_k2_k3">
|
||||||
|
<width>320</width>
|
||||||
|
<height>180</height>
|
||||||
|
<params> [260.215; 260.277; 157.511; 86.24160000000001; 0.23834; -0.688656; 0.664354] </params>
|
||||||
|
</camera_model>
|
||||||
|
<pose />
|
||||||
|
</camera>
|
||||||
|
<camera>
|
||||||
|
<camera_model name="Narrow" index="1" type="calibu_fu_fv_u0_v0_k1_k2_k3">
|
||||||
|
<width>1920</width>
|
||||||
|
<height>1080</height>
|
||||||
|
<params> [1436.454; 1436.235; 961.194; 544.107; 0.0226009; -0.0657141; 0.0971462] </params>
|
||||||
|
</camera_model>
|
||||||
|
<pose />
|
||||||
|
</camera>
|
||||||
|
<camera>
|
||||||
|
<camera_model name="MotionTracking" index="0" type="calibu_fu_fv_u0_v0_k1_k2_k3">
|
||||||
|
<rolling_shutter_readout_time>0.032</rolling_shutter_readout_time>
|
||||||
|
<rolling_shutter_direction>vertical</rolling_shutter_direction>
|
||||||
|
<width>640</width>
|
||||||
|
<height>480</height>
|
||||||
|
<params> [478.818; 478.745; 320.398; 241.369; 0.0226009; -0.0657141; 0.0971462] </params>
|
||||||
|
</camera_model>
|
||||||
|
<pose />
|
||||||
|
</camera>
|
||||||
|
|
||||||
|
<intrinsic_imu_calibration name="" imu_id="100" type="linear_imu_sg_mg_sa_ma_gqa">
|
||||||
|
<b_w_b_a> [-3.07369782e-04; 4.28678044e-04; 9.12135974e-05; -1.85969238e-02; 2.03411118e-01; 5.32338456e-02] </b_w_b_a>
|
||||||
|
<intrinsics> [1.010190509929088; 0.99952874560230054; 0.99875073981115248; 0.00020295094237530545; -0.0010146324225753722; -0.0015288737491827727; 1.0037397346218304; 0.9998363203309959; 1.0086648122514161; -2.7183776773623861e-05; -0.011104403267733234; 0.0017284620688527564; 9.30533440e-04; 4.04378542e-03; -2.00236441e-03; 9.99989386e-01] </intrinsics>
|
||||||
|
<gyro_noise_sigma>0.00053088400000000002</gyro_noise_sigma>
|
||||||
|
<gyro_bias_sigma>0.000141254</gyro_bias_sigma>
|
||||||
|
<accel_noise_sigma>0.0048836499999999998</accel_noise_sigma>
|
||||||
|
<accel_bias_sigma>0.012589299999999999</accel_bias_sigma>
|
||||||
|
</intrinsic_imu_calibration>
|
||||||
|
|
||||||
|
<extrinsic_calibration name="Device_T_OpenGl" index="0" frame_A_id="40" frame_B_id="42">
|
||||||
|
<A_T_B> [0, 1, 0, 0; -1, 0, 0, 0; 0, 0, 1, 0] </A_T_B>
|
||||||
|
</extrinsic_calibration>
|
||||||
|
<extrinsic_calibration name="Imu_T_Device" index="0" frame_A_id="100" frame_B_id="40">
|
||||||
|
<A_T_B> [0, -1, 0, 0; 1, 0, 0, 0; 0, 0, 1, 0] </A_T_B>
|
||||||
|
</extrinsic_calibration>
|
||||||
|
<extrinsic_calibration name="Imu_T_3" index="0" frame_A_id="100" frame_B_id="3">
|
||||||
|
<A_q_B> [-0.99996425050397042; 0.00011372; -0.00485282; 0.00692351] </A_q_B>
|
||||||
|
<A_p_B> [-0.008424721099186037; 0.007710053076859457; -0.006284916910266555] </A_p_B>
|
||||||
|
</extrinsic_calibration>
|
||||||
|
<extrinsic_calibration name="Imu_T_Narrow" index="0" frame_A_id="100" frame_B_id="1">
|
||||||
|
<A_q_B> [-0.99996425050397042; 0.00011372; -0.00485282; 0.00692351] </A_q_B>
|
||||||
|
<A_p_B> [-0.008424721099186037; 0.007710053076859457; -0.006284916910266555] </A_p_B>
|
||||||
|
</extrinsic_calibration>
|
||||||
|
<extrinsic_calibration name="Imu_T_MotionTracking" index="0" frame_A_id="100" frame_B_id="0">
|
||||||
|
<A_q_B> [-0.99996425050397042; 0.00011372; -0.00485282; 0.00692351] </A_q_B>
|
||||||
|
<A_p_B> [-0.008424721099186037; 0.007710053076859457; -0.006284916910266555] </A_p_B>
|
||||||
|
</extrinsic_calibration>
|
||||||
|
</rig>
|
||||||
@@ -98,6 +98,9 @@ special_mode_mask values:
|
|||||||
<A3Preview>mot_s5k3l8_bear_zsl_preview_3a</A3Preview>
|
<A3Preview>mot_s5k3l8_bear_zsl_preview_3a</A3Preview>
|
||||||
<A3Video>mot_s5k3l8_bear_zsl_video_3a</A3Video>
|
<A3Video>mot_s5k3l8_bear_zsl_video_3a</A3Video>
|
||||||
</ChromatixName>
|
</ChromatixName>
|
||||||
|
<ChromatixName sensor_resolution_index="0" special_mode_mask="ZOOM_DOWNSCALE">
|
||||||
|
<CPPSnapshot>mot_s5k3l8_bear_cpp_snapshot_downscale</CPPSnapshot>
|
||||||
|
</ChromatixName>
|
||||||
<ChromatixName sensor_resolution_index="1" special_mode_mask="0">
|
<ChromatixName sensor_resolution_index="1" special_mode_mask="0">
|
||||||
<ISPPreview>mot_s5k3l8_bear_preview</ISPPreview>
|
<ISPPreview>mot_s5k3l8_bear_preview</ISPPreview>
|
||||||
<ISPSnapshot>mot_s5k3l8_bear_preview</ISPSnapshot>
|
<ISPSnapshot>mot_s5k3l8_bear_preview</ISPSnapshot>
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ special_mode_mask values:
|
|||||||
<A3Preview>mot_s5k3l8_mono_zsl_preview_3a</A3Preview>
|
<A3Preview>mot_s5k3l8_mono_zsl_preview_3a</A3Preview>
|
||||||
<A3Video>mot_s5k3l8_mono_zsl_video_3a</A3Video>
|
<A3Video>mot_s5k3l8_mono_zsl_video_3a</A3Video>
|
||||||
</ChromatixName>
|
</ChromatixName>
|
||||||
|
<ChromatixName sensor_resolution_index="0" special_mode_mask="ZOOM_DOWNSCALE">
|
||||||
|
<CPPSnapshot>mot_s5k3l8_mono_cpp_snapshot_downscale</CPPSnapshot>
|
||||||
|
</ChromatixName>
|
||||||
<ChromatixName sensor_resolution_index="1" special_mode_mask="0">
|
<ChromatixName sensor_resolution_index="1" special_mode_mask="0">
|
||||||
<ISPPreview>mot_s5k3l8_mono_preview</ISPPreview>
|
<ISPPreview>mot_s5k3l8_mono_preview</ISPPreview>
|
||||||
<ISPSnapshot>mot_s5k3l8_mono_preview</ISPSnapshot>
|
<ISPSnapshot>mot_s5k3l8_mono_preview</ISPSnapshot>
|
||||||
|
|||||||
@@ -1,14 +1,30 @@
|
|||||||
#!/sbin/sh
|
#!/sbin/sh
|
||||||
|
|
||||||
|
# 1802 - Brazil
|
||||||
|
# 1803 - Europe
|
||||||
|
# 1804 - India
|
||||||
|
# 1805 - Europe
|
||||||
|
# 1806 - USA
|
||||||
|
|
||||||
sku=`getprop ro.boot.hardware.sku`
|
sku=`getprop ro.boot.hardware.sku`
|
||||||
|
|
||||||
if [ "$sku" = "XT1687" ]; then
|
if [ "$sku" = "XT1806" ]; then
|
||||||
# XT1687 doesn't have NFC chip
|
# XT1806 doesn't have NFC chip
|
||||||
rm /system/etc/permissions/android.hardware.nfc.xml
|
rm /system/vendor/etc/permissions/android.hardware.nfc.xml
|
||||||
rm /system/etc/permissions/android.hardware.nfc.hce.xml
|
rm /system/vendor/etc/permissions/android.hardware.nfc.hce.xml
|
||||||
rm /system/etc/permissions/com.android.nfc_extras.xml
|
rm /system/vendor/etc/permissions/com.android.nfc_extras.xml
|
||||||
rm -r /system/app/NfcNci
|
rm -r /system/app/NfcNci
|
||||||
else
|
|
||||||
# Only XT1687 variant got a compass
|
|
||||||
rm /system/etc/permissions/android.hardware.sensor.compass.xml
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! [ "$sku" = "XT1802" ]; then
|
||||||
|
# Others variants doesn't have DTV support
|
||||||
|
rm /system/vendor/etc/permissions/com.motorola.hardware.dtv.xml
|
||||||
|
rm /system/vendor/etc/permissions/mot_dtv_permissions.xml
|
||||||
|
rm /system/vendor/lib/libdtvtuner.so
|
||||||
|
rm /system/vendor/lib64/libdtvtuner.so
|
||||||
|
rm /system/vendor/lib/libdtvhal.so
|
||||||
|
rm /system/vendor/lib64/libdtvhal.so
|
||||||
|
rm -r /system/vendor/app/DTVPlayer
|
||||||
|
rm -r /system/vendor/app/DTVService
|
||||||
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,15 @@
|
|||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.graphics.composer</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>2.1</version>
|
||||||
|
<interface>
|
||||||
|
<name>IComposer</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>android.hardware.graphics.mapper</name>
|
<name>android.hardware.graphics.mapper</name>
|
||||||
<transport arch="32+64">passthrough</transport>
|
<transport arch="32+64">passthrough</transport>
|
||||||
@@ -75,7 +84,7 @@
|
|||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>android.hardware.power</name>
|
<name>android.hardware.power</name>
|
||||||
<transport>hwbinder</transport>
|
<transport>hwbinder</transport>
|
||||||
<version>1.1</version>
|
<version>1.0</version>
|
||||||
<interface>
|
<interface>
|
||||||
<name>IPower</name>
|
<name>IPower</name>
|
||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
@@ -177,6 +186,24 @@
|
|||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.display.config</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.1</version>
|
||||||
|
<interface>
|
||||||
|
<name>IDisplayConfig</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.display.color</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IDisplayColor</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>vendor.display.postproc</name>
|
<name>vendor.display.postproc</name>
|
||||||
<transport>hwbinder</transport>
|
<transport>hwbinder</transport>
|
||||||
@@ -187,6 +214,15 @@
|
|||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.qti.hardware.qdutils_disp</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IQdutilsDisp</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>android.hardware.bluetooth</name>
|
<name>android.hardware.bluetooth</name>
|
||||||
<transport>hwbinder</transport>
|
<transport>hwbinder</transport>
|
||||||
@@ -328,15 +364,6 @@
|
|||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
<hal format="hidl">
|
|
||||||
<name>android.hardware.usb</name>
|
|
||||||
<transport>hwbinder</transport>
|
|
||||||
<version>1.0</version>
|
|
||||||
<interface>
|
|
||||||
<name>IUsb</name>
|
|
||||||
<instance>default</instance>
|
|
||||||
</interface>
|
|
||||||
</hal>
|
|
||||||
<hal format="hidl">
|
<hal format="hidl">
|
||||||
<name>android.hardware.vibrator</name>
|
<name>android.hardware.vibrator</name>
|
||||||
<transport>hwbinder</transport>
|
<transport>hwbinder</transport>
|
||||||
@@ -365,5 +392,76 @@
|
|||||||
<instance>default</instance>
|
<instance>default</instance>
|
||||||
</interface>
|
</interface>
|
||||||
</hal>
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.configstore</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>ISurfaceFlingerConfigs</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.qti.hardware.alarm</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IAlarm</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>com.qualcomm.qti.imscmservice</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IImsCmService</name>
|
||||||
|
<instance>qti.ims.connectionmanagerservice</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>vendor.qti.imsrtpservice</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IRTPService</name>
|
||||||
|
<instance>imsrtpservice</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.health</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IHealth</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.sensors</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>ISensors</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.camera.provider</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>2.4</version>
|
||||||
|
<interface>
|
||||||
|
<name>ICameraProvider</name>
|
||||||
|
<instance>legacy/0</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
|
<hal format="hidl">
|
||||||
|
<name>android.hardware.memtrack</name>
|
||||||
|
<transport>hwbinder</transport>
|
||||||
|
<version>1.0</version>
|
||||||
|
<interface>
|
||||||
|
<name>IMemtrack</name>
|
||||||
|
<instance>default</instance>
|
||||||
|
</interface>
|
||||||
|
</hal>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<Limit name="blocks-per-second" min="1" max="972000" />
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
<Limit name="bitrate" range="1-100000000" />
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
<Feature name="adaptive-playback" />
|
<Feature name="adaptive-playback" />
|
||||||
<Limit name="concurrent-instances" max="13" />
|
<Limit name="concurrent-instances" max="16" />
|
||||||
</MediaCodec>
|
</MediaCodec>
|
||||||
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
|
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
|
||||||
<Quirk name="requires-allocate-on-input-ports" />
|
<Quirk name="requires-allocate-on-input-ports" />
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
<Limit name="blocks-per-second" min="1" max="972000" />
|
<Limit name="blocks-per-second" min="1" max="972000" />
|
||||||
<Limit name="bitrate" range="1-100000000" />
|
<Limit name="bitrate" range="1-100000000" />
|
||||||
<Feature name="adaptive-playback" />
|
<Feature name="adaptive-playback" />
|
||||||
<Limit name="concurrent-instances" max="13" />
|
<Limit name="concurrent-instances" max="16" />
|
||||||
</MediaCodec>
|
</MediaCodec>
|
||||||
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
|
<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-input-ports" />
|
||||||
@@ -170,8 +170,6 @@
|
|||||||
<Feature name="adaptive-playback" />
|
<Feature name="adaptive-playback" />
|
||||||
<Limit name="concurrent-instances" max="16" />
|
<Limit name="concurrent-instances" max="16" />
|
||||||
</MediaCodec>
|
</MediaCodec>
|
||||||
<!-- Audio Software -->
|
|
||||||
<MediaCodec name="OMX.qti.audio.decoder.flac" type="audio/flac" />
|
|
||||||
</Decoders>
|
</Decoders>
|
||||||
<Include href="media_codecs_google_video.xml" />
|
<Include href="media_codecs_google_video.xml" />
|
||||||
</MediaCodecs>
|
</MediaCodecs>
|
||||||
|
|||||||
@@ -38,6 +38,11 @@
|
|||||||
<Limit name="measured-frame-rate-1280x720" range="33-33" />
|
<Limit name="measured-frame-rate-1280x720" range="33-33" />
|
||||||
<Limit name="measured-frame-rate-1920x1080" range="19-19" />
|
<Limit name="measured-frame-rate-1920x1080" range="19-19" />
|
||||||
</MediaCodec>
|
</MediaCodec>
|
||||||
|
<MediaCodec name="OMX.google.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="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
|
<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-320x240" range="282-285" />
|
||||||
<Limit name="measured-frame-rate-720x480" range="83-83" />
|
<Limit name="measured-frame-rate-720x480" range="83-83" />
|
||||||
|
|||||||
428
configs/media_profiles_V1_0.xml
Normal file
428
configs/media_profiles_V1_0.xml
Normal file
@@ -0,0 +1,428 @@
|
|||||||
|
<?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) #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>
|
||||||
|
<!ELEMENT VideoEditorCap EMPTY>
|
||||||
|
<!ATTLIST VideoEditorCap maxInputFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxInputFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxOutputFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxOutputFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxPrefetchYUVFrames CDATA #REQUIRED>
|
||||||
|
<!ELEMENT ExportVideoProfile EMPTY>
|
||||||
|
<!ATTLIST ExportVideoProfile name (h264|h263|m4v) #REQUIRED>
|
||||||
|
<!ATTLIST ExportVideoProfile profile CDATA #REQUIRED>
|
||||||
|
<!ATTLIST ExportVideoProfile level CDATA #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="m4v"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="15" />
|
||||||
|
<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="m4v"
|
||||||
|
bitRate="128000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="15" />
|
||||||
|
<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="1" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="heaac" enabled="true"
|
||||||
|
minBitRate="8000" maxBitRate="64000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="aaceld" enabled="true"
|
||||||
|
minBitRate="16000" maxBitRate="192000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<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"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The VideoEditor Capability configuration:
|
||||||
|
- maxInputFrameWidth: maximum video width of imported video clip.
|
||||||
|
- maxInputFrameHeight: maximum video height of imported video clip.
|
||||||
|
- maxOutputFrameWidth: maximum video width of exported video clip.
|
||||||
|
- maxOutputFrameHeight: maximum video height of exported video clip.
|
||||||
|
- maxPrefetchYUVFrames: maximum prefetch YUV frames for encoder,
|
||||||
|
used to limit the amount of memory for prefetched YUV frames.
|
||||||
|
For this platform, it allows maximum 30MB(3MB per 1080p frame x 10
|
||||||
|
frames) memory.
|
||||||
|
-->
|
||||||
|
<VideoEditorCap maxInputFrameWidth="1920"
|
||||||
|
maxInputFrameHeight="1080" maxOutputFrameWidth="1920"
|
||||||
|
maxOutputFrameHeight="1080" maxPrefetchYUVFrames="10"/>
|
||||||
|
<!--
|
||||||
|
The VideoEditor Export codec profile and level values
|
||||||
|
correspond to the values in OMX_Video.h.
|
||||||
|
E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
|
||||||
|
and level 4096 means OMX_VIDEO_AVCLevel41.
|
||||||
|
Please note that the values are in decimal.
|
||||||
|
These values are for video encoder.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Codec = h.264, Baseline profile, level 4.0
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="h264" profile= "1" level="2048"/>
|
||||||
|
<!--
|
||||||
|
Codec = h.263, Baseline profile, level 70
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="h263" profile= "1" level="128"/>
|
||||||
|
<!--
|
||||||
|
Codec = mpeg4, Simple profile, level 5
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="m4v" profile= "1" level="128"/>
|
||||||
|
</MediaSettings>
|
||||||
796
configs/media_profiles_vendor.xml
Normal file
796
configs/media_profiles_vendor.xml
Normal file
@@ -0,0 +1,796 @@
|
|||||||
|
<?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.
|
||||||
|
-->
|
||||||
|
<!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) #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|lpcm) #REQUIRED>
|
||||||
|
<!ATTLIST Audio bitRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Audio sampleRate CDATA #REQUIRED>
|
||||||
|
<!ATTLIST Audio channels (1|2|6) #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>
|
||||||
|
<!ATTLIST VideoEncoderCap maxHFRFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxHFRFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEncoderCap maxHFRMode CDATA #REQUIRED>
|
||||||
|
<!ELEMENT AudioEncoderCap EMPTY>
|
||||||
|
<!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma|lpcm) #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|6) #REQUIRED>
|
||||||
|
<!ATTLIST AudioEncoderCap maxChannels (1|2|6) #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>
|
||||||
|
<!ELEMENT VideoEditorCap EMPTY>
|
||||||
|
<!ATTLIST VideoEditorCap maxInputFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxInputFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxOutputFrameWidth CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxOutputFrameHeight CDATA #REQUIRED>
|
||||||
|
<!ATTLIST VideoEditorCap maxPrefetchYUVFrames CDATA #REQUIRED>
|
||||||
|
<!ELEMENT ExportVideoProfile EMPTY>
|
||||||
|
<!ATTLIST ExportVideoProfile name (h264|h263|m4v) #REQUIRED>
|
||||||
|
<!ATTLIST ExportVideoProfile profile CDATA #REQUIRED>
|
||||||
|
<!ATTLIST ExportVideoProfile level CDATA #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 -->
|
||||||
|
<!-- Back Camera -->
|
||||||
|
<CamcorderProfiles cameraId="0">
|
||||||
|
|
||||||
|
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="3840"
|
||||||
|
height="2160"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="512000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="720000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="14000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="qhd" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="2560"
|
||||||
|
height="1440"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="2k" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="2048"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="2160p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="3840"
|
||||||
|
height="2160"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="qcif" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="vga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="640"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapselow" 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="timelapsehigh" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="3840"
|
||||||
|
height="2160"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</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="720000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="512000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsevga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="640"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="640"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="14000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapseqhd" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="2560"
|
||||||
|
height="1440"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse2k" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="2048"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse2160p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="42000000"
|
||||||
|
width="3840"
|
||||||
|
height="2160"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<ImageEncoding quality="95" />
|
||||||
|
<ImageEncoding quality="80" />
|
||||||
|
<ImageEncoding quality="70" />
|
||||||
|
<ImageDecoding memCap="20000000" />
|
||||||
|
|
||||||
|
</CamcorderProfiles>
|
||||||
|
<!-- Front Camera -->
|
||||||
|
<CamcorderProfiles cameraId="1">
|
||||||
|
|
||||||
|
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="512000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="cif" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="720000"
|
||||||
|
width="352"
|
||||||
|
height="288"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="720"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="14000000"
|
||||||
|
width="1280"
|
||||||
|
height="720"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="qcif" fileFormat="3gp" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="192000"
|
||||||
|
width="176"
|
||||||
|
height="144"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="vga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="640"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapselow" 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="timelapsehigh" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</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="timelapseqvga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="512000"
|
||||||
|
width="320"
|
||||||
|
height="240"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapsevga" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="2000000"
|
||||||
|
width="640"
|
||||||
|
height="480"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="amrnb"
|
||||||
|
bitRate="12200"
|
||||||
|
sampleRate="8000"
|
||||||
|
channels="1" />
|
||||||
|
</EncoderProfile>
|
||||||
|
|
||||||
|
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||||
|
<Video codec="h264"
|
||||||
|
bitRate="5000000"
|
||||||
|
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="8000000"
|
||||||
|
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="20000000"
|
||||||
|
width="1920"
|
||||||
|
height="1080"
|
||||||
|
frameRate="30" />
|
||||||
|
|
||||||
|
<!-- audio setting is ignored -->
|
||||||
|
<Audio codec="aac"
|
||||||
|
bitRate="156000"
|
||||||
|
sampleRate="48000"
|
||||||
|
channels="2" />
|
||||||
|
</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="100000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="3840"
|
||||||
|
minFrameHeight="144" maxFrameHeight="2160"
|
||||||
|
minFrameRate="15" maxFrameRate="30"
|
||||||
|
maxHFRFrameWidth="1920" maxHFRFrameHeight="1080"
|
||||||
|
maxHFRMode="60" />
|
||||||
|
|
||||||
|
<VideoEncoderCap name="h263" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="2000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="800"
|
||||||
|
minFrameHeight="144" maxFrameHeight="480"
|
||||||
|
minFrameRate="15" maxFrameRate="30"
|
||||||
|
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||||
|
maxHFRMode="0" />
|
||||||
|
|
||||||
|
<VideoEncoderCap name="m4v" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="40000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="1920"
|
||||||
|
minFrameHeight="144" maxFrameHeight="1088"
|
||||||
|
minFrameRate="15" maxFrameRate="30"
|
||||||
|
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||||
|
maxHFRMode="0" />
|
||||||
|
|
||||||
|
<VideoEncoderCap name="hevc" enabled="true"
|
||||||
|
minBitRate="64000" maxBitRate="100000000"
|
||||||
|
minFrameWidth="176" maxFrameWidth="3840"
|
||||||
|
minFrameHeight="144" maxFrameHeight="2160"
|
||||||
|
minFrameRate="15" maxFrameRate="30"
|
||||||
|
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||||
|
maxHFRMode="0" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="aac" enabled="true"
|
||||||
|
minBitRate="8000" maxBitRate="96000"
|
||||||
|
minSampleRate="8000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="6" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="heaac" enabled="true"
|
||||||
|
minBitRate="8000" maxBitRate="64000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="aaceld" enabled="true"
|
||||||
|
minBitRate="16000" maxBitRate="192000"
|
||||||
|
minSampleRate="16000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="1" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="amrwb" enabled="true"
|
||||||
|
minBitRate="6600" maxBitRate="23850"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<AudioEncoderCap name="lpcm" enabled="true"
|
||||||
|
minBitRate="768000" maxBitRate="4608000"
|
||||||
|
minSampleRate="48000" maxSampleRate="48000"
|
||||||
|
minChannels="1" maxChannels="6" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
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="true"/>
|
||||||
|
<AudioDecoderCap name="wma" enabled="true"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The VideoEditor Capability configuration:
|
||||||
|
- maxInputFrameWidth: maximum video width of imported video clip.
|
||||||
|
- maxInputFrameHeight: maximum video height of imported video clip.
|
||||||
|
- maxOutputFrameWidth: maximum video width of exported video clip.
|
||||||
|
- maxOutputFrameHeight: maximum video height of exported video clip.
|
||||||
|
- maxPrefetchYUVFrames: maximum prefetch YUV frames for encoder,
|
||||||
|
used to limit the amount of memory for prefetched YUV frames.
|
||||||
|
For this platform, it allows maximum 30MB(3MB per 1080p frame x 10
|
||||||
|
frames) memory.
|
||||||
|
-->
|
||||||
|
<VideoEditorCap maxInputFrameWidth="1280"
|
||||||
|
maxInputFrameHeight="720" maxOutputFrameWidth="1280"
|
||||||
|
maxOutputFrameHeight="720" maxPrefetchYUVFrames="10"/>
|
||||||
|
<!--
|
||||||
|
The VideoEditor Export codec profile and level values
|
||||||
|
correspond to the values in OMX_Video.h.
|
||||||
|
E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
|
||||||
|
and level 4096 means OMX_VIDEO_AVCLevel41.
|
||||||
|
Please note that the values are in decimal.
|
||||||
|
These values are for video encoder.
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Codec = h.264, Baseline profile, level 4.0
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="h264" profile= "1" level="2048"/>
|
||||||
|
<!--
|
||||||
|
Codec = h.263, Baseline profile, level 70
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="h263" profile= "1" level="128"/>
|
||||||
|
<!--
|
||||||
|
Codec = mpeg4, Simple profile, level 5
|
||||||
|
-->
|
||||||
|
<ExportVideoProfile name="m4v" profile= "1" level="128"/>
|
||||||
|
</MediaSettings>
|
||||||
19
configs/privapp-permissions-oem.xml
Normal file
19
configs/privapp-permissions-oem.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<permissions>
|
||||||
|
<privapp-permissions package="com.qti.dpmserviceapp">
|
||||||
|
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||||
|
</privapp-permissions>
|
||||||
|
|
||||||
|
<privapp-permissions package="com.qualcomm.location">
|
||||||
|
<permission name="android.permission.CONTROL_LOCATION_UPDATES"/>
|
||||||
|
</privapp-permissions>
|
||||||
|
|
||||||
|
<privapp-permissions package="com.qualcomm.qcrilmsgtunnel">
|
||||||
|
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||||
|
</privapp-permissions>
|
||||||
|
|
||||||
|
<privapp-permissions package="com.quicinc.cne.CNEService">
|
||||||
|
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
|
||||||
|
<permission name="android.permission.PACKET_KEEPALIVE_OFFLOAD"/>
|
||||||
|
</privapp-permissions>
|
||||||
|
</permissions>
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
45
configs/qti_whitelist.xml
Normal file
45
configs/qti_whitelist.xml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above
|
||||||
|
* copyright notice, this list of conditions and the following
|
||||||
|
* disclaimer in the documentation and/or other materials provided
|
||||||
|
* with the distribution.
|
||||||
|
* * Neither the name of The Linux Foundation nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||||
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||||
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||||
|
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
|
<config>
|
||||||
|
<!-- These are telephony components that need to freely run in the background -->
|
||||||
|
<allow-in-power-save package="com.qualcomm.atfwd" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.telephonyservice" />
|
||||||
|
<allow-in-power-save package="com.qulacomm.qcrilmsgtunnel" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.ims" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.radioconfiginterface" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.simcontacts" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.autoregistration" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.server.wigigapp" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.StatsPollManager" />
|
||||||
|
<allow-in-power-save package="com.qualcomm.qti.gsma.services.nfc" />
|
||||||
|
</config>
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (C) 2016 The CyanogenMod Project
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
include $(call first-makefiles-under,$(LOCAL_PATH))
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
ACLOCAL_AMFLAGS = -I m4
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
|
||||||
SUBDIRS = ipanat/src ipacm/src/
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
# -*- Autoconf -*-
|
|
||||||
# Process this file with autoconf to produce a configure script.
|
|
||||||
|
|
||||||
AC_PREREQ([2.65])
|
|
||||||
AC_INIT(data-ipa, 1.0.0)
|
|
||||||
AM_INIT_AUTOMAKE(data-ipa, 1.0.0)
|
|
||||||
AC_OUTPUT(Makefile ipanat/src/Makefile ipacm/src/Makefile)
|
|
||||||
AC_CONFIG_SRCDIR([ipanat/src/ipa_nat_drv.c])
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
|
|
||||||
# Checks for programs.
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
AC_PROG_CXX
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
|
|
||||||
AC_SUBST([LIBXML_CFLAGS])
|
|
||||||
AC_SUBST([LIBXML_LIBS])
|
|
||||||
|
|
||||||
# Checks for libraries.
|
|
||||||
|
|
||||||
AC_ARG_WITH(sanitized-headers,
|
|
||||||
AS_HELP_STRING([--with-sanitized-headers=DIR],
|
|
||||||
[Specify the location of the sanitized Linux headers]),
|
|
||||||
[CPPFLAGS="$CPPFLAGS -idirafter $withval"])
|
|
||||||
|
|
||||||
AC_ARG_WITH([glib],
|
|
||||||
AC_HELP_STRING([--with-glib],
|
|
||||||
[enable glib, building HLOS systems which use glib]))
|
|
||||||
|
|
||||||
if (test "x${with_glib}" = "xyes"); then
|
|
||||||
AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
|
|
||||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
|
|
||||||
AC_MSG_ERROR(GThread >= 2.16 is required))
|
|
||||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
|
|
||||||
AC_MSG_ERROR(GLib >= 2.16 is required))
|
|
||||||
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
|
|
||||||
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
|
|
||||||
AC_SUBST(GLIB_CFLAGS)
|
|
||||||
AC_SUBST(GLIB_LIBS)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
|
|
||||||
|
|
||||||
# Checks for header files.
|
|
||||||
AC_CHECK_HEADERS([fcntl.h netinet/in.h sys/ioctl.h unistd.h])
|
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
|
||||||
AC_TYPE_OFF_T
|
|
||||||
|
|
||||||
# Checks for library functions.
|
|
||||||
AC_FUNC_MALLOC
|
|
||||||
AC_FUNC_MMAP
|
|
||||||
AC_CHECK_FUNCS([memset munmap])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_CmdQueue.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the IPAM Comment Queue definitions
|
|
||||||
|
|
||||||
@Author
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPA_CONNTRACK_MESSAGE_H
|
|
||||||
#define IPA_CONNTRACK_MESSAGE_H
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------
|
|
||||||
Event data required by IPA_CM
|
|
||||||
---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _ipacm_cmd_q_data {
|
|
||||||
ipa_cm_event_id event;
|
|
||||||
void *evt_data;
|
|
||||||
}ipacm_cmd_q_data;
|
|
||||||
|
|
||||||
typedef struct cmd_s
|
|
||||||
{
|
|
||||||
void (*callback_ptr)(ipacm_cmd_q_data *);
|
|
||||||
ipacm_cmd_q_data data;
|
|
||||||
}cmd_t;
|
|
||||||
|
|
||||||
class Message
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Message *m_next;
|
|
||||||
|
|
||||||
public:
|
|
||||||
cmd_t evt;
|
|
||||||
|
|
||||||
Message()
|
|
||||||
{
|
|
||||||
m_next = NULL;
|
|
||||||
evt.callback_ptr = NULL;
|
|
||||||
}
|
|
||||||
~Message() { }
|
|
||||||
void setnext(Message *item) { m_next = item; }
|
|
||||||
Message* getnext() { return m_next; }
|
|
||||||
};
|
|
||||||
|
|
||||||
class MessageQueue
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
Message *Head;
|
|
||||||
Message *Tail;
|
|
||||||
Message* dequeue(void);
|
|
||||||
static MessageQueue *inst_internal;
|
|
||||||
static MessageQueue *inst_external;
|
|
||||||
|
|
||||||
MessageQueue()
|
|
||||||
{
|
|
||||||
Head = NULL;
|
|
||||||
Tail = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
~MessageQueue() { }
|
|
||||||
void enqueue(Message *item);
|
|
||||||
|
|
||||||
static void* Process(void *);
|
|
||||||
static MessageQueue* getInstanceInternal();
|
|
||||||
static MessageQueue* getInstanceExternal();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPA_CONNTRACK_MESSAGE_H */
|
|
||||||
|
|
||||||
@@ -1,357 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_Config.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the IPACM Configuration from XML file
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_CONFIG_H
|
|
||||||
#define IPACM_CONFIG_H
|
|
||||||
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
#include "IPACM_Xml.h"
|
|
||||||
#include "IPACM_EvtDispatcher.h"
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
char iface_name[IPA_IFACE_NAME_LEN];
|
|
||||||
}NatIfaces;
|
|
||||||
|
|
||||||
/* for IPACM rm dependency use*/
|
|
||||||
typedef struct _ipa_rm_client
|
|
||||||
{
|
|
||||||
ipa_rm_resource_name producer_rm1;
|
|
||||||
ipa_rm_resource_name consumer_rm1;
|
|
||||||
ipa_rm_resource_name producer_rm2;
|
|
||||||
ipa_rm_resource_name consumer_rm2;
|
|
||||||
bool producer1_up; /* only monitor producer_rm1, not monitor producer_rm2 */
|
|
||||||
bool consumer1_up; /* only monitor consumer_rm1, not monitor consumer_rm2 */
|
|
||||||
bool rm_set; /* once producer1_up and consumer1_up, will add bi-directional dependency */
|
|
||||||
bool rx_bypass_ipa; /* support WLAN may not register RX-property, should not add dependency */
|
|
||||||
}ipa_rm_client;
|
|
||||||
|
|
||||||
#define MAX_NUM_EXT_PROPS 25
|
|
||||||
|
|
||||||
/* used to hold extended properties */
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t num_ext_props;
|
|
||||||
ipa_ioc_ext_intf_prop prop[MAX_NUM_EXT_PROPS];
|
|
||||||
} ipacm_ext_prop;
|
|
||||||
|
|
||||||
/* iface */
|
|
||||||
class IPACM_Config
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/* IPACM ipa_client map to rm_resource*/
|
|
||||||
ipa_rm_resource_name ipa_client_rm_map_tbl[IPA_CLIENT_MAX];
|
|
||||||
|
|
||||||
/* IPACM monitored rm_depency table */
|
|
||||||
ipa_rm_client ipa_rm_tbl[IPA_MAX_RM_ENTRY];
|
|
||||||
|
|
||||||
/* IPACM rm_depency a2 endpoint check*/
|
|
||||||
int ipa_rm_a2_check;
|
|
||||||
|
|
||||||
/* Store interested interface and their configuration from XML file */
|
|
||||||
ipa_ifi_dev_name_t *iface_table;
|
|
||||||
|
|
||||||
/* Store interested ALG port from XML file */
|
|
||||||
ipacm_alg *alg_table;
|
|
||||||
|
|
||||||
/* Store private subnet configuration from XML file */
|
|
||||||
ipa_private_subnet private_subnet_table[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
|
|
||||||
|
|
||||||
/* Store the non nat iface names */
|
|
||||||
NatIfaces *pNatIfaces;
|
|
||||||
|
|
||||||
/* Store the bridge iface names */
|
|
||||||
char ipa_virtual_iface_name[IPA_IFACE_NAME_LEN];
|
|
||||||
|
|
||||||
/* Store the number of interface IPACM read from XML file */
|
|
||||||
int ipa_num_ipa_interfaces;
|
|
||||||
|
|
||||||
int ipa_num_private_subnet;
|
|
||||||
|
|
||||||
int ipa_num_alg_ports;
|
|
||||||
|
|
||||||
int ipa_nat_max_entries;
|
|
||||||
|
|
||||||
bool ipacm_odu_router_mode;
|
|
||||||
|
|
||||||
bool ipacm_odu_enable;
|
|
||||||
|
|
||||||
bool ipacm_odu_embms_enable;
|
|
||||||
|
|
||||||
bool ipacm_ip_passthrough_mode;
|
|
||||||
|
|
||||||
int ipa_nat_iface_entries;
|
|
||||||
|
|
||||||
/* Store the total number of wlan guest ap configured */
|
|
||||||
int ipa_num_wlan_guest_ap;
|
|
||||||
|
|
||||||
/* Max valid rm entry */
|
|
||||||
int ipa_max_valid_rm_entry;
|
|
||||||
|
|
||||||
/* Store SW-enable or not */
|
|
||||||
bool ipa_sw_rt_enable;
|
|
||||||
|
|
||||||
/* Store bridge mode or not */
|
|
||||||
bool ipa_bridge_enable;
|
|
||||||
|
|
||||||
/* Store bridge netdev mac */
|
|
||||||
uint8_t bridge_mac[IPA_MAC_ADDR_SIZE];
|
|
||||||
|
|
||||||
/* Store the flt rule count for each producer client*/
|
|
||||||
int flt_rule_count_v4[IPA_CLIENT_CONS - IPA_CLIENT_PROD];
|
|
||||||
int flt_rule_count_v6[IPA_CLIENT_CONS - IPA_CLIENT_PROD];
|
|
||||||
|
|
||||||
/* IPACM routing table name for v4/v6 */
|
|
||||||
struct ipa_ioc_get_rt_tbl rt_tbl_lan_v4, rt_tbl_wan_v4, rt_tbl_default_v4, rt_tbl_v6, rt_tbl_wan_v6;
|
|
||||||
struct ipa_ioc_get_rt_tbl rt_tbl_wan_dl;
|
|
||||||
struct ipa_ioc_get_rt_tbl rt_tbl_odu_v4, rt_tbl_odu_v6;
|
|
||||||
|
|
||||||
bool isMCC_Mode;
|
|
||||||
|
|
||||||
/* To return the instance */
|
|
||||||
static IPACM_Config* GetInstance();
|
|
||||||
|
|
||||||
const char* getEventName(ipa_cm_event_id event_id);
|
|
||||||
|
|
||||||
inline void increaseFltRuleCount(int index, ipa_ip_type iptype, int increment)
|
|
||||||
{
|
|
||||||
if((index >= IPA_CLIENT_CONS - IPA_CLIENT_PROD) || (index < 0))
|
|
||||||
{
|
|
||||||
IPACMERR("Index is out of range: %d.\n", index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(iptype == IPA_IP_v4)
|
|
||||||
{
|
|
||||||
flt_rule_count_v4[index] += increment;
|
|
||||||
IPACMDBG_H("Now num of v4 flt rules on client %d is %d.\n", index, flt_rule_count_v4[index]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flt_rule_count_v6[index] += increment;
|
|
||||||
IPACMDBG_H("Now num of v6 flt rules on client %d is %d.\n", index, flt_rule_count_v6[index]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void decreaseFltRuleCount(int index, ipa_ip_type iptype, int decrement)
|
|
||||||
{
|
|
||||||
if((index >= IPA_CLIENT_CONS - IPA_CLIENT_PROD) || (index < 0))
|
|
||||||
{
|
|
||||||
IPACMERR("Index is out of range: %d.\n", index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(iptype == IPA_IP_v4)
|
|
||||||
{
|
|
||||||
flt_rule_count_v4[index] -= decrement;
|
|
||||||
IPACMDBG_H("Now num of v4 flt rules on client %d is %d.\n", index, flt_rule_count_v4[index]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
flt_rule_count_v6[index] -= decrement;
|
|
||||||
IPACMDBG_H("Now num of v6 flt rules on client %d is %d.\n", index, flt_rule_count_v6[index]);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int getFltRuleCount(int index, ipa_ip_type iptype)
|
|
||||||
{
|
|
||||||
if((index >= IPA_CLIENT_CONS - IPA_CLIENT_PROD) || (index < 0))
|
|
||||||
{
|
|
||||||
IPACMERR("Index is out of range: %d.\n", index);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if(iptype == IPA_IP_v4)
|
|
||||||
{
|
|
||||||
return flt_rule_count_v4[index];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return flt_rule_count_v6[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int GetAlgPortCnt()
|
|
||||||
{
|
|
||||||
return ipa_num_alg_ports;
|
|
||||||
}
|
|
||||||
|
|
||||||
int GetAlgPorts(int nPorts, ipacm_alg *pAlgPorts);
|
|
||||||
|
|
||||||
inline int GetNatMaxEntries(void)
|
|
||||||
{
|
|
||||||
return ipa_nat_max_entries;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int GetNatIfacesCnt()
|
|
||||||
{
|
|
||||||
return ipa_nat_iface_entries;
|
|
||||||
}
|
|
||||||
int GetNatIfaces(int nPorts, NatIfaces *ifaces);
|
|
||||||
|
|
||||||
/* for IPACM resource manager dependency usage */
|
|
||||||
void AddRmDepend(ipa_rm_resource_name rm1,bool rx_bypass_ipa);
|
|
||||||
|
|
||||||
void DelRmDepend(ipa_rm_resource_name rm1);
|
|
||||||
|
|
||||||
int AddNatIfaces(char *dev_name);
|
|
||||||
|
|
||||||
int DelNatIfaces(char *dev_name);
|
|
||||||
|
|
||||||
inline void SetQmapId(uint8_t id)
|
|
||||||
{
|
|
||||||
qmap_id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline uint8_t GetQmapId()
|
|
||||||
{
|
|
||||||
return qmap_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
int SetExtProp(ipa_ioc_query_intf_ext_props *prop);
|
|
||||||
|
|
||||||
ipacm_ext_prop* GetExtProp(ipa_ip_type ip_type);
|
|
||||||
|
|
||||||
int DelExtProp(ipa_ip_type ip_type);
|
|
||||||
|
|
||||||
int Init(void);
|
|
||||||
|
|
||||||
inline bool isPrivateSubnet(uint32_t ip_addr)
|
|
||||||
{
|
|
||||||
for(int cnt=0; cnt<ipa_num_private_subnet; cnt++)
|
|
||||||
{
|
|
||||||
if(private_subnet_table[cnt].subnet_addr ==
|
|
||||||
(private_subnet_table[cnt].subnet_mask & ip_addr))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#ifdef FEATURE_IPA_ANDROID
|
|
||||||
inline bool AddPrivateSubnet(uint32_t ip_addr, int ipa_if_index)
|
|
||||||
{
|
|
||||||
ipacm_cmd_q_data evt_data;
|
|
||||||
ipacm_event_data_fid *data_fid;
|
|
||||||
uint32_t subnet_mask = ~0;
|
|
||||||
for(int cnt=0; cnt<ipa_num_private_subnet; cnt++)
|
|
||||||
{
|
|
||||||
if(private_subnet_table[cnt].subnet_addr == ip_addr)
|
|
||||||
{
|
|
||||||
IPACMDBG("Already has private subnet_addr as: 0x%x in entry(%d) \n", ip_addr, cnt);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ipa_num_private_subnet < IPA_MAX_PRIVATE_SUBNET_ENTRIES)
|
|
||||||
{
|
|
||||||
IPACMDBG("Add IPACM private subnet_addr as: 0x%x in entry(%d) \n", ip_addr, ipa_num_private_subnet);
|
|
||||||
private_subnet_table[ipa_num_private_subnet].subnet_addr = ip_addr;
|
|
||||||
private_subnet_table[ipa_num_private_subnet].subnet_mask = (subnet_mask >> 8) << 8;
|
|
||||||
ipa_num_private_subnet++;
|
|
||||||
|
|
||||||
/* IPACM private subnet set changes */
|
|
||||||
data_fid = (ipacm_event_data_fid *)malloc(sizeof(ipacm_event_data_fid));
|
|
||||||
if(data_fid == NULL)
|
|
||||||
{
|
|
||||||
IPACMERR("unable to allocate memory for event data_fid\n");
|
|
||||||
return IPACM_FAILURE;
|
|
||||||
}
|
|
||||||
data_fid->if_index = ipa_if_index; // already ipa index, not fid index
|
|
||||||
evt_data.event = IPA_PRIVATE_SUBNET_CHANGE_EVENT;
|
|
||||||
evt_data.evt_data = data_fid;
|
|
||||||
|
|
||||||
/* Insert IPA_PRIVATE_SUBNET_CHANGE_EVENT to command queue */
|
|
||||||
IPACM_EvtDispatcher::PostEvt(&evt_data);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
IPACMERR("IPACM private subnet_addr overflow, total entry(%d)\n", ipa_num_private_subnet);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool DelPrivateSubnet(uint32_t ip_addr, int ipa_if_index)
|
|
||||||
{
|
|
||||||
ipacm_cmd_q_data evt_data;
|
|
||||||
ipacm_event_data_fid *data_fid;
|
|
||||||
for(int cnt=0; cnt<ipa_num_private_subnet; cnt++)
|
|
||||||
{
|
|
||||||
if(private_subnet_table[cnt].subnet_addr == ip_addr)
|
|
||||||
{
|
|
||||||
IPACMDBG("Found private subnet_addr as: 0x%x in entry(%d) \n", ip_addr, cnt);
|
|
||||||
for (; cnt < ipa_num_private_subnet - 1; cnt++)
|
|
||||||
{
|
|
||||||
private_subnet_table[cnt].subnet_addr = private_subnet_table[cnt+1].subnet_addr;
|
|
||||||
}
|
|
||||||
ipa_num_private_subnet = ipa_num_private_subnet - 1;
|
|
||||||
|
|
||||||
/* IPACM private subnet set changes */
|
|
||||||
data_fid = (ipacm_event_data_fid *)malloc(sizeof(ipacm_event_data_fid));
|
|
||||||
if(data_fid == NULL)
|
|
||||||
{
|
|
||||||
IPACMERR("unable to allocate memory for event data_fid\n");
|
|
||||||
return IPACM_FAILURE;
|
|
||||||
}
|
|
||||||
data_fid->if_index = ipa_if_index; // already ipa index, not fid index
|
|
||||||
evt_data.event = IPA_PRIVATE_SUBNET_CHANGE_EVENT;
|
|
||||||
evt_data.evt_data = data_fid;
|
|
||||||
|
|
||||||
/* Insert IPA_PRIVATE_SUBNET_CHANGE_EVENT to command queue */
|
|
||||||
IPACM_EvtDispatcher::PostEvt(&evt_data);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IPACMDBG("can't find private subnet_addr as: 0x%x \n", ip_addr);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif /* defined(FEATURE_IPA_ANDROID)*/
|
|
||||||
|
|
||||||
static const char *DEVICE_NAME_ODU;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static IPACM_Config *pInstance;
|
|
||||||
static const char *DEVICE_NAME;
|
|
||||||
IPACM_Config(void);
|
|
||||||
int m_fd; /* File descriptor of the IPA device node /dev/ipa */
|
|
||||||
uint8_t qmap_id;
|
|
||||||
ipacm_ext_prop ext_prop_v4;
|
|
||||||
ipacm_ext_prop ext_prop_v6;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_CONFIG */
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of The Linux Foundation nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IPACM_CONNTRACK_FILTER_H
|
|
||||||
#define IPACM_CONNTRACK_FILTER_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "IPACM_ConntrackClient.h"
|
|
||||||
#include "IPACM_CmdQueue.h"
|
|
||||||
#include "IPACM_Conntrack_NATApp.h"
|
|
||||||
#include "IPACM_EvtDispatcher.h"
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
|
|
||||||
#ifndef IPACM_DEBUG
|
|
||||||
#define IPACM_DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
|
|
||||||
#include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
|
|
||||||
#include <sys/inotify.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define UDP_TIMEOUT_UPDATE 20
|
|
||||||
#define BROADCAST_IPV4_ADDR 0xFFFFFFFF
|
|
||||||
|
|
||||||
class IPACM_ConntrackClient
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
static IPACM_ConntrackClient *pInstance;
|
|
||||||
|
|
||||||
struct nfct_handle *tcp_hdl;
|
|
||||||
struct nfct_handle *udp_hdl;
|
|
||||||
struct nfct_filter *tcp_filter;
|
|
||||||
struct nfct_filter *udp_filter;
|
|
||||||
static int IPA_Conntrack_Filters_Ignore_Local_Addrs(struct nfct_filter *filter);
|
|
||||||
static int IPA_Conntrack_Filters_Ignore_Bridge_Addrs(struct nfct_filter *filter);
|
|
||||||
static int IPA_Conntrack_Filters_Ignore_Local_Iface(struct nfct_filter *, ipacm_event_iface_up *);
|
|
||||||
IPACM_ConntrackClient();
|
|
||||||
|
|
||||||
public:
|
|
||||||
static int IPAConntrackEventCB(enum nf_conntrack_msg_type type,
|
|
||||||
struct nf_conntrack *ct,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
static int IPA_Conntrack_UDP_Filter_Init(void);
|
|
||||||
static int IPA_Conntrack_TCP_Filter_Init(void);
|
|
||||||
static void* TCPRegisterWithConnTrack(void *);
|
|
||||||
static void* UDPRegisterWithConnTrack(void *);
|
|
||||||
static void* UDPConnTimeoutUpdate(void *);
|
|
||||||
|
|
||||||
static void UpdateUDPFilters(void *, bool);
|
|
||||||
static void UpdateTCPFilters(void *, bool);
|
|
||||||
static void Read_TcpUdp_Timeout(char *in, int len);
|
|
||||||
|
|
||||||
static IPACM_ConntrackClient* GetInstance();
|
|
||||||
|
|
||||||
#ifdef IPACM_DEBUG
|
|
||||||
#define iptodot(X,Y) \
|
|
||||||
IPACMLOG(" %s(0x%x): %d.%d.%d.%d\n", X, Y, ((Y>>24) & 0xFF), ((Y>>16) & 0xFF), ((Y>>8) & 0xFF), (Y & 0xFF));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define log_nat(A,B,C,D,E,F) \
|
|
||||||
IPACMDBG_H("protocol %d Private IP: %d.%d.%d.%d\t Target IP: %d.%d.%d.%d\t private port: %d public port: %d %s",A,((B>>24) & 0xFF), ((B>>16) & 0xFF), ((B>>8) & 0xFF), (B & 0xFF), ((C>>24) & 0xFF), ((C>>16) & 0xFF),((C>>8) & 0xFF),(C & 0xFF),D,E,F);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_CONNTRACK_FILTER_H */
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IPACM_CONNTRACK_LISTENER
|
|
||||||
#define IPACM_CONNTRACK_LISTENER
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include "IPACM_CmdQueue.h"
|
|
||||||
#include "IPACM_Conntrack_NATApp.h"
|
|
||||||
#include "IPACM_Listener.h"
|
|
||||||
#ifdef CT_OPT
|
|
||||||
#include "IPACM_LanToLan.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_IFACE_ADDRESS 50
|
|
||||||
#define MAX_STA_CLNT_IFACES 10
|
|
||||||
#define STA_CLNT_SUBNET_MASK 0xFFFFFF00
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
typedef struct _nat_entry_bundle
|
|
||||||
{
|
|
||||||
struct nf_conntrack *ct;
|
|
||||||
enum nf_conntrack_msg_type type;
|
|
||||||
nat_table_entry *rule;
|
|
||||||
bool isTempEntry;
|
|
||||||
|
|
||||||
}nat_entry_bundle;
|
|
||||||
|
|
||||||
class IPACM_ConntrackListener : public IPACM_Listener
|
|
||||||
{
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool isCTReg;
|
|
||||||
bool isNatThreadStart;
|
|
||||||
bool WanUp;
|
|
||||||
NatApp *nat_inst;
|
|
||||||
|
|
||||||
int NatIfaceCnt;
|
|
||||||
int StaClntCnt;
|
|
||||||
NatIfaces *pNatIfaces;
|
|
||||||
uint32_t nat_iface_ipv4_addr[MAX_IFACE_ADDRESS];
|
|
||||||
uint32_t nonnat_iface_ipv4_addr[MAX_IFACE_ADDRESS];
|
|
||||||
uint32_t sta_clnt_ipv4_addr[MAX_STA_CLNT_IFACES];
|
|
||||||
IPACM_Config *pConfig;
|
|
||||||
#ifdef CT_OPT
|
|
||||||
IPACM_LanToLan *p_lan2lan;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void ProcessCTMessage(void *);
|
|
||||||
void ProcessTCPorUDPMsg(struct nf_conntrack *,
|
|
||||||
enum nf_conntrack_msg_type, u_int8_t);
|
|
||||||
void TriggerWANUp(void *);
|
|
||||||
void TriggerWANDown(uint32_t);
|
|
||||||
int CreateNatThreads(void);
|
|
||||||
int CreateConnTrackThreads(void);
|
|
||||||
bool AddIface(nat_table_entry *, bool *);
|
|
||||||
void AddORDeleteNatEntry(const nat_entry_bundle *);
|
|
||||||
void PopulateTCPorUDPEntry(struct nf_conntrack *, uint32_t, nat_table_entry *);
|
|
||||||
void CheckSTAClient(const nat_table_entry *, bool *);
|
|
||||||
int CheckNatIface(ipacm_event_data_all *, bool *);
|
|
||||||
void HandleNonNatIPAddr(void *, bool);
|
|
||||||
|
|
||||||
#ifdef CT_OPT
|
|
||||||
void ProcessCTV6Message(void *);
|
|
||||||
void HandleLan2Lan(struct nf_conntrack *,
|
|
||||||
enum nf_conntrack_msg_type, nat_table_entry* );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
|
||||||
char wan_ifname[IPA_IFACE_NAME_LEN];
|
|
||||||
uint32_t wan_ipaddr;
|
|
||||||
bool isStaMode;
|
|
||||||
IPACM_ConntrackListener();
|
|
||||||
void event_callback(ipa_cm_event_id, void *data);
|
|
||||||
inline bool isWanUp()
|
|
||||||
{
|
|
||||||
return WanUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleNeighIpAddrAddEvt(ipacm_event_data_all *);
|
|
||||||
void HandleNeighIpAddrDelEvt(uint32_t);
|
|
||||||
void HandleSTAClientAddEvt(uint32_t);
|
|
||||||
void HandleSTAClientDelEvt(uint32_t);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern IPACM_ConntrackListener *CtList;
|
|
||||||
|
|
||||||
#endif /* IPACM_CONNTRACK_LISTENER */
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_CONNTRACK_NATAPP_H
|
|
||||||
#define IPACM_CONNTRACK_NATAPP_H
|
|
||||||
|
|
||||||
#include <string.h> /* for stderror */
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <cstdio> /* for perror */
|
|
||||||
|
|
||||||
#include "IPACM_Config.h"
|
|
||||||
#include "IPACM_Xml.h"
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
|
|
||||||
#include <ipa_nat_drv.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MAX_TEMP_ENTRIES 25
|
|
||||||
|
|
||||||
#define IPACM_TCP_FULL_FILE_NAME "/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established"
|
|
||||||
#define IPACM_UDP_FULL_FILE_NAME "/proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream"
|
|
||||||
|
|
||||||
typedef struct _nat_table_entry
|
|
||||||
{
|
|
||||||
uint32_t private_ip;
|
|
||||||
uint16_t private_port;
|
|
||||||
|
|
||||||
uint32_t target_ip;
|
|
||||||
uint16_t target_port;
|
|
||||||
|
|
||||||
uint32_t public_ip;
|
|
||||||
uint16_t public_port;
|
|
||||||
|
|
||||||
u_int8_t protocol;
|
|
||||||
uint32_t timestamp;
|
|
||||||
|
|
||||||
bool dst_nat;
|
|
||||||
bool enabled;
|
|
||||||
uint32_t rule_hdl;
|
|
||||||
|
|
||||||
}nat_table_entry;
|
|
||||||
|
|
||||||
#define CHK_TBL_HDL() if(nat_table_hdl == 0){ return -1; }
|
|
||||||
|
|
||||||
class NatApp
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
|
|
||||||
static NatApp *pInstance;
|
|
||||||
|
|
||||||
nat_table_entry *cache;
|
|
||||||
nat_table_entry temp[MAX_TEMP_ENTRIES];
|
|
||||||
uint32_t pub_ip_addr;
|
|
||||||
uint32_t pub_ip_addr_pre;
|
|
||||||
uint32_t nat_table_hdl;
|
|
||||||
|
|
||||||
int curCnt, max_entries;
|
|
||||||
|
|
||||||
ipacm_alg *pALGPorts;
|
|
||||||
uint16_t nALGPort;
|
|
||||||
|
|
||||||
uint32_t tcp_timeout;
|
|
||||||
uint32_t udp_timeout;
|
|
||||||
|
|
||||||
uint32_t PwrSaveIfs[IPA_MAX_NUM_WIFI_CLIENTS];
|
|
||||||
|
|
||||||
struct nf_conntrack *ct;
|
|
||||||
struct nfct_handle *ct_hdl;
|
|
||||||
|
|
||||||
NatApp();
|
|
||||||
int Init();
|
|
||||||
|
|
||||||
void UpdateCTUdpTs(nat_table_entry *, uint32_t);
|
|
||||||
bool ChkForDup(const nat_table_entry *);
|
|
||||||
bool isAlgPort(uint8_t, uint16_t);
|
|
||||||
void Reset();
|
|
||||||
bool isPwrSaveIf(uint32_t);
|
|
||||||
|
|
||||||
public:
|
|
||||||
static NatApp* GetInstance();
|
|
||||||
|
|
||||||
int AddTable(uint32_t);
|
|
||||||
uint32_t GetTableHdl(uint32_t);
|
|
||||||
int DeleteTable(uint32_t);
|
|
||||||
|
|
||||||
int AddEntry(const nat_table_entry *);
|
|
||||||
int DeleteEntry(const nat_table_entry *);
|
|
||||||
|
|
||||||
void UpdateUDPTimeStamp();
|
|
||||||
|
|
||||||
int UpdatePwrSaveIf(uint32_t);
|
|
||||||
int ResetPwrSaveIf(uint32_t);
|
|
||||||
int DelEntriesOnClntDiscon(uint32_t);
|
|
||||||
int DelEntriesOnSTAClntDiscon(uint32_t);
|
|
||||||
|
|
||||||
void Read_TcpUdp_Timeout(void);
|
|
||||||
|
|
||||||
void AddTempEntry(const nat_table_entry *);
|
|
||||||
void CacheEntry(const nat_table_entry *);
|
|
||||||
void DeleteTempEntry(const nat_table_entry *);
|
|
||||||
void FlushTempEntries(uint32_t, bool, bool isDummy = false);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* IPACM_CONNTRACK_NATAPP_H */
|
|
||||||
@@ -1,354 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_Defs.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the common definitions amon all ifaces.
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPA_CM_DEFS_H
|
|
||||||
#define IPA_CM_DEFS_H
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <linux/msm_ipa.h>
|
|
||||||
#include "IPACM_Log.h"
|
|
||||||
|
|
||||||
#ifdef USE_GLIB
|
|
||||||
#include <glib.h>
|
|
||||||
#define strlcpy g_strlcpy
|
|
||||||
#define strlcat g_strlcat
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
|
|
||||||
#include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
#define IF_NAME_LEN 16
|
|
||||||
#define IPA_MAX_FILE_LEN 64
|
|
||||||
#define IPA_IFACE_NAME_LEN 16
|
|
||||||
#define IPA_ALG_PROTOCOL_NAME_LEN 10
|
|
||||||
|
|
||||||
#define IPA_WLAN_PARTIAL_HDR_OFFSET 0 // dst mac first then src mac
|
|
||||||
#define IPA_ODU_PARTIAL_HDR_OFFSET 8 // dst mac first then src mac
|
|
||||||
#define IPA_WLAN_PARTIAL_HDR_NAME_v4 "IEEE802_3_v4"
|
|
||||||
#define IPA_WLAN_PARTIAL_HDR_NAME_v6 "IEEE802_3_v6"
|
|
||||||
#define IPA_DUMMY_ETH_HDR_NAME_v6 "ETH_dummy_v6"
|
|
||||||
#define IPA_WAN_PARTIAL_HDR_NAME_v4 "IEEE802_3_STA_v4"
|
|
||||||
#define IPA_WAN_PARTIAL_HDR_NAME_v6 "IEEE802_3_STA_v6"
|
|
||||||
#define IPA_ETH_HDR_NAME_v4 "IPACM_ETH_v4"
|
|
||||||
#define IPA_ETH_HDR_NAME_v6 "IPACM_ETH_v6"
|
|
||||||
#define IPA_ODU_HDR_NAME_v4 "IPACM_ODU_v4"
|
|
||||||
#define IPA_ODU_HDR_NAME_v6 "IPACM_ODU_v6"
|
|
||||||
|
|
||||||
|
|
||||||
#define IPA_MAX_IFACE_ENTRIES 20
|
|
||||||
#define IPA_MAX_PRIVATE_SUBNET_ENTRIES 3
|
|
||||||
#define IPA_MAX_ALG_ENTRIES 20
|
|
||||||
#define IPA_MAX_RM_ENTRY 6
|
|
||||||
|
|
||||||
#define IPV4_ADDR_LINKLOCAL 0xA9FE0000
|
|
||||||
#define IPV4_ADDR_LINKLOCAL_MASK 0xFFFF0000
|
|
||||||
|
|
||||||
#define V4_DEFAULT_ROUTE_TABLE_NAME "ipa_dflt_rt"
|
|
||||||
#define V4_LAN_ROUTE_TABLE_NAME "COMRTBLLANv4"
|
|
||||||
#define V4_WAN_ROUTE_TABLE_NAME "WANRTBLv4"
|
|
||||||
#define WAN_DL_ROUTE_TABLE_NAME "ipa_dflt_wan_rt"
|
|
||||||
#define V6_COMMON_ROUTE_TABLE_NAME "COMRTBLv6"
|
|
||||||
#define V6_WAN_ROUTE_TABLE_NAME "WANRTBLv6"
|
|
||||||
#define V4_ODU_ROUTE_TABLE_NAME "ODURTBLv4"
|
|
||||||
#define V6_ODU_ROUTE_TABLE_NAME "ODURTBLv6"
|
|
||||||
|
|
||||||
#define WWAN_QMI_IOCTL_DEVICE_NAME "/dev/wwan_ioctl"
|
|
||||||
#define IPA_DEVICE_NAME "/dev/ipa"
|
|
||||||
#define MAX_NUM_PROP 2
|
|
||||||
|
|
||||||
#ifndef FEATURE_IPA_V3
|
|
||||||
#define IPA_MAX_FLT_RULE 50
|
|
||||||
#else
|
|
||||||
#define IPA_MAX_FLT_RULE 100
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TCP_FIN_SHIFT 16
|
|
||||||
#define TCP_SYN_SHIFT 17
|
|
||||||
#define TCP_RST_SHIFT 18
|
|
||||||
#define NUM_IPV6_PREFIX_FLT_RULE 1
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------
|
|
||||||
Return values indicating error status
|
|
||||||
---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define IPACM_SUCCESS 0 /* Successful operation */
|
|
||||||
#define IPACM_FAILURE -1 /* Unsuccessful operation */
|
|
||||||
|
|
||||||
#define IPACM_IP_NULL (ipa_ip_type)0xFF
|
|
||||||
#define IPACM_INVALID_INDEX (ipa_ip_type)0xFF
|
|
||||||
|
|
||||||
#define IPA_MAX_NUM_WIFI_CLIENTS 32
|
|
||||||
#define IPA_MAX_NUM_WAN_CLIENTS 10
|
|
||||||
#define IPA_MAX_NUM_ETH_CLIENTS 15
|
|
||||||
#define IPA_MAX_NUM_AMPDU_RULE 15
|
|
||||||
#define IPA_MAC_ADDR_SIZE 6
|
|
||||||
|
|
||||||
/*===========================================================================
|
|
||||||
GLOBAL DEFINITIONS AND DECLARATIONS
|
|
||||||
===========================================================================*/
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
IPA_CFG_CHANGE_EVENT, /* NULL */
|
|
||||||
IPA_PRIVATE_SUBNET_CHANGE_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_FIREWALL_CHANGE_EVENT, /* NULL */
|
|
||||||
IPA_LINK_UP_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_LINK_DOWN_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_USB_LINK_UP_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_BRIDGE_LINK_UP_EVENT, /* ipacm_event_data_all */
|
|
||||||
IPA_WAN_EMBMS_LINK_UP_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_ADDR_ADD_EVENT, /* ipacm_event_data_addr */
|
|
||||||
IPA_ADDR_DEL_EVENT, /* no use */
|
|
||||||
IPA_ROUTE_ADD_EVENT, /* ipacm_event_data_addr */
|
|
||||||
IPA_ROUTE_DEL_EVENT, /* ipacm_event_data_addr */
|
|
||||||
IPA_WAN_UPSTREAM_ROUTE_ADD_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_WAN_UPSTREAM_ROUTE_DEL_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_WLAN_AP_LINK_UP_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_STA_LINK_UP_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_LINK_DOWN_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_CLIENT_ADD_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_CLIENT_ADD_EVENT_EX, /* ipacm_event_data_wlan_ex */
|
|
||||||
IPA_WLAN_CLIENT_DEL_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_CLIENT_POWER_SAVE_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_WLAN_CLIENT_RECOVER_EVENT, /* ipacm_event_data_mac */
|
|
||||||
IPA_NEW_NEIGH_EVENT, /* ipacm_event_data_all */
|
|
||||||
IPA_DEL_NEIGH_EVENT, /* ipacm_event_data_all */
|
|
||||||
IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT, /* ipacm_event_data_all */
|
|
||||||
IPA_NEIGH_CLIENT_IP_ADDR_DEL_EVENT, /* ipacm_event_data_all */
|
|
||||||
IPA_SW_ROUTING_ENABLE, /* NULL */
|
|
||||||
IPA_SW_ROUTING_DISABLE, /* NULL */
|
|
||||||
IPA_PROCESS_CT_MESSAGE, /* ipacm_ct_evt_data */
|
|
||||||
IPA_PROCESS_CT_MESSAGE_V6, /* ipacm_ct_evt_data */
|
|
||||||
IPA_LAN_TO_LAN_NEW_CONNECTION, /* ipacm_event_connection */
|
|
||||||
IPA_LAN_TO_LAN_DEL_CONNECTION, /* ipacm_event_connection */
|
|
||||||
IPA_WLAN_SWITCH_TO_SCC, /* No Data */
|
|
||||||
IPA_WLAN_SWITCH_TO_MCC, /* No Data */
|
|
||||||
IPA_CRADLE_WAN_MODE_SWITCH, /* ipacm_event_cradle_wan_mode */
|
|
||||||
IPA_WAN_XLAT_CONNECT_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_TETHERING_STATS_UPDATE_EVENT, /* ipacm_event_data_fid */
|
|
||||||
IPA_NETWORK_STATS_UPDATE_EVENT, /* ipacm_event_data_fid */
|
|
||||||
|
|
||||||
IPA_EXTERNAL_EVENT_MAX,
|
|
||||||
|
|
||||||
IPA_HANDLE_WAN_UP, /* ipacm_event_iface_up */
|
|
||||||
IPA_HANDLE_WAN_DOWN, /* ipacm_event_iface_up */
|
|
||||||
IPA_HANDLE_WAN_UP_V6, /* NULL */
|
|
||||||
IPA_HANDLE_WAN_DOWN_V6, /* NULL */
|
|
||||||
IPA_HANDLE_WAN_UP_TETHER, /* ipacm_event_iface_up_tehter */
|
|
||||||
IPA_HANDLE_WAN_DOWN_TETHER, /* ipacm_event_iface_up_tehter */
|
|
||||||
IPA_HANDLE_WAN_UP_V6_TETHER, /* ipacm_event_iface_up_tehter */
|
|
||||||
IPA_HANDLE_WAN_DOWN_V6_TETHER, /* ipacm_event_iface_up_tehter */
|
|
||||||
IPA_HANDLE_WLAN_UP, /* ipacm_event_iface_up */
|
|
||||||
IPA_HANDLE_LAN_UP, /* ipacm_event_iface_up */
|
|
||||||
IPA_ETH_BRIDGE_IFACE_UP, /* ipacm_event_eth_bridge*/
|
|
||||||
IPA_ETH_BRIDGE_IFACE_DOWN, /* ipacm_event_eth_bridge*/
|
|
||||||
IPA_ETH_BRIDGE_CLIENT_ADD, /* ipacm_event_eth_bridge */
|
|
||||||
IPA_ETH_BRIDGE_CLIENT_DEL, /* ipacm_event_eth_bridge*/
|
|
||||||
IPA_ETH_BRIDGE_WLAN_SCC_MCC_SWITCH, /* ipacm_event_eth_bridge*/
|
|
||||||
IPA_LAN_DELETE_SELF, /* ipacm_event_data_fid */
|
|
||||||
IPACM_EVENT_MAX
|
|
||||||
} ipa_cm_event_id;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint8_t num_rule;
|
|
||||||
uint32_t rule_hdl[MAX_NUM_PROP];
|
|
||||||
} lan_to_lan_rt_rule_hdl;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
LAN_IF = 0,
|
|
||||||
WLAN_IF,
|
|
||||||
WAN_IF,
|
|
||||||
VIRTUAL_IF,
|
|
||||||
ETH_IF,
|
|
||||||
EMBMS_IF,
|
|
||||||
ODU_IF,
|
|
||||||
UNKNOWN_IF
|
|
||||||
} ipacm_iface_type;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
ROUTER = 0,
|
|
||||||
BRIDGE
|
|
||||||
} ipacm_cradle_iface_mode;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
FULL,
|
|
||||||
INTERNET
|
|
||||||
} ipacm_wlan_access_mode;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
struct nf_conntrack *ct;
|
|
||||||
enum nf_conntrack_msg_type type;
|
|
||||||
}ipacm_ct_evt_data;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
char iface_name[IPA_IFACE_NAME_LEN];
|
|
||||||
ipacm_iface_type if_cat;
|
|
||||||
ipacm_cradle_iface_mode if_mode;
|
|
||||||
ipacm_wlan_access_mode wlan_mode;
|
|
||||||
int netlink_interface_index;
|
|
||||||
} ipa_ifi_dev_name_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint32_t subnet_addr;
|
|
||||||
uint32_t subnet_mask;
|
|
||||||
} ipa_private_subnet;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_data_all
|
|
||||||
{
|
|
||||||
enum ipa_ip_type iptype;
|
|
||||||
int if_index;
|
|
||||||
uint32_t ipv4_addr;
|
|
||||||
uint32_t ipv6_addr[4];
|
|
||||||
uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
|
|
||||||
} ipacm_event_data_all;
|
|
||||||
|
|
||||||
class IPACM_Lan;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ipacm_cradle_iface_mode cradle_wan_mode;
|
|
||||||
} ipacm_event_cradle_wan_mode;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
IPACM_Lan *p_iface;
|
|
||||||
ipa_ip_type iptype;
|
|
||||||
uint8_t mac_addr[6];
|
|
||||||
} ipacm_event_eth_bridge;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
enum ipa_ip_type iptype;
|
|
||||||
uint32_t src_ipv4_addr;
|
|
||||||
uint32_t dst_ipv4_addr;
|
|
||||||
uint32_t src_ipv6_addr[4];
|
|
||||||
uint32_t dst_ipv6_addr[4];
|
|
||||||
} ipacm_event_connection;
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_data_fid
|
|
||||||
{
|
|
||||||
int if_index;
|
|
||||||
} ipacm_event_data_fid;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
ipacm_iface_type if_cat;
|
|
||||||
} ipacm_event_data_if_cat;
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_data_iptype
|
|
||||||
{
|
|
||||||
int if_index;
|
|
||||||
int if_index_tether;
|
|
||||||
enum ipa_ip_type iptype;
|
|
||||||
#ifdef IPA_WAN_MSG_IPv6_ADDR_GW_LEN
|
|
||||||
uint32_t ipv4_addr_gw;
|
|
||||||
uint32_t ipv6_addr_gw[4];
|
|
||||||
#endif
|
|
||||||
} ipacm_event_data_iptype;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_data_addr
|
|
||||||
{
|
|
||||||
enum ipa_ip_type iptype;
|
|
||||||
int if_index;
|
|
||||||
uint32_t ipv4_addr_gw;
|
|
||||||
uint32_t ipv4_addr;
|
|
||||||
uint32_t ipv4_addr_mask;
|
|
||||||
uint32_t ipv6_addr[4];
|
|
||||||
uint32_t ipv6_addr_mask[4];
|
|
||||||
uint32_t ipv6_addr_gw[4];
|
|
||||||
} ipacm_event_data_addr;
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_data_mac
|
|
||||||
{
|
|
||||||
int if_index;
|
|
||||||
int ipa_if_cate;
|
|
||||||
uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
|
|
||||||
} ipacm_event_data_mac;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int if_index;
|
|
||||||
uint8_t num_of_attribs;
|
|
||||||
struct ipa_wlan_hdr_attrib_val attribs[0];
|
|
||||||
} ipacm_event_data_wlan_ex;
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_iface_up
|
|
||||||
{
|
|
||||||
char ifname[IPA_IFACE_NAME_LEN];
|
|
||||||
uint32_t ipv4_addr;
|
|
||||||
uint32_t addr_mask;
|
|
||||||
uint32_t ipv6_prefix[2];
|
|
||||||
bool is_sta;
|
|
||||||
uint8_t xlat_mux_id;
|
|
||||||
}ipacm_event_iface_up;
|
|
||||||
|
|
||||||
typedef struct _ipacm_event_iface_up_tether
|
|
||||||
{
|
|
||||||
uint32_t if_index_tether;
|
|
||||||
uint32_t ipv6_prefix[2];
|
|
||||||
bool is_sta;
|
|
||||||
}ipacm_event_iface_up_tehter;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
Q6_WAN = 0,
|
|
||||||
WLAN_WAN,
|
|
||||||
ECM_WAN
|
|
||||||
} ipacm_wan_iface_type;
|
|
||||||
|
|
||||||
typedef struct _ipacm_ifacemgr_data
|
|
||||||
{
|
|
||||||
int if_index;
|
|
||||||
ipacm_wan_iface_type if_type;
|
|
||||||
uint8_t mac_addr[IPA_MAC_ADDR_SIZE];
|
|
||||||
}ipacm_ifacemgr_data;
|
|
||||||
|
|
||||||
#endif /* IPA_CM_DEFS_H */
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of The Linux Foundation nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_EvtDispatcher.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the IPAM event dispatcher definitions
|
|
||||||
|
|
||||||
@Author
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_EvtDispatcher_H
|
|
||||||
#define IPACM_EvtDispatcher_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <IPACM_CmdQueue.h>
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
#include "IPACM_Listener.h"
|
|
||||||
|
|
||||||
/* queue */
|
|
||||||
typedef struct _cmd_evts
|
|
||||||
{
|
|
||||||
ipa_cm_event_id event;
|
|
||||||
IPACM_Listener *obj;
|
|
||||||
//int ipa_interface_index;
|
|
||||||
_cmd_evts *next;
|
|
||||||
} cmd_evts;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IPACM_EvtDispatcher
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/* api for all iface instances to register events */
|
|
||||||
static int registr(ipa_cm_event_id event, IPACM_Listener *obj);
|
|
||||||
|
|
||||||
/* api for all iface instances to de-register events */
|
|
||||||
static int deregistr(IPACM_Listener *obj);
|
|
||||||
|
|
||||||
static int PostEvt(ipacm_cmd_q_data *);
|
|
||||||
static void ProcessEvt(ipacm_cmd_q_data *);
|
|
||||||
|
|
||||||
private:
|
|
||||||
static cmd_evts *head;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_EvtDispatcher_H */
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_Filtering.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the IPACM filtering definitions
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IPACM_FILTERING_H
|
|
||||||
#define IPACM_FILTERING_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <linux/msm_ipa.h>
|
|
||||||
#include <IPACM_Defs.h>
|
|
||||||
#include <linux/rmnet_ipa_fd_ioctl.h>
|
|
||||||
|
|
||||||
class IPACM_Filtering
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
IPACM_Filtering();
|
|
||||||
~IPACM_Filtering();
|
|
||||||
bool AddFilteringRule(struct ipa_ioc_add_flt_rule const *ruleTable);
|
|
||||||
bool AddFilteringRuleAfter(struct ipa_ioc_add_flt_rule_after const *ruleTable);
|
|
||||||
bool DeleteFilteringRule(struct ipa_ioc_del_flt_rule *ruleTable);
|
|
||||||
bool Commit(enum ipa_ip_type ip);
|
|
||||||
bool Reset(enum ipa_ip_type ip);
|
|
||||||
bool DeviceNodeIsOpened();
|
|
||||||
bool DeleteFilteringHdls(uint32_t *flt_rule_hdls,
|
|
||||||
ipa_ip_type ip,
|
|
||||||
uint8_t num_rules);
|
|
||||||
|
|
||||||
bool AddWanDLFilteringRule(struct ipa_ioc_add_flt_rule const *rule_table_v4, struct ipa_ioc_add_flt_rule const * rule_table_v6, uint8_t mux_id);
|
|
||||||
bool SendFilteringRuleIndex(struct ipa_fltr_installed_notif_req_msg_v01* table);
|
|
||||||
bool ModifyFilteringRule(struct ipa_ioc_mdfy_flt_rule* ruleTable);
|
|
||||||
ipa_filter_action_enum_v01 GetQmiFilterAction(ipa_flt_action action);
|
|
||||||
|
|
||||||
private:
|
|
||||||
static const char *DEVICE_NAME;
|
|
||||||
int fd; /* File descriptor of the IPA device node /dev/ipa */
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //IPACM_FILTERING_H
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of The Linux Foundation nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IPACM_Header.h
|
|
||||||
*
|
|
||||||
* Created on: Jun 20, 2012
|
|
||||||
* Author: tatias
|
|
||||||
*/
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef IPACM_HEADER_H
|
|
||||||
#define IPACM_HEADER_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "linux/msm_ipa.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
class IPACM_Header
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
int m_fd;
|
|
||||||
public:
|
|
||||||
bool AddHeader(struct ipa_ioc_add_hdr *pHeaderTable);
|
|
||||||
bool DeleteHeader(struct ipa_ioc_del_hdr *pHeaderTable);
|
|
||||||
bool GetHeaderHandle(struct ipa_ioc_get_hdr *pHeaderStruct);
|
|
||||||
bool CopyHeader(struct ipa_ioc_copy_hdr *pCopyHeaderStruct);
|
|
||||||
bool Commit();
|
|
||||||
bool Reset();
|
|
||||||
bool DeleteHeaderHdl(uint32_t hdr_hdl);
|
|
||||||
bool AddHeaderProcCtx(struct ipa_ioc_add_hdr_proc_ctx* pHeader);
|
|
||||||
bool DeleteHeaderProcCtx(uint32_t hdl);
|
|
||||||
|
|
||||||
IPACM_Header();
|
|
||||||
~IPACM_Header();
|
|
||||||
bool DeviceNodeIsOpened();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_iface.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the basis Iface definitions.
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_IFACE_H
|
|
||||||
#define IPACM_IFACE_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <IPACM_CmdQueue.h>
|
|
||||||
#include <linux/msm_ipa.h>
|
|
||||||
#include "IPACM_Routing.h"
|
|
||||||
#include "IPACM_Filtering.h"
|
|
||||||
#include "IPACM_Header.h"
|
|
||||||
#include "IPACM_EvtDispatcher.h"
|
|
||||||
#include "IPACM_Xml.h"
|
|
||||||
#include "IPACM_Log.h"
|
|
||||||
#include "IPACM_Config.h"
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/* current support 2 ipv6-address*/
|
|
||||||
#define MAX_DEFAULT_v4_ROUTE_RULES 1
|
|
||||||
#define MAX_DEFAULT_v6_ROUTE_RULES 2
|
|
||||||
#define IPV4_DEFAULT_FILTERTING_RULES 3
|
|
||||||
|
|
||||||
#ifdef FEATURE_IPA_ANDROID
|
|
||||||
#define IPV6_DEFAULT_FILTERTING_RULES 6
|
|
||||||
#else
|
|
||||||
#define IPV6_DEFAULT_FILTERTING_RULES 3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IPV6_DEFAULT_LAN_FILTERTING_RULES 1
|
|
||||||
#define IPV6_NUM_ADDR 3
|
|
||||||
#define MAX_SOFTWAREROUTING_FILTERTING_RULES 2
|
|
||||||
#define INVALID_IFACE -1
|
|
||||||
|
|
||||||
/* iface */
|
|
||||||
class IPACM_Iface :public IPACM_Listener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/* Static class for reading IPACM configuration from XML file*/
|
|
||||||
static IPACM_Config *ipacmcfg;
|
|
||||||
|
|
||||||
/* IPACM interface id */
|
|
||||||
int ipa_if_num;
|
|
||||||
|
|
||||||
/* IPACM interface category */
|
|
||||||
ipacm_iface_type ipa_if_cate;
|
|
||||||
|
|
||||||
/* IPACM interface name */
|
|
||||||
char dev_name[IF_NAME_LEN];
|
|
||||||
|
|
||||||
/* IPACM interface iptype v4, v6 or both */
|
|
||||||
ipa_ip_type ip_type;
|
|
||||||
|
|
||||||
/* IPACM interface v6 ip-address*/
|
|
||||||
uint32_t ipv6_addr[MAX_DEFAULT_v6_ROUTE_RULES][4];
|
|
||||||
|
|
||||||
uint32_t software_routing_fl_rule_hdl[MAX_SOFTWAREROUTING_FILTERTING_RULES];
|
|
||||||
|
|
||||||
bool softwarerouting_act;
|
|
||||||
|
|
||||||
/* IPACM number of default route rules for ipv6*/
|
|
||||||
int num_dft_rt_v6;
|
|
||||||
|
|
||||||
uint32_t dft_v4fl_rule_hdl[IPV4_DEFAULT_FILTERTING_RULES];
|
|
||||||
uint32_t dft_v6fl_rule_hdl[IPV6_DEFAULT_FILTERTING_RULES + IPV6_DEFAULT_LAN_FILTERTING_RULES];
|
|
||||||
/* create additional set of v6 RT-rules in Wanv6RT table*/
|
|
||||||
uint32_t dft_rt_rule_hdl[MAX_DEFAULT_v4_ROUTE_RULES+2*MAX_DEFAULT_v6_ROUTE_RULES];
|
|
||||||
|
|
||||||
ipa_ioc_query_intf *iface_query;
|
|
||||||
ipa_ioc_query_intf_tx_props *tx_prop;
|
|
||||||
ipa_ioc_query_intf_rx_props *rx_prop;
|
|
||||||
|
|
||||||
virtual int handle_down_evt() = 0;
|
|
||||||
|
|
||||||
virtual int handle_addr_evt(ipacm_event_data_addr *data) = 0;
|
|
||||||
|
|
||||||
IPACM_Iface(int iface_index);
|
|
||||||
|
|
||||||
virtual void event_callback(ipa_cm_event_id event,
|
|
||||||
void *data) = 0;
|
|
||||||
|
|
||||||
/* Query ipa_interface_index by given linux interface_index */
|
|
||||||
static int iface_ipa_index_query(int interface_index);
|
|
||||||
|
|
||||||
/* Query ipa_interface ipv4_addr by given linux interface_index */
|
|
||||||
static void iface_addr_query(int interface_index);
|
|
||||||
|
|
||||||
/*Query the IPA endpoint property */
|
|
||||||
int query_iface_property(void);
|
|
||||||
|
|
||||||
/*Configure the initial filter rules */
|
|
||||||
virtual int init_fl_rule(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/* Change IP Type.*/
|
|
||||||
void config_ip_type(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/* Get interface index */
|
|
||||||
virtual int ipa_get_if_index(char * if_name, int * if_index);
|
|
||||||
|
|
||||||
static IPACM_Routing m_routing;
|
|
||||||
static IPACM_Filtering m_filtering;
|
|
||||||
static IPACM_Header m_header;
|
|
||||||
|
|
||||||
/* software routing enable */
|
|
||||||
virtual int handle_software_routing_enable(void);
|
|
||||||
|
|
||||||
/* software routing disable */
|
|
||||||
virtual int handle_software_routing_disable(void);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
static const char *DEVICE_NAME;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_IFACE_H */
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_IfaceManager.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the IPAM iface_manager definitions
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_IFACEMANAGER_H
|
|
||||||
#define IPACM_IFACEMANAGER_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <IPACM_CmdQueue.h>
|
|
||||||
|
|
||||||
#include "IPACM_Routing.h"
|
|
||||||
#include "IPACM_Filtering.h"
|
|
||||||
#include "IPACM_Listener.h"
|
|
||||||
#include "IPACM_Iface.h"
|
|
||||||
|
|
||||||
#define IPA_INSTANCE_NOT_FOUND 0
|
|
||||||
#define IPA_INSTANCE_FOUND 1
|
|
||||||
|
|
||||||
/* queue */
|
|
||||||
typedef struct _iface_instances
|
|
||||||
{
|
|
||||||
/* Linux interface id */
|
|
||||||
int ipa_if_index;
|
|
||||||
IPACM_Listener *obj;
|
|
||||||
_iface_instances *next;
|
|
||||||
} iface_instances;
|
|
||||||
|
|
||||||
|
|
||||||
class IPACM_IfaceManager : public IPACM_Listener
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
IPACM_IfaceManager();
|
|
||||||
|
|
||||||
void event_callback(ipa_cm_event_id event,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
/* api for all iface instances to de-register instances */
|
|
||||||
static int deregistr(IPACM_Listener *param);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
int create_iface_instance(ipacm_ifacemgr_data *);
|
|
||||||
|
|
||||||
/* api to register instances */
|
|
||||||
int registr(int ipa_if_index, IPACM_Listener *obj);
|
|
||||||
|
|
||||||
int SearchInstance(int ipa_if_index);
|
|
||||||
|
|
||||||
static iface_instances *head;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_IFACEMANAGER_H */
|
|
||||||
@@ -1,390 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013-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.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_Lan.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the LAN iface definitions
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_LAN_H
|
|
||||||
#define IPACM_LAN_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <linux/msm_ipa.h>
|
|
||||||
|
|
||||||
#include "IPACM_CmdQueue.h"
|
|
||||||
#include "IPACM_Iface.h"
|
|
||||||
#include "IPACM_Routing.h"
|
|
||||||
#include "IPACM_Filtering.h"
|
|
||||||
#include "IPACM_Config.h"
|
|
||||||
#include "IPACM_Conntrack_NATApp.h"
|
|
||||||
|
|
||||||
#define IPA_WAN_DEFAULT_FILTER_RULE_HANDLES 1
|
|
||||||
#define IPA_PRIV_SUBNET_FILTER_RULE_HANDLES 3
|
|
||||||
#define IPA_NUM_ODU_ROUTE_RULES 2
|
|
||||||
#define MAX_WAN_UL_FILTER_RULES MAX_NUM_EXT_PROPS
|
|
||||||
#define NUM_IPV4_ICMP_FLT_RULE 1
|
|
||||||
#define NUM_IPV6_ICMP_FLT_RULE 1
|
|
||||||
|
|
||||||
/* ndc bandwidth ipatetherstats <ifaceIn> <ifaceOut> */
|
|
||||||
/* <in->out_bytes> <in->out_pkts> <out->in_bytes> <out->in_pkts */
|
|
||||||
|
|
||||||
#define PIPE_STATS "%s %s %lu %lu %lu %lu"
|
|
||||||
#define IPA_PIPE_STATS_FILE_NAME "/data/misc/ipa/tether_stats"
|
|
||||||
|
|
||||||
/* store each lan-iface unicast routing rule and its handler*/
|
|
||||||
struct ipa_lan_rt_rule
|
|
||||||
{
|
|
||||||
ipa_ip_type ip;
|
|
||||||
uint32_t v4_addr;
|
|
||||||
uint32_t v4_addr_mask;
|
|
||||||
uint32_t v6_addr[4];
|
|
||||||
uint32_t rt_rule_hdl[0];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Support multiple eth client */
|
|
||||||
typedef struct _eth_client_rt_hdl
|
|
||||||
{
|
|
||||||
uint32_t eth_rt_rule_hdl_v4;
|
|
||||||
uint32_t eth_rt_rule_hdl_v6[IPV6_NUM_ADDR];
|
|
||||||
uint32_t eth_rt_rule_hdl_v6_wan[IPV6_NUM_ADDR];
|
|
||||||
}eth_client_rt_hdl;
|
|
||||||
|
|
||||||
typedef struct _ipa_eth_client
|
|
||||||
{
|
|
||||||
uint8_t mac[IPA_MAC_ADDR_SIZE];
|
|
||||||
uint32_t v4_addr;
|
|
||||||
uint32_t v6_addr[IPV6_NUM_ADDR][4];
|
|
||||||
uint32_t hdr_hdl_v4;
|
|
||||||
uint32_t hdr_hdl_v6;
|
|
||||||
bool route_rule_set_v4;
|
|
||||||
int route_rule_set_v6;
|
|
||||||
bool ipv4_set;
|
|
||||||
int ipv6_set;
|
|
||||||
bool ipv4_header_set;
|
|
||||||
bool ipv6_header_set;
|
|
||||||
eth_client_rt_hdl eth_rt_hdl[0]; /* depends on number of tx properties */
|
|
||||||
}ipa_eth_client;
|
|
||||||
|
|
||||||
|
|
||||||
/* lan iface */
|
|
||||||
class IPACM_Lan : public IPACM_Iface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
IPACM_Lan(int iface_index);
|
|
||||||
~IPACM_Lan();
|
|
||||||
|
|
||||||
/* store lan's wan-up filter rule handlers */
|
|
||||||
uint32_t lan_wan_fl_rule_hdl[IPA_WAN_DEFAULT_FILTER_RULE_HANDLES];
|
|
||||||
|
|
||||||
/* store private-subnet filter rule handlers */
|
|
||||||
uint32_t private_fl_rule_hdl[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
|
|
||||||
|
|
||||||
/* LAN-iface's callback function */
|
|
||||||
void event_callback(ipa_cm_event_id event, void *data);
|
|
||||||
|
|
||||||
virtual int handle_wan_up(ipa_ip_type ip_type);
|
|
||||||
|
|
||||||
/* configure filter rule for wan_up event*/
|
|
||||||
virtual int handle_wan_up_ex(ipacm_ext_prop* ext_prop, ipa_ip_type iptype, uint8_t xlat_mux_id);
|
|
||||||
|
|
||||||
/* delete filter rule for wan_down event*/
|
|
||||||
virtual int handle_wan_down(bool is_sta_mode);
|
|
||||||
|
|
||||||
/* delete filter rule for wan_down event*/
|
|
||||||
virtual int handle_wan_down_v6(bool is_sta_mode);
|
|
||||||
|
|
||||||
/* configure private subnet filter rules*/
|
|
||||||
virtual int handle_private_subnet(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/* handle new_address event*/
|
|
||||||
int handle_addr_evt(ipacm_event_data_addr *data);
|
|
||||||
|
|
||||||
int handle_addr_evt_odu_bridge(ipacm_event_data_addr* data);
|
|
||||||
|
|
||||||
int handle_del_ipv6_addr(ipacm_event_data_all *data);
|
|
||||||
|
|
||||||
static bool odu_up;
|
|
||||||
|
|
||||||
/* install UL filter rule from Q6 */
|
|
||||||
virtual int handle_uplink_filter_rule(ipacm_ext_prop* prop, ipa_ip_type iptype, uint8_t xlat_mux_id);
|
|
||||||
|
|
||||||
int handle_cradle_wan_mode_switch(bool is_wan_bridge_mode);
|
|
||||||
|
|
||||||
int install_ipv4_icmp_flt_rule();
|
|
||||||
|
|
||||||
|
|
||||||
/* add header processing context and return handle to lan2lan controller */
|
|
||||||
int eth_bridge_add_hdr_proc_ctx(ipa_hdr_l2_type peer_l2_hdr_type, uint32_t *hdl);
|
|
||||||
|
|
||||||
/* add routing rule and return handle to lan2lan controller */
|
|
||||||
int eth_bridge_add_rt_rule(uint8_t *mac, char *rt_tbl_name, uint32_t hdr_proc_ctx_hdl,
|
|
||||||
ipa_hdr_l2_type peer_l2_hdr_type, ipa_ip_type iptype, uint32_t *rt_rule_hdl, int *rt_rule_count);
|
|
||||||
|
|
||||||
/* modify routing rule*/
|
|
||||||
int eth_bridge_modify_rt_rule(uint8_t *mac, uint32_t hdr_proc_ctx_hdl,
|
|
||||||
ipa_hdr_l2_type peer_l2_hdr_type, ipa_ip_type iptype, uint32_t *rt_rule_hdl, int rt_rule_count);
|
|
||||||
|
|
||||||
/* add filtering rule and return handle to lan2lan controller */
|
|
||||||
int eth_bridge_add_flt_rule(uint8_t *mac, uint32_t rt_tbl_hdl, ipa_ip_type iptype, uint32_t *flt_rule_hdl);
|
|
||||||
|
|
||||||
/* delete filtering rule */
|
|
||||||
int eth_bridge_del_flt_rule(uint32_t flt_rule_hdl, ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/* delete routing rule */
|
|
||||||
int eth_bridge_del_rt_rule(uint32_t rt_rule_hdl, ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/* delete header processing context */
|
|
||||||
int eth_bridge_del_hdr_proc_ctx(uint32_t hdr_proc_ctx_hdl);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
int each_client_rt_rule_count[IPA_IP_MAX];
|
|
||||||
|
|
||||||
uint32_t eth_bridge_flt_rule_offset[IPA_IP_MAX];
|
|
||||||
|
|
||||||
/* mac address has to be provided for client related events */
|
|
||||||
void eth_bridge_post_event(ipa_cm_event_id evt, ipa_ip_type iptype, uint8_t *mac);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual int add_dummy_private_subnet_flt_rule(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
int handle_private_subnet_android(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
int reset_to_dummy_flt_rule(ipa_ip_type iptype, uint32_t rule_hdl);
|
|
||||||
|
|
||||||
virtual int install_ipv6_prefix_flt_rule(uint32_t* prefix);
|
|
||||||
|
|
||||||
virtual void delete_ipv6_prefix_flt_rule();
|
|
||||||
|
|
||||||
int install_ipv6_icmp_flt_rule();
|
|
||||||
|
|
||||||
void post_del_self_evt();
|
|
||||||
|
|
||||||
/* handle tethering stats */
|
|
||||||
int handle_tethering_stats_event(ipa_get_data_stats_resp_msg_v01 *data);
|
|
||||||
|
|
||||||
/* handle tethering client */
|
|
||||||
int handle_tethering_client(bool reset, ipacm_client_enum ipa_client);
|
|
||||||
|
|
||||||
/* store ipv4 UL filter rule handlers from Q6*/
|
|
||||||
uint32_t wan_ul_fl_rule_hdl_v4[MAX_WAN_UL_FILTER_RULES];
|
|
||||||
|
|
||||||
/* store ipv6 UL filter rule handlers from Q6*/
|
|
||||||
uint32_t wan_ul_fl_rule_hdl_v6[MAX_WAN_UL_FILTER_RULES];
|
|
||||||
|
|
||||||
uint32_t ipv4_icmp_flt_rule_hdl[NUM_IPV4_ICMP_FLT_RULE];
|
|
||||||
|
|
||||||
uint32_t ipv6_prefix_flt_rule_hdl[NUM_IPV6_PREFIX_FLT_RULE];
|
|
||||||
uint32_t ipv6_icmp_flt_rule_hdl[NUM_IPV6_ICMP_FLT_RULE];
|
|
||||||
|
|
||||||
int num_wan_ul_fl_rule_v4;
|
|
||||||
int num_wan_ul_fl_rule_v6;
|
|
||||||
|
|
||||||
bool is_active;
|
|
||||||
bool modem_ul_v4_set;
|
|
||||||
bool modem_ul_v6_set;
|
|
||||||
|
|
||||||
uint32_t if_ipv4_subnet;
|
|
||||||
|
|
||||||
uint32_t ipv6_prefix[2];
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/* get hdr proc ctx type given source and destination l2 hdr type */
|
|
||||||
ipa_hdr_proc_type eth_bridge_get_hdr_proc_type(ipa_hdr_l2_type t1, ipa_hdr_l2_type t2);
|
|
||||||
|
|
||||||
/* get partial header (header template of hdr proc ctx) */
|
|
||||||
int eth_bridge_get_hdr_template_hdl(uint32_t* hdr_hdl);
|
|
||||||
|
|
||||||
|
|
||||||
/* dynamically allocate lan iface's unicast routing rule structure */
|
|
||||||
|
|
||||||
bool is_mode_switch; /* indicate mode switch, need post internal up event */
|
|
||||||
|
|
||||||
int eth_client_len;
|
|
||||||
|
|
||||||
ipa_eth_client *eth_client;
|
|
||||||
|
|
||||||
int header_name_count;
|
|
||||||
|
|
||||||
int num_eth_client;
|
|
||||||
|
|
||||||
NatApp *Nat_App;
|
|
||||||
|
|
||||||
int ipv6_set;
|
|
||||||
|
|
||||||
uint32_t ODU_hdr_hdl_v4, ODU_hdr_hdl_v6;
|
|
||||||
|
|
||||||
uint32_t *odu_route_rule_v4_hdl;
|
|
||||||
|
|
||||||
uint32_t *odu_route_rule_v6_hdl;
|
|
||||||
|
|
||||||
bool ipv4_header_set;
|
|
||||||
|
|
||||||
bool ipv6_header_set;
|
|
||||||
|
|
||||||
inline ipa_eth_client* get_client_memptr(ipa_eth_client *param, int cnt)
|
|
||||||
{
|
|
||||||
char *ret = ((char *)param) + (eth_client_len * cnt);
|
|
||||||
return (ipa_eth_client *)ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int get_eth_client_index(uint8_t *mac_addr)
|
|
||||||
{
|
|
||||||
int cnt;
|
|
||||||
int num_eth_client_tmp = num_eth_client;
|
|
||||||
|
|
||||||
IPACMDBG_H("Passed MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
|
|
||||||
mac_addr[0], mac_addr[1], mac_addr[2],
|
|
||||||
mac_addr[3], mac_addr[4], mac_addr[5]);
|
|
||||||
|
|
||||||
for(cnt = 0; cnt < num_eth_client_tmp; cnt++)
|
|
||||||
{
|
|
||||||
IPACMDBG_H("stored MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[0],
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[1],
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[2],
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[3],
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[4],
|
|
||||||
get_client_memptr(eth_client, cnt)->mac[5]);
|
|
||||||
|
|
||||||
if(memcmp(get_client_memptr(eth_client, cnt)->mac,
|
|
||||||
mac_addr,
|
|
||||||
sizeof(get_client_memptr(eth_client, cnt)->mac)) == 0)
|
|
||||||
{
|
|
||||||
IPACMDBG_H("Matched client index: %d\n", cnt);
|
|
||||||
return cnt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return IPACM_INVALID_INDEX;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int delete_eth_rtrules(int clt_indx, ipa_ip_type iptype)
|
|
||||||
{
|
|
||||||
uint32_t tx_index;
|
|
||||||
uint32_t rt_hdl;
|
|
||||||
int num_v6;
|
|
||||||
|
|
||||||
if(iptype == IPA_IP_v4)
|
|
||||||
{
|
|
||||||
for(tx_index = 0; tx_index < iface_query->num_tx_props; tx_index++)
|
|
||||||
{
|
|
||||||
if((tx_prop->tx[tx_index].ip == IPA_IP_v4) && (get_client_memptr(eth_client, clt_indx)->route_rule_set_v4==true)) /* for ipv4 */
|
|
||||||
{
|
|
||||||
IPACMDBG_H("Delete client index %d ipv4 RT-rules for tx:%d\n",clt_indx,tx_index);
|
|
||||||
rt_hdl = get_client_memptr(eth_client, clt_indx)->eth_rt_hdl[tx_index].eth_rt_rule_hdl_v4;
|
|
||||||
|
|
||||||
if(m_routing.DeleteRoutingHdl(rt_hdl, IPA_IP_v4) == false)
|
|
||||||
{
|
|
||||||
return IPACM_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} /* end of for loop */
|
|
||||||
|
|
||||||
/* clean the ipv4 RT rules for eth-client:clt_indx */
|
|
||||||
if(get_client_memptr(eth_client, clt_indx)->route_rule_set_v4==true) /* for ipv4 */
|
|
||||||
{
|
|
||||||
get_client_memptr(eth_client, clt_indx)->route_rule_set_v4 = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(iptype == IPA_IP_v6)
|
|
||||||
{
|
|
||||||
for(tx_index = 0; tx_index < iface_query->num_tx_props; tx_index++)
|
|
||||||
{
|
|
||||||
if((tx_prop->tx[tx_index].ip == IPA_IP_v6) && (get_client_memptr(eth_client, clt_indx)->route_rule_set_v6 != 0)) /* for ipv6 */
|
|
||||||
{
|
|
||||||
for(num_v6 =0;num_v6 < get_client_memptr(eth_client, clt_indx)->route_rule_set_v6;num_v6++)
|
|
||||||
{
|
|
||||||
IPACMDBG_H("Delete client index %d ipv6 RT-rules for %d-st ipv6 for tx:%d\n", clt_indx,num_v6,tx_index);
|
|
||||||
rt_hdl = get_client_memptr(eth_client, clt_indx)->eth_rt_hdl[tx_index].eth_rt_rule_hdl_v6[num_v6];
|
|
||||||
if(m_routing.DeleteRoutingHdl(rt_hdl, IPA_IP_v6) == false)
|
|
||||||
{
|
|
||||||
return IPACM_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
rt_hdl = get_client_memptr(eth_client, clt_indx)->eth_rt_hdl[tx_index].eth_rt_rule_hdl_v6_wan[num_v6];
|
|
||||||
if(m_routing.DeleteRoutingHdl(rt_hdl, IPA_IP_v6) == false)
|
|
||||||
{
|
|
||||||
return IPACM_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} /* end of for loop */
|
|
||||||
|
|
||||||
/* clean the ipv6 RT rules for eth-client:clt_indx */
|
|
||||||
if(get_client_memptr(eth_client, clt_indx)->route_rule_set_v6 != 0) /* for ipv6 */
|
|
||||||
{
|
|
||||||
get_client_memptr(eth_client, clt_indx)->route_rule_set_v6 = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return IPACM_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* handle eth client initial, construct full headers (tx property) */
|
|
||||||
int handle_eth_hdr_init(uint8_t *mac_addr);
|
|
||||||
|
|
||||||
/* handle eth client ip-address */
|
|
||||||
int handle_eth_client_ipaddr(ipacm_event_data_all *data);
|
|
||||||
|
|
||||||
/* handle eth client routing rule*/
|
|
||||||
int handle_eth_client_route_rule(uint8_t *mac_addr, ipa_ip_type iptype);
|
|
||||||
|
|
||||||
/*handle eth client del mode*/
|
|
||||||
int handle_eth_client_down_evt(uint8_t *mac_addr);
|
|
||||||
|
|
||||||
/* handle odu client initial, construct full headers (tx property) */
|
|
||||||
int handle_odu_hdr_init(uint8_t *mac_addr);
|
|
||||||
|
|
||||||
/* handle odu default route rule configuration */
|
|
||||||
int handle_odu_route_add();
|
|
||||||
|
|
||||||
/* handle odu default route rule deletion */
|
|
||||||
int handle_odu_route_del();
|
|
||||||
|
|
||||||
/*handle lan iface down event*/
|
|
||||||
int handle_down_evt();
|
|
||||||
|
|
||||||
/*handle reset usb-client rt-rules */
|
|
||||||
int handle_lan_client_reset_rt(ipa_ip_type iptype);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_LAN_H */
|
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IPACM_LanToLan.h
|
|
||||||
*
|
|
||||||
* Created on: Mar 4th, 2014
|
|
||||||
* Author: Shihuan Liu
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IPACM_LANTOLAN_H
|
|
||||||
#define IPACM_LANTOLAN_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "linux/msm_ipa.h"
|
|
||||||
#include "IPACM_Iface.h"
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
#include "IPACM_Lan.h"
|
|
||||||
|
|
||||||
#ifdef FEATURE_IPA_ANDROID
|
|
||||||
#include <libxml/list.h>
|
|
||||||
#else/* defined(FEATURE_IPA_ANDROID) */
|
|
||||||
#include <list>
|
|
||||||
#endif /* ndefined(FEATURE_IPA_ANDROID)*/
|
|
||||||
|
|
||||||
#define MAX_NUM_CACHED_CLIENT_ADD_EVENT 10
|
|
||||||
#define MAX_NUM_IFACE 10
|
|
||||||
#define MAX_NUM_CLIENT 16
|
|
||||||
|
|
||||||
struct rt_rule_info
|
|
||||||
{
|
|
||||||
int num_hdl[IPA_IP_MAX]; /* one client may need more than one routing rules on the same routing table depending on tx_prop */
|
|
||||||
uint32_t rule_hdl[IPA_IP_MAX][MAX_NUM_PROP];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct client_info
|
|
||||||
{
|
|
||||||
uint8_t mac_addr[6];
|
|
||||||
rt_rule_info inter_iface_rt_rule_hdl[IPA_HDR_L2_MAX]; /* routing rule handles of inter interface communication based on source l2 header type */
|
|
||||||
rt_rule_info intra_iface_rt_rule_hdl; /* routing rule handles of inter interface communication */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct flt_rule_info
|
|
||||||
{
|
|
||||||
client_info *p_client;
|
|
||||||
uint32_t flt_rule_hdl[IPA_IP_MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct peer_iface_info
|
|
||||||
{
|
|
||||||
class IPACM_LanToLan_Iface *peer;
|
|
||||||
char rt_tbl_name_for_rt[IPA_IP_MAX][IPA_RESOURCE_NAME_MAX];
|
|
||||||
char rt_tbl_name_for_flt[IPA_IP_MAX][IPA_RESOURCE_NAME_MAX];
|
|
||||||
list<flt_rule_info> flt_rule;
|
|
||||||
};
|
|
||||||
|
|
||||||
class IPACM_LanToLan_Iface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
IPACM_LanToLan_Iface(IPACM_Lan *p_iface);
|
|
||||||
~IPACM_LanToLan_Iface();
|
|
||||||
|
|
||||||
void add_client_rt_rule_for_new_iface();
|
|
||||||
|
|
||||||
void add_all_inter_interface_client_flt_rule(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
void add_all_intra_interface_client_flt_rule(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
void handle_down_event();
|
|
||||||
|
|
||||||
void handle_wlan_scc_mcc_switch();
|
|
||||||
|
|
||||||
void handle_intra_interface_info();
|
|
||||||
|
|
||||||
void handle_new_iface_up(char rt_tbl_name_for_flt[][IPA_RESOURCE_NAME_MAX], char rt_tbl_name_for_rt[][IPA_RESOURCE_NAME_MAX],
|
|
||||||
IPACM_LanToLan_Iface *peer_iface);
|
|
||||||
|
|
||||||
void handle_client_add(uint8_t *mac);
|
|
||||||
|
|
||||||
void handle_client_del(uint8_t *mac);
|
|
||||||
|
|
||||||
void print_data_structure_info();
|
|
||||||
|
|
||||||
IPACM_Lan* get_iface_pointer();
|
|
||||||
|
|
||||||
bool get_m_is_ip_addr_assigned(ipa_ip_type iptype);
|
|
||||||
|
|
||||||
void set_m_is_ip_addr_assigned(ipa_ip_type iptype, bool value);
|
|
||||||
|
|
||||||
bool get_m_support_inter_iface_offload();
|
|
||||||
|
|
||||||
bool get_m_support_intra_iface_offload();
|
|
||||||
|
|
||||||
void increment_ref_cnt_peer_l2_hdr_type(ipa_hdr_l2_type peer_l2_type);
|
|
||||||
|
|
||||||
void decrement_ref_cnt_peer_l2_hdr_type(ipa_hdr_l2_type peer_l2_type);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
IPACM_Lan *m_p_iface;
|
|
||||||
bool m_is_ip_addr_assigned[IPA_IP_MAX];
|
|
||||||
bool m_support_inter_iface_offload;
|
|
||||||
bool m_support_intra_iface_offload;
|
|
||||||
|
|
||||||
int ref_cnt_peer_l2_hdr_type[IPA_HDR_L2_MAX]; /* reference count of l2 header type of peer interfaces */
|
|
||||||
uint32_t hdr_proc_ctx_for_inter_interface[IPA_HDR_L2_MAX];
|
|
||||||
uint32_t hdr_proc_ctx_for_intra_interface;
|
|
||||||
|
|
||||||
list<client_info> m_client_info; /* client list */
|
|
||||||
list<peer_iface_info> m_peer_iface_info; /* peer information list */
|
|
||||||
|
|
||||||
/* The following members are for intra-interface communication*/
|
|
||||||
peer_iface_info m_intra_interface_info;
|
|
||||||
|
|
||||||
void add_one_client_flt_rule(IPACM_LanToLan_Iface *peer_iface, client_info *client);
|
|
||||||
|
|
||||||
void add_client_flt_rule(peer_iface_info *peer, client_info *client, ipa_ip_type iptype);
|
|
||||||
|
|
||||||
void del_one_client_flt_rule(IPACM_LanToLan_Iface *peer_iface, client_info *client);
|
|
||||||
|
|
||||||
void del_client_flt_rule(peer_iface_info *peer, client_info *client);
|
|
||||||
|
|
||||||
void add_client_rt_rule(peer_iface_info *peer, client_info *client);
|
|
||||||
|
|
||||||
void del_client_rt_rule(peer_iface_info *peer, client_info *client);
|
|
||||||
|
|
||||||
void clear_all_flt_rule_for_one_peer_iface(peer_iface_info *peer);
|
|
||||||
|
|
||||||
void clear_all_rt_rule_for_one_peer_iface(peer_iface_info *peer);
|
|
||||||
|
|
||||||
void add_hdr_proc_ctx(ipa_hdr_l2_type peer_l2_type);
|
|
||||||
|
|
||||||
void del_hdr_proc_ctx(ipa_hdr_l2_type peer_l2_type);
|
|
||||||
|
|
||||||
void print_peer_info(peer_iface_info *peer_info);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class IPACM_LanToLan : public IPACM_Listener
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
IPACM_LanToLan();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
~IPACM_LanToLan();
|
|
||||||
|
|
||||||
list<class IPACM_LanToLan_Iface> m_iface;
|
|
||||||
|
|
||||||
list<ipacm_event_eth_bridge> m_cached_client_add_event;
|
|
||||||
|
|
||||||
void handle_iface_up(ipacm_event_eth_bridge *data);
|
|
||||||
|
|
||||||
void handle_iface_down(ipacm_event_eth_bridge *data);
|
|
||||||
|
|
||||||
void handle_client_add(ipacm_event_eth_bridge *data);
|
|
||||||
|
|
||||||
void handle_client_del(ipacm_event_eth_bridge *data);
|
|
||||||
|
|
||||||
void handle_wlan_scc_mcc_switch(ipacm_event_eth_bridge *data);
|
|
||||||
|
|
||||||
void handle_new_iface_up(IPACM_LanToLan_Iface *new_iface, IPACM_LanToLan_Iface *exist_iface);
|
|
||||||
|
|
||||||
void event_callback(ipa_cm_event_id event, void* param);
|
|
||||||
|
|
||||||
void handle_cached_client_add_event(IPACM_Lan *p_iface);
|
|
||||||
|
|
||||||
void clear_cached_client_add_event(IPACM_Lan *p_iface);
|
|
||||||
|
|
||||||
void print_data_structure_info();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of The Linux Foundation nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
|
||||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
||||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|
||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
/*!
|
|
||||||
@file
|
|
||||||
IPACM_Listener.h
|
|
||||||
|
|
||||||
@brief
|
|
||||||
This file implements the abstract class notifier.
|
|
||||||
|
|
||||||
@Author
|
|
||||||
Skylar Chang
|
|
||||||
|
|
||||||
*/
|
|
||||||
#ifndef IPACM_LISTENER_H
|
|
||||||
#define IPACM_LISTENER_H
|
|
||||||
|
|
||||||
#include "IPACM_Defs.h"
|
|
||||||
#include "IPACM_CmdQueue.h"
|
|
||||||
|
|
||||||
/* abstract class notifier */
|
|
||||||
class IPACM_Listener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void event_callback(ipa_cm_event_id event, void *data) = 0;
|
|
||||||
virtual ~IPACM_Listener(void) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* IPACM_LISTENER_H */
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user