From 37f3a4a42517da857ff274b4707907b577d286ad Mon Sep 17 00:00:00 2001 From: Tq Date: Fri, 7 Aug 2015 02:47:26 -0400 Subject: [PATCH 1/3] Fix init_msm.h stuff Bang --- BoardConfig.mk | 6 +++--- cm.dependencies | 4 ++-- init/Android.mk | 17 +++++++++++++++++ init/init_msm.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 5 deletions(-) create mode 100644 init/Android.mk create mode 100644 init/init_msm.h diff --git a/BoardConfig.mk b/BoardConfig.mk index c0e324e..9c7c99a 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -41,7 +41,7 @@ TARGET_CPU_SMP := true TARGET_CPU_VARIANT := cortex-a7 #ARCH_ARM_HAVE_TLS_REGISTER := true TARGET_USE_QCOM_BIONIC_OPTIMIZATION := true - +CONFIG_HW_DISK_ENCRYPTION := false #Kernel BOARD_CUSTOM_BOOTIMG_MK := $(LOCAL_PATH)/mkbootimg.mk @@ -51,7 +51,7 @@ BOARD_KERNEL_PAGESIZE := 2048 BOARD_KERNEL_SEPARATED_DT := true BOARD_RAMDISK_OFFSET := 0x01000000 BOARD_KERNEL_TAGS_OFFSET := 0x00000100 -TARGET_KERNEL_SOURCE := kernel/motorola/surnia +TARGET_KERNEL_SOURCE := kernel/motorola/msm8916 TARGET_KERNEL_CONFIG := msm8916_defconfig BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 @@ -80,7 +80,7 @@ USE_DEVICE_SPECIFIC_CAMERA := true BOARD_HARDWARE_CLASS := $(LOCAL_PATH)/cmhw/src # Crypto -TARGET_HW_DISK_ENCRYPTION := true +TARGET_HW_DISK_ENCRYPTION := false # Display BOARD_EGL_CFG := $(LOCAL_PATH)/egl.cfg diff --git a/cm.dependencies b/cm.dependencies index ec34d76..560b0fb 100644 --- a/cm.dependencies +++ b/cm.dependencies @@ -20,8 +20,8 @@ "target_path": "frameworks/opt/connectivity" }, { - "repository": "android_device_qcom_common", - "target_path": "device/qcom/common" + "repository": "android_device_motorola_qcom-common", + "target_path": "device/motorola/qcom-common" } ] diff --git a/init/Android.mk b/init/Android.mk new file mode 100644 index 0000000..713ad6e --- /dev/null +++ b/init/Android.mk @@ -0,0 +1,17 @@ +ifeq ($(TARGET_INIT_VENDOR_LIB),libinit_msm) + +LOCAL_PATH := $(call my-dir) +LIBINIT_MSM_PATH := $(call my-dir) + +LIBINIT_USE_MSM_DEFAULT := $(shell if [ ! -f $(LIBINIT_MSM_PATH)/init_$(TARGET_BOARD_PLATFORM).c ]; then echo true; fi) + +include $(CLEAR_VARS) +LOCAL_MODULE_TAGS := optional +LOCAL_C_INCLUDES := system/core/init +LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" +LOCAL_SRC_FILES := init_surnia.c +LOCAL_MODULE := libinit_msm +include $(BUILD_STATIC_LIBRARY) + +endif + diff --git a/init/init_msm.h b/init/init_msm.h new file mode 100644 index 0000000..30d92ac --- /dev/null +++ b/init/init_msm.h @@ -0,0 +1,45 @@ +/* + 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 __INIT_MSM__H__ +#define __INIT_MSM__H__ + +#include + +#define PROP_HWROTATE "ro.sf.hwrotation" +#define PROP_LCDDENSITY "ro.sf.lcd_density" +#define PROP_QEMU_NAVKEY "qemu.hw.mainkeys" + +#define UNUSED(a) ((void)(a)) +#define ISMATCH(a,b) (!strncmp(a,b,PROP_VALUE_MAX)) + +void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *board_type); + +#endif /* __INIT_MSM__H__ */ + From 75202df8a4876c6c3351da3d80ab3833c6979a07 Mon Sep 17 00:00:00 2001 From: Tq Date: Fri, 7 Aug 2015 06:55:10 -0400 Subject: [PATCH 2/3] .dependencies & dtbToolCM prebuilt - Add qcom/common - Add dtbToolCM * Will try to address Boost now that configs have stabilized --- cm.dependencies | 8 ++++++-- dtbToolCM | Bin 0 -> 22874 bytes 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 dtbToolCM diff --git a/cm.dependencies b/cm.dependencies index 560b0fb..39df82d 100644 --- a/cm.dependencies +++ b/cm.dependencies @@ -1,7 +1,7 @@ [ { - "repository": "android_kernel_motorola_surnia", - "target_path": "kernel/motorola/surnia" + "repository": "android_kernel_motorola_msm8916", + "target_path": "kernel/motorola/msm8916" }, { "repository": "android_hardware_qcom_display-caf-new", @@ -19,6 +19,10 @@ "repository": "android_frameworks_opt_connectivity", "target_path": "frameworks/opt/connectivity" }, + { + "repository": "android_device_qcom_common", + "target_path": "device/qcom/common" + }, { "repository": "android_device_motorola_qcom-common", "target_path": "device/motorola/qcom-common" diff --git a/dtbToolCM b/dtbToolCM new file mode 100755 index 0000000000000000000000000000000000000000..adbbf7d6420c67bc9cdaa335a096ad9698846c94 GIT binary patch literal 22874 zcmeHve|%fTmG8*5h%xbx1VbE1le<8`K|tmawFd z&?Pmih)?dSrf!$Cf$hGR{@M?1m)-Q0vR?K%b`l!VAKPbmlxADnru5?rC6vmXPN$V>ot7)UQlw@0w3JAorNqS^2nMZQ2yLFrc>QMY8!pF ztM+X#ae*S*MTuC?_iReMbhW<{@lpQ!%}gS7aYm=T5*9kuavz2q+4+928pU|Cs;`(| zrd0cMsz|Z4H_*9a`O;orLvNrzx~E}J%Zi2-%NxVN#%69e=_lTeH|^k>v>)q0klG9f zVsID1uPTDiFM?C|6w?1>5&Y*x@Oz8k!$t5ris083!T(ngoO-2@{ogEtcNM|EUIhPm z5&X}J;CC0n|FsBy2DpJw{`DGwLhU-Q2yPa^DLxD7*;WKUzX*PR5q!J|{_P_8$BN*G zfX@;0g{!p#IU)4?BQQR@XgIDA1Aed17Z?!T!H~aSgd+p}U40?Z)f)`^31%R)SA?RG zu<&@o5pUOBp01v|Jl)=GnTwFN^F@4zmx%O63`(;MvHMV$Rz-iQcE!EUlwcq738aiMlUtfJPC zX#){YpEuAi?imO~`~s|0xCaFhq`Ufp{ffyWHg4IpcAclWak-UiZsfJ0M9lnGS^yIT zFp`v)133q>dLFF}1S)ApqotIv=tY5ZNyB->glqc74o+zVJ z9X7neLWStD;WSqD6|&*8HHdVN4Ts~cYtV*QS*Q>PY*el*v+r6%xZ~pyXXGdCHe@{Yl)_z zkUq@xN}_29q=%VqCYnM&J;?M`L{oFpA*L@OnnFF@!SqE$Q;4VAnVw5Dg?8G-bOq5A z(&;9qONgdWP8&?WyBsuyaJq)+GelG9rUlcl5ltbRo_Y_!;undgP)(m^`o~05h^8l) zewJto&Gb0a-zAztGJS;U<3!gIeVFMdiN1j7VW$5#(G+^=L8iY(G=*F`#Pk=5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Aug 2015 21:22:14 -0400 Subject: [PATCH 3/3] Update & Debloat Updated to reflect changed in CM12.1 branch. Removed reductive full_surnia.mk and changed the order of some things --- AndroidProducts.mk | 2 +- BoardConfig.mk | 9 +- cm.mk | 37 +- device.mk | 8 + doze/Android.mk | 16 + doze/AndroidManifest.xml | 46 + doze/proguard.flags | 3 + doze/res/values/strings.xml | 30 + doze/res/xml/gesture_panel.xml | 39 + .../device/BootCompletedReceiver.java | 35 + .../settings/device/MotoDozeService.java | 188 + .../device/TouchscreenGestureSettings.java | 104 + dtbToolCM | Bin 22874 -> 0 bytes init/init_surnia.c | 80 +- full_surnia.mk => liblight/Android.mk | 25 +- liblight/NOTICE | 190 + liblight/lights.c | 312 + .../base/core/res/res/values/config.xml | 72 +- .../core/res/res/xml-mcc310-mnc120/eri.xml | 766 + .../core/res/res/xml-mcc311-mnc490/eri.xml | 766 + .../core/res/res/xml-mcc311-mnc870/eri.xml | 766 + .../core/res/res/xml-mcc312-mnc530/eri.xml | 766 + .../core/res/res/xml-mcc316-mnc10/eri.xml | 766 + prebuilt/system/etc/apns-conf.xml | 28973 ++++++++++++++++ prebuilt/system/etc/boost/eri.xml | 185 + prebuilt/system/etc/mixer_paths.xml | 6 + rootdir/init.mmi.rc | 1 + rootdir/init.qcom.rc | 37 +- rootdir/init.surnia.sh | 21 + system.prop | 5 - vendorsetup.sh | 2 - 31 files changed, 34125 insertions(+), 131 deletions(-) create mode 100755 doze/Android.mk create mode 100755 doze/AndroidManifest.xml create mode 100755 doze/proguard.flags create mode 100755 doze/res/values/strings.xml create mode 100755 doze/res/xml/gesture_panel.xml create mode 100755 doze/src/com/cyanogenmod/settings/device/BootCompletedReceiver.java create mode 100755 doze/src/com/cyanogenmod/settings/device/MotoDozeService.java create mode 100755 doze/src/com/cyanogenmod/settings/device/TouchscreenGestureSettings.java delete mode 100755 dtbToolCM mode change 100644 => 100755 init/init_surnia.c rename full_surnia.mk => liblight/Android.mk (50%) mode change 100644 => 100755 create mode 100755 liblight/NOTICE create mode 100755 liblight/lights.c create mode 100755 overlay/frameworks/base/core/res/res/xml-mcc310-mnc120/eri.xml create mode 100755 overlay/frameworks/base/core/res/res/xml-mcc311-mnc490/eri.xml create mode 100755 overlay/frameworks/base/core/res/res/xml-mcc311-mnc870/eri.xml create mode 100755 overlay/frameworks/base/core/res/res/xml-mcc312-mnc530/eri.xml create mode 100755 overlay/frameworks/base/core/res/res/xml-mcc316-mnc10/eri.xml create mode 100755 prebuilt/system/etc/apns-conf.xml create mode 100755 prebuilt/system/etc/boost/eri.xml create mode 100755 rootdir/init.surnia.sh diff --git a/AndroidProducts.mk b/AndroidProducts.mk index aa71a74..3f88d35 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -15,4 +15,4 @@ # PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/full_surnia.mk + $(LOCAL_DIR)/cm.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index 9c7c99a..d26ee9f 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -60,6 +60,8 @@ BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x01000000 --tags_offset 0x00000100 # Audio BOARD_USES_ALSA_AUDIO := true TARGET_QCOM_AUDIO_VARIANT := caf +AUDIO_FEATURE_LOW_LATENCY_PRIMARY := true +TARGET_USES_QCOM_MM_AUDIO := true # ANT+ BOARD_ANT_WIRELESS_DEVICE := "vfs-prerelease" @@ -75,6 +77,9 @@ BLUETOOTH_HCI_USE_MCT := true TARGET_USE_VENDOR_CAMERA_EXT := true USE_DEVICE_SPECIFIC_CAMERA := true +# Asserts +TARGET_OTA_ASSERT_DEVICE := XT1514,XT1521,XT1524,XT1526,XT1527,XT1523,surnia_uds,surnia_umts,surnia,surnia_udstv + # CMHW BOARD_HARDWARE_CLASS := $(LOCAL_PATH)/cmhw/src @@ -114,6 +119,7 @@ ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=0 # Lights +TARGET_PROVIDES_LIBLIGHT := true # Media TARGET_ENABLE_QC_AV_ENHANCEMENTS := true @@ -146,9 +152,6 @@ TARGET_RECOVERY_FSTAB := $(LOCAL_PATH)/rootdir/fstab.qcom TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_USE_F2FS := true - -# RIL - # SELinux include device/qcom/sepolicy/sepolicy.mk diff --git a/cm.mk b/cm.mk index d91393f..8b4c6fa 100644 --- a/cm.mk +++ b/cm.mk @@ -1,35 +1,28 @@ # Copyright (C) 2014 The CyanogenMod Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Release name -PRODUCT_RELEASE_NAME := surnia - -# Boot animation + +# Resolution TARGET_SCREEN_WIDTH := 540 TARGET_SCREEN_HEIGHT := 960 -$(call inherit-product, device/motorola/surnia/full_surnia.mk) +# Phone Config +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) -# Inherit some common CM stuff. +# Phone Config continued $(call inherit-product, vendor/cm/config/common_full_phone.mk) +# Inherit from device.mk +$(call inherit-product, device/motorola/surnia/device.mk) + +# Vendor Files +$(call inherit-product-if-exists, vendor/motorola/surnia/surnia-vendor.mk) ## Device identifier. This must come after all inclusions -PRODUCT_DEVICE := surnia PRODUCT_NAME := cm_surnia +PRODUCT_DEVICE := surnia PRODUCT_BRAND := motorola -PRODUCT_MODEL := surnia +PRODUCT_MODEL := XT1526 PRODUCT_MANUFACTURER := motorola -PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 \ No newline at end of file +# OverRide +PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 + diff --git a/device.mk b/device.mk index 4ef2c05..6a46bc6 100644 --- a/device.mk +++ b/device.mk @@ -110,7 +110,11 @@ PRODUCT_PACKAGES += \ # OMX PRODUCT_PACKAGES += \ libdashplayer \ + libOmxAacEnc \ + libOmxAmrEnc \ libOmxCore \ + libOmxEvrcEnc \ + libOmxQcelp13Enc \ libOmxVdec \ libOmxVdecHevc \ libOmxVenc \ @@ -179,6 +183,10 @@ PRODUCT_PACKAGES += \ wpa_supplicant.conf \ dhcpcd.conf +# Doze +PRODUCT_PACKAGES += \ + MotoDoze + PRODUCT_PACKAGES += \ WCNSS_qcom_wlan_factory_nv.bin diff --git a/doze/Android.mk b/doze/Android.mk new file mode 100755 index 0000000..0b898d8 --- /dev/null +++ b/doze/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := MotoDoze +LOCAL_CERTIFICATE := platform +LOCAL_PRIVILEGED_MODULE := true + +LOCAL_PROGUARD_FLAG_FILES := proguard.flags + +include $(BUILD_PACKAGE) + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/doze/AndroidManifest.xml b/doze/AndroidManifest.xml new file mode 100755 index 0000000..e216023 --- /dev/null +++ b/doze/AndroidManifest.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doze/proguard.flags b/doze/proguard.flags new file mode 100755 index 0000000..3bb1f2c --- /dev/null +++ b/doze/proguard.flags @@ -0,0 +1,3 @@ +-keep class com.cyanogenmod.settings.device.* { + *; +} diff --git a/doze/res/values/strings.xml b/doze/res/values/strings.xml new file mode 100755 index 0000000..275570a --- /dev/null +++ b/doze/res/values/strings.xml @@ -0,0 +1,30 @@ + + + + + + Gestures + Use gestures to perform actions + + Ambient display + + Ambient display + Wake screen when you receive notifications + + Hand wave + Pulse notifications on hand wave + + Pocket + Pulse notifications on removal from pocket + diff --git a/doze/res/xml/gesture_panel.xml b/doze/res/xml/gesture_panel.xml new file mode 100755 index 0000000..482b827 --- /dev/null +++ b/doze/res/xml/gesture_panel.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + diff --git a/doze/src/com/cyanogenmod/settings/device/BootCompletedReceiver.java b/doze/src/com/cyanogenmod/settings/device/BootCompletedReceiver.java new file mode 100755 index 0000000..b9687f4 --- /dev/null +++ b/doze/src/com/cyanogenmod/settings/device/BootCompletedReceiver.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2015 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cyanogenmod.settings.device; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +public class BootCompletedReceiver extends BroadcastReceiver { + + private static final boolean DEBUG = false; + private static final String TAG = "MotoDoze"; + + @Override + public void onReceive(final Context context, Intent intent) { + if (DEBUG) Log.d(TAG, "Starting service"); + context.startService(new Intent(context, MotoDozeService.class)); + } + +} diff --git a/doze/src/com/cyanogenmod/settings/device/MotoDozeService.java b/doze/src/com/cyanogenmod/settings/device/MotoDozeService.java new file mode 100755 index 0000000..01aa3c4 --- /dev/null +++ b/doze/src/com/cyanogenmod/settings/device/MotoDozeService.java @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2015 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cyanogenmod.settings.device; + +import android.app.Service; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.SharedPreferences; +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; +import android.os.IBinder; +import android.os.PowerManager; +import android.preference.PreferenceManager; +import android.provider.Settings; +import android.util.Log; + +import java.util.ArrayList; +import java.util.List; + +public class MotoDozeService extends Service { + private static final String TAG = "MotoDozeService"; + private static final boolean DEBUG = false; + + private static final String GESTURE_HAND_WAVE_KEY = "gesture_hand_wave"; + private static final String GESTURE_POCKET_KEY = "gesture_pocket"; + + private static final int POCKET_DELTA_NS = 1000 * 1000 * 1000; + + private Context mContext; + private MotoProximitySensor mSensor; + private PowerManager mPowerManager; + + private boolean mHandwaveGestureEnabled = false; + private boolean mPocketGestureEnabled = false; + + class MotoProximitySensor implements SensorEventListener { + private SensorManager mSensorManager; + private Sensor mSensor; + + private boolean mSawNear = false; + private long mInPocketTime = 0; + + public MotoProximitySensor(Context context) { + mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); + mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); + } + + @Override + public void onSensorChanged(SensorEvent event) { + boolean isNear = event.values[0] < mSensor.getMaximumRange(); + if (mSawNear && !isNear) { + if (shouldPulse(event.timestamp)) { + launchDozePulse(); + } + } else { + mInPocketTime = event.timestamp; + } + mSawNear = isNear; + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) { + /* Empty */ + } + + private boolean shouldPulse(long timestamp) { + long delta = timestamp - mInPocketTime; + + if (mHandwaveGestureEnabled && mPocketGestureEnabled) { + return true; + } else if (mHandwaveGestureEnabled && !mPocketGestureEnabled) { + return delta < POCKET_DELTA_NS; + } else if (!mHandwaveGestureEnabled && mPocketGestureEnabled) { + return delta >= POCKET_DELTA_NS; + } + return false; + } + + public void enable() { + if (mHandwaveGestureEnabled || mPocketGestureEnabled) { + mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL); + } + } + + public void disable() { + mSensorManager.unregisterListener(this, mSensor); + } + } + + @Override + public void onCreate() { + if (DEBUG) Log.d(TAG, "MotoDozeService Started"); + mContext = this; + mPowerManager = (PowerManager)getSystemService(Context.POWER_SERVICE); + mSensor = new MotoProximitySensor(mContext); + SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); + loadPreferences(sharedPrefs); + sharedPrefs.registerOnSharedPreferenceChangeListener(mPrefListener); + if (!isInteractive() && isDozeEnabled()) { + mSensor.enable(); + } + } + + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + if (DEBUG) Log.d(TAG, "Starting service"); + IntentFilter screenStateFilter = new IntentFilter(Intent.ACTION_SCREEN_ON); + screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF); + mContext.registerReceiver(mScreenStateReceiver, screenStateFilter); + return START_STICKY; + } + + @Override + public IBinder onBind(Intent intent) { + return null; + } + + private void launchDozePulse() { + mContext.sendBroadcast(new Intent("com.android.systemui.doze.pulse")); + } + + private boolean isInteractive() { + return mPowerManager.isInteractive(); + } + + private boolean isDozeEnabled() { + return Settings.Secure.getInt(mContext.getContentResolver(), + Settings.Secure.DOZE_ENABLED, 1) != 0; + } + + private void onDisplayOn() { + if (DEBUG) Log.d(TAG, "Display on"); + mSensor.disable(); + } + + private void onDisplayOff() { + if (DEBUG) Log.d(TAG, "Display off"); + if (isDozeEnabled()) { + mSensor.enable(); + } + } + + private void loadPreferences(SharedPreferences sharedPreferences) { + mHandwaveGestureEnabled = sharedPreferences.getBoolean(GESTURE_HAND_WAVE_KEY, false); + mPocketGestureEnabled = sharedPreferences.getBoolean(GESTURE_POCKET_KEY, false); + } + + private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { + onDisplayOff(); + } else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { + onDisplayOn(); + } + } + }; + + private SharedPreferences.OnSharedPreferenceChangeListener mPrefListener = + new SharedPreferences.OnSharedPreferenceChangeListener() { + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { + if (GESTURE_HAND_WAVE_KEY.equals(key)) { + mHandwaveGestureEnabled = sharedPreferences.getBoolean(GESTURE_HAND_WAVE_KEY, false); + } else if (GESTURE_POCKET_KEY.equals(key)) { + mPocketGestureEnabled = sharedPreferences.getBoolean(GESTURE_POCKET_KEY, false); + } + } + }; +} diff --git a/doze/src/com/cyanogenmod/settings/device/TouchscreenGestureSettings.java b/doze/src/com/cyanogenmod/settings/device/TouchscreenGestureSettings.java new file mode 100755 index 0000000..cd38603 --- /dev/null +++ b/doze/src/com/cyanogenmod/settings/device/TouchscreenGestureSettings.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2015 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.cyanogenmod.settings.device; + +import com.android.internal.util.cm.ScreenType; + +import android.app.ActionBar; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.SwitchPreference; +import android.provider.Settings; +import android.view.Menu; +import android.view.MenuItem; + +public class TouchscreenGestureSettings extends PreferenceActivity { + + private static final String KEY_AMBIENT_DISPLAY_ENABLE = "ambient_display_enable"; + private static final String KEY_GESTURE_POCKET = "gesture_pocket"; + private static final String KEY_GESTURE_HAND_WAVE = "gesture_hand_wave"; + + private SwitchPreference mAmbientDisplayPreference; + private SwitchPreference mPocketPreference; + private SwitchPreference mHandwavePreference; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.gesture_panel); + boolean dozeEnabled = isDozeEnabled(); + mAmbientDisplayPreference = + (SwitchPreference) findPreference(KEY_AMBIENT_DISPLAY_ENABLE); + // Read from DOZE_ENABLED secure setting + mAmbientDisplayPreference.setChecked(dozeEnabled); + mAmbientDisplayPreference.setOnPreferenceChangeListener(mAmbientDisplayPrefListener); + mPocketPreference = + (SwitchPreference) findPreference(KEY_GESTURE_POCKET); + mPocketPreference.setEnabled(dozeEnabled); + mHandwavePreference = + (SwitchPreference) findPreference(KEY_GESTURE_HAND_WAVE); + mHandwavePreference.setEnabled(dozeEnabled); + + final ActionBar bar = getActionBar(); + bar.setDisplayHomeAsUpEnabled(true); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + onBackPressed(); + return true; + } + return false; + } + + @Override + protected void onResume() { + super.onResume(); + + // If running on a phone, remove padding around the listview + if (!ScreenType.isTablet(this)) { + getListView().setPadding(0, 0, 0, 0); + } + } + + private boolean enableDoze(boolean enable) { + return Settings.Secure.putInt(getContentResolver(), + Settings.Secure.DOZE_ENABLED, enable ? 1 : 0); + } + + private boolean isDozeEnabled() { + return Settings.Secure.getInt(getContentResolver(), + Settings.Secure.DOZE_ENABLED, 1) != 0; + } + + private Preference.OnPreferenceChangeListener mAmbientDisplayPrefListener = + new Preference.OnPreferenceChangeListener() { + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + boolean enable = (boolean) newValue; + boolean ret = enableDoze(enable); + if (ret) { + mPocketPreference.setEnabled(enable); + mHandwavePreference.setEnabled(enable); + } + return ret; + } + }; +} diff --git a/dtbToolCM b/dtbToolCM deleted file mode 100755 index adbbf7d6420c67bc9cdaa335a096ad9698846c94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22874 zcmeHve|%fTmG8*5h%xbx1VbE1le<8`K|tmawFd z&?P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<`6m~z#eC9Xhd5t~Z##Ovuosq! z3x%Esa&dgS(c{}zP>OFadfeJz*q=RbCKu0N73Fv;6K~RR%(-Y8bKt3bzWwyQu|!mg z3ANs7p+<#^N|%N>rQt~Y`QKMR0^9*R-D=*^|O{ zh4AC7XO5`5)`eX5nn1RYABdxno)=hj?u>YNgZ0ep_p^#$e-CF8w{u~rL(J^=MZo8h z|F3p2tDeJ_5?)d%PAgomGb@;1Yt5$aA~^lVHaE*=QDoFH4kuZRzie@Xvu`3;E%4#%InmON#Kj zir{w?!J|cR6F8z%7_A*_y7mwK=|v$szs&se#cg@~j}_rRruaJ)zuxbCw+R2wi{NL9 z;N@5>3)#7_2)-IP^;iDecJ*mPzk;Zj>o}G2T=N8x(Eo9uT zLFKy!BH>6BZyI*tq_xfKZuV^1bjx;+NBH~${#^lj;lvZ^^WX@#e!NRp0P=WzLC>z< zV5hg&ZUrH`Vc1L)*=dbt=MfEU_Z0PG9pf}Ty= zw|cT3-@bJn`Fp#!v)3=^A)Gw@j*s%o6_hXBz&0@Q0eiW{Y%HItmy3J+{Af=e>6cri z4)n_fW#iEvoDY~+LZ;ac7R;6|w;u+Wg~?g+yun<|7xB=Wi1M(&{Gu)oy#T6CCd@75 zw-r6RoAq&nxutycU;zkkyyc?wESHWs%tdD$P?%qA>l}FkVm?F8*@YMe;h?7nFLR>1 zJe#(`cfLTs2QQ8K_(eB_0KN2tlNAwYeEMOoI(6b>E*SC-g#8|RK1+IS$0}0LQkYBC zcpFZg*_bPip@)GX#{k~ETZi}UHsN(Q7=Y)#3g@F4`Bgy=9LHxq<|^T1By*vS{)l>K zk=5}bmAM@BmK=sx7)LyA-tD..so +include $(CLEAR_VARS) -# Device identifier. This must come after all inclusions -PRODUCT_DEVICE := surnia -PRODUCT_NAME := full_surnia -PRODUCT_BRAND := motorola -PRODUCT_MODEL := surnia -PRODUCT_MANUFACTURER := motorola +LOCAL_SRC_FILES := lights.c +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_SHARED_LIBRARIES := liblog +LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM) +LOCAL_MODULE_TAGS := optional -$(call inherit-product-if-exists, vendor/motorola/surnia/surnia-vendor.mk) +include $(BUILD_SHARED_LIBRARY) diff --git a/liblight/NOTICE b/liblight/NOTICE new file mode 100755 index 0000000..316b4eb --- /dev/null +++ b/liblight/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2014, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/liblight/lights.c b/liblight/lights.c new file mode 100755 index 0000000..4bfa442 --- /dev/null +++ b/liblight/lights.c @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2014 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/******************************************************************************/ + +#define MAX_PATH_SIZE 80 +#define LOG_TAG "lights" + +static pthread_once_t g_init = PTHREAD_ONCE_INIT; +static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; +static struct light_state_t g_notification; +static struct light_state_t g_battery; +static int g_attention = 0; + +char const*const WHITE_LED_FILE + = "/sys/class/leds/charging/brightness"; + +char const*const LCD_FILE + = "/sys/class/leds/lcd-backlight/brightness"; + +char const *const WHITE_LED_TRIGGER = "/sys/class/leds/charging/trigger"; +char const *const WHITE_LED_DELAY_ON = "/sys/class/leds/charging/delay_on"; +char const *const WHITE_LED_DELAY_OFF = "/sys/class/leds/charging/delay_off"; +/** + * device methods + */ + +void init_globals(void) +{ + // init the mutex + pthread_mutex_init(&g_lock, NULL); +} + +static int +write_int(char const* path, int value) +{ + int fd; + static int already_warned = 0; + + fd = open(path, O_RDWR); + if (fd >= 0) { + char buffer[20]; + int bytes = sprintf(buffer, "%d\n", value); + int amt = write(fd, buffer, bytes); + close(fd); + return amt == -1 ? -errno : 0; + } else { + if (already_warned == 0) { + ALOGE("write_int failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } +} + +static int +write_str(char const* path, char *value) +{ + int fd; + static int already_warned = 0; + + fd = open(path, O_RDWR); + if (fd >= 0) { + char buffer[PAGE_SIZE]; + int bytes = sprintf(buffer, "%s\n", value); + int amt = write(fd, buffer, bytes); + close(fd); + return amt == -1 ? -errno : 0; + } else { + if (already_warned == 0) { + ALOGE("write_str failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } +} + +static int +is_lit(struct light_state_t const* state) +{ + return state->color & 0x00ffffff; +} + +static int +rgb_to_brightness(struct light_state_t const* state) +{ + int color = state->color & 0x00ffffff; + return ((77*((color>>16)&0x00ff)) + + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; +} + +static int +set_light_backlight(struct light_device_t* dev, + struct light_state_t const* state) +{ + int err = 0; + int brightness = rgb_to_brightness(state); + pthread_mutex_lock(&g_lock); + err = write_int(LCD_FILE, brightness); + pthread_mutex_unlock(&g_lock); + return err; +} + +static int +set_speaker_light_locked(struct light_device_t* dev, + struct light_state_t const* state) +{ + int len; + int blink; + int onMS, offMS, ramp; + unsigned int colorRGB; + char blink_pattern[PAGE_SIZE]; + + switch (state->flashMode) { + case LIGHT_FLASH_TIMED: + onMS = state->flashOnMS; + offMS = state->flashOffMS; + break; + case LIGHT_FLASH_NONE: + default: + onMS = 0; + offMS = 0; + break; + } + + colorRGB = state->color; +#if 1 + ALOGD("set_speaker_light_locked mode %d, colorRGB=%08X, onMS=%d, offMS=%d\n", + state->flashMode, colorRGB, onMS, offMS); +#endif + + + if (onMS > 0 && offMS > 0) { + + blink = 1; + ramp = 1; + } else { + blink = 0; + ramp = 0; + } + + // See hardware/libhardware/include/hardware/lights.h + int brightness = ((77 * ((colorRGB >> 16) & 0xFF)) + + (150 * ((colorRGB >> 8) & 0xFF)) + + (29 * (colorRGB & 0xFF))) >> 8; + write_int(WHITE_LED_FILE, (int) brightness); + + if (blink) { + write_str(WHITE_LED_TRIGGER, "notification"); + sprintf(blink_pattern, "%d", onMS); + write_str(WHITE_LED_DELAY_ON, blink_pattern); + sprintf(blink_pattern, "%d", offMS); + write_str(WHITE_LED_DELAY_OFF, blink_pattern); + }else{ + write_str(WHITE_LED_TRIGGER, "none"); + } + + return brightness; +} + +static void +handle_speaker_battery_locked(struct light_device_t* dev) +{ + int res = set_speaker_light_locked(dev, &g_notification); + if (res){ + ALOGD("notification on\n"); + return; + } + res = set_speaker_light_locked(dev, &g_battery); + if (res){ + ALOGD("battery on\n"); + }else{ + ALOGD("no notification\n"); + } +} + +static int +set_light_notifications(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + ALOGD("notification light %d\n", state->color); + g_notification = *state; + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} + +static int +set_light_attention(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + if (state->flashMode == LIGHT_FLASH_HARDWARE) { + g_attention = state->flashOnMS; + } else if (state->flashMode == LIGHT_FLASH_NONE) { + g_attention = 0; + } + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} + +static int +set_light_battery(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + g_battery = *state; + ALOGD("batterie led\n"); + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} + + + +/** Close the lights device */ +static int +close_lights(struct light_device_t *dev) +{ + if (dev) { + free(dev); + } + return 0; +} + + +/******************************************************************************/ + +/** + * module methods + */ + +/** Open a new instance of a lights device using name */ +static int open_lights(const struct hw_module_t* module, char const* name, + struct hw_device_t** device) +{ + int (*set_light)(struct light_device_t* dev, + struct light_state_t const* state); + + if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) + set_light = set_light_backlight; + else if (0 == strcmp(LIGHT_ID_BATTERY, name)) + set_light = set_light_battery; + else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) + set_light = set_light_notifications; + else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) + set_light = set_light_attention; + else + return -EINVAL; + + pthread_once(&g_init, init_globals); + + struct light_device_t *dev = malloc(sizeof(struct light_device_t)); + memset(dev, 0, sizeof(*dev)); + + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = 0; + dev->common.module = (struct hw_module_t*)module; + dev->common.close = (int (*)(struct hw_device_t*))close_lights; + dev->set_light = set_light; + + *device = (struct hw_device_t*)dev; + return 0; +} + +static struct hw_module_methods_t lights_module_methods = { + .open = open_lights, +}; + +/* + * The lights Module + * Based on dhacker29 module + */ +struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = LIGHTS_HARDWARE_MODULE_ID, + .name = "MSM8916 lights Module", + .author = "Google, Inc., scritch007", + .methods = &lights_module_methods, +}; diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 11c2301..58c40e0 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -154,44 +154,6 @@ 7 - - - - - - wifi,1,1,1,-1,true - mobile,0,0,0,-1,true - mobile_mms,2,0,2,60000,true - mobile_supl,3,0,2,-1,true - mobile_dun,4,0,2,60000,true - mobile_hipri,5,0,3,60000,true - mobile_fota,10,0,2,-1,true - mobile_ims,11,0,2,-1,true - mobile_cbs,12,0,2,60000,true - wifi_p2p,13,1,0,-1,true - ethernet,9,9,1,-1,true - bluetooth,7,7,1,-1,true - mobile_stdhipri,36,0,2,60000,true - mobile_800apn,37,0,2,60000,true - - - - - - 1,1 - 0,1 - 7,1 - 9,1 - - true @@ -242,9 +204,9 @@ false - 4 + 1 - true + false + com.motorola.motgeofencesvc + + + com.qualcomm.location + + + + 10 + + + true + + com.android.systemui/com.android.systemui.doze.DozeService + + + + + + + + "default" + "dun" + "mms" + "supl" + + diff --git a/overlay/frameworks/base/core/res/res/xml-mcc310-mnc120/eri.xml b/overlay/frameworks/base/core/res/res/xml-mcc310-mnc120/eri.xml new file mode 100755 index 0000000..60cd5c0 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml-mcc310-mnc120/eri.xml @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/xml-mcc311-mnc490/eri.xml b/overlay/frameworks/base/core/res/res/xml-mcc311-mnc490/eri.xml new file mode 100755 index 0000000..ffd21e5 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml-mcc311-mnc490/eri.xml @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/xml-mcc311-mnc870/eri.xml b/overlay/frameworks/base/core/res/res/xml-mcc311-mnc870/eri.xml new file mode 100755 index 0000000..9123469 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml-mcc311-mnc870/eri.xml @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/xml-mcc312-mnc530/eri.xml b/overlay/frameworks/base/core/res/res/xml-mcc312-mnc530/eri.xml new file mode 100755 index 0000000..60cd5c0 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml-mcc312-mnc530/eri.xml @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/xml-mcc316-mnc10/eri.xml b/overlay/frameworks/base/core/res/res/xml-mcc316-mnc10/eri.xml new file mode 100755 index 0000000..60cd5c0 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml-mcc316-mnc10/eri.xml @@ -0,0 +1,766 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prebuilt/system/etc/apns-conf.xml b/prebuilt/system/etc/apns-conf.xml new file mode 100755 index 0000000..6d207da --- /dev/null +++ b/prebuilt/system/etc/apns-conf.xml @@ -0,0 +1,28973 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prebuilt/system/etc/boost/eri.xml b/prebuilt/system/etc/boost/eri.xml new file mode 100755 index 0000000..7f77ac0 --- /dev/null +++ b/prebuilt/system/etc/boost/eri.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/prebuilt/system/etc/mixer_paths.xml b/prebuilt/system/etc/mixer_paths.xml index acd4f73..8388b88 100644 --- a/prebuilt/system/etc/mixer_paths.xml +++ b/prebuilt/system/etc/mixer_paths.xml @@ -67,6 +67,7 @@ + @@ -253,6 +254,11 @@ + + + + + diff --git a/rootdir/init.mmi.rc b/rootdir/init.mmi.rc index a7c196a..6b500ea 100755 --- a/rootdir/init.mmi.rc +++ b/rootdir/init.mmi.rc @@ -45,6 +45,7 @@ on moto-charger on early-boot exec /system/bin/sh /init.mmi.early_boot.sh + exec /system/bin/sh /init.surnia.sh on boot # Change ownership and permission for backlight diff --git a/rootdir/init.qcom.rc b/rootdir/init.qcom.rc index 3d32fd3..9818ccb 100755 --- a/rootdir/init.qcom.rc +++ b/rootdir/init.qcom.rc @@ -56,9 +56,6 @@ on init symlink /storage/emulated/legacy /mnt/sdcard symlink /storage/emulated/legacy /storage/sdcard0 - # CM: We use our own ril-daemon service definition, see mmi-ril-daemon - stop ril-daemon - # Configure coredump write /proc/sys/kernel/core_pattern "|/system/bin/coredump %e %p %t" write /proc/self/coredump_filter "0x7f" @@ -91,6 +88,9 @@ on fs exec /system/bin/chmod -L 640 /dev/block/platform/soc.0/by-name/logs exec /system/bin/chown -L root:system /dev/block/platform/soc.0/by-name/logs + mkdir /persist/data 0700 system system + restorecon_recursive /persist + # activate zram swapon_all fstab.qcom write /proc/sys/vm/page-cluster 0 @@ -413,12 +413,6 @@ service qcom-c_core-sh /system/bin/sh /init.qcom.class_core.sh user root oneshot -service qcom-c_main-sh /system/bin/sh /init.class_main.sh - class main - user radio - group radio - oneshot - on property:vold.decrypt=trigger_restart_framework start config_bluetooth @@ -563,7 +557,7 @@ service wpa_supplicant /system/bin/wpa_supplicant \ disabled oneshot -service dhcpcd_wlan0 /system/bin/dhcpcd +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG class late_start disabled oneshot @@ -699,7 +693,14 @@ on property:ro.data.large_tcp_window_size=true # group system # disabled -service mmi-ril-daemon /system/bin/rild +on property:persist.radio.multisim.config=dsds + start ril-daemon2 + +on property:vold.decrypt=trigger_restart_framework + stop ril-daemon + + +service redefine ril-daemon /system/bin/rild class main socket rild stream 660 root radio socket rild-debug stream 660 radio system @@ -713,15 +714,7 @@ service ril-daemon2 /system/bin/rild -c 2 socket rild-debug2 stream 660 radio system user root disabled - group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log - -service ril-daemon3 /system/bin/rild -c 3 - class main - socket rild3 stream 660 root radio - socket rild-debug3 stream 660 radio system - user root - disabled - group radio cache inet misc audio sdcard_r sdcard_rw diag qcom_diag log + group radio cache inet misc audio sdcard_rw sensors qcom_diag log net_raw diag service usb_uicc_daemon /system/bin/usb_uicc_client class main @@ -729,6 +722,10 @@ service usb_uicc_daemon /system/bin/usb_uicc_client group system log net_raw oneshot +on property:hw.fm.mode=* + insmod /system/lib/modules/radio-iris-transport.ko + + on property:sys.usb_uicc.enabled=1 start usb_uicc_enable diff --git a/rootdir/init.surnia.sh b/rootdir/init.surnia.sh new file mode 100755 index 0000000..0942779 --- /dev/null +++ b/rootdir/init.surnia.sh @@ -0,0 +1,21 @@ +#!/system/bin/sh +PATH=/system/bin + +product_model=`getprop ro.product.model` + +if [ "XT1526" = $product_model ]; then + log -t$TAG "Applying LTE fix" + setprop ro.cdma.home.operator.numeric 311870 + setprop ro.cdma.home.operator.alpha "Boost Mobile" + setprop ro.product.locale.region "US" + setprop gsm.sim.operator.alpha "Boost Mobile" + setprop gsm.sim.operator.numeric 311870 + setprop gsm.operator.alpha "Boost Mobile" + setprop gsm.operator.numeric 311870 + setprop gsm.sim.operator.iso-country "US" + #setprop "gsm.operator.iso-country" "US" + #setprop ro.telephony.default_network 8 + #Now copy the eri.xml to /data/eri.xml + cp /system/etc/boost/eri.xml /data/eri.xml +fi + diff --git a/system.prop b/system.prop index 3ea8de2..313f66a 100644 --- a/system.prop +++ b/system.prop @@ -17,17 +17,12 @@ persist.rild.nitz_short_ons_1= persist.rild.nitz_short_ons_2= persist.rild.nitz_short_ons_3= persist.radio.rat_on=combine -ril.subscription.types=NV,RUIM persist.mot.gps.assisted=false -persist.radio.plmn_name_cmp=1 persist.radio.process_sups_ind=0 -ro.gsm.data_retry_config=default_randomization=2000,max_retries=infinite,1000,1000,80000,125000,485000,905000 persist.radio.apm_sim_not_pwdn=1 persist.radio.no_wait_for_card=1 persist.radio.relay_oprt_change=1 persist.radio.dfr_mode_set=1 -persist.radio.mot_ecc_custid=emea -persist.radio.mot_ecc_enabled=1 persist.radio.apn_delay=5000 # # system props for the cne module diff --git a/vendorsetup.sh b/vendorsetup.sh index fa731eb..2d1c36e 100644 --- a/vendorsetup.sh +++ b/vendorsetup.sh @@ -1,3 +1 @@ -add_lunch_combo omni_surnia-userdebug -add_lunch_combo slim_surnia-userdebug add_lunch_combo cm_surnia-userdebug