aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Shields <simon@lineageos.org>2017-08-26 22:00:20 +0530
committerdev-harsh1998 <harshitjain6751@gmail.com>2017-10-18 12:36:11 +0530
commit178608b0e7979448c4766e768137c973d900be6d (patch)
treef6b5480cb5ef32f28a9c239c7543ca1f1de501c4
parent2b208d62aa9bc2c5ef49c726d65516b00cc550b0 (diff)
a6000: Move lineage specific overlays to a dedicated folder
* Kill old init Change-Id: I1a2f8c872c1d1a93cb9f9a6ff4987570bdb714b2
-rw-r--r--device.mk4
-rw-r--r--init/init_a6000.cpp213
-rw-r--r--overlay-lineage/frameworks/base/core/res/res/values/config.xml81
-rw-r--r--overlay/frameworks/base/core/res/res/values/config.xml68
4 files changed, 87 insertions, 279 deletions
diff --git a/device.mk b/device.mk
index abc434e..ad925c9 100644
--- a/device.mk
+++ b/device.mk
@@ -18,7 +18,9 @@
$(call inherit-product, device/cyanogen/msm8916-common/msm8916.mk)
# Overlay
-DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
+DEVICE_PACKAGE_OVERLAYS += \
+ $(LOCAL_PATH)/overlay \
+ $(LOCAL_PATH)/overlay-lineage
# Include package config fragments
include $(LOCAL_PATH)/product/*.mk
diff --git a/init/init_a6000.cpp b/init/init_a6000.cpp
deleted file mode 100644
index 7580c93..0000000
--- a/init/init_a6000.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- Copyright (c) 2016, The CyanogenMod Project
-
- 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.
- */
-
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
-#include <sys/_system_properties.h>
-#include <unistd.h>
-#include "init_msm8916.h"
-#include "property_service.h"
-#include <sys/sysinfo.h>
-#include "vendor_init.h"
-#include "log.h"
-#include "util.h"
-
-void property_override(char const prop[], char const value[])
-{
- prop_info *pi;
-
- pi = (prop_info*) __system_property_find(prop);
- if (pi)
- __system_property_update(pi, value, strlen(value));
- else
- __system_property_add(prop, strlen(prop), value, strlen(value));
-}
-
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-#define ALPHABET_LEN 256
-#define KB 1024
-
-#define IMG_PART_PATH "/dev/block/bootdevice/by-name/modem"
-#define IMG_VER_STR "QC_IMAGE_VERSION_STRING="
-#define IMG_VER_STR_LEN 24
-#define IMG_VER_BUF_LEN 255
-#define IMG_SZ 32000 * KB /* MMAP 32000K of modem, modem partition is 64000K */
-
-/* Boyer-Moore string search implementation from Wikipedia */
-
-/* Return longest suffix length of suffix ending at str[p] */
-static int max_suffix_len(const char *str, size_t str_len, size_t p) {
- uint32_t i;
-
- for (i = 0; (str[p - i] == str[str_len - 1 - i]) && (i < p); ) {
- i++;
- }
-
- return i;
-}
-
-/* Generate table of distance between last character of pat and rightmost
- * occurrence of character c in pat
-*/
-static void bm_make_delta1(int *delta1, const char *pat, size_t pat_len) {
- uint32_t i;
- for (i = 0; i < ALPHABET_LEN; i++) {
- delta1[i] = pat_len;
- }
- for (i = 0; i < pat_len - 1; i++) {
- uint8_t idx = (uint8_t) pat[i];
- delta1[idx] = pat_len - 1 - i;
- }
-}
-
-/* Generate table of next possible full match from mismatch at pat[p] */
-static void bm_make_delta2(int *delta2, const char *pat, size_t pat_len) {
- int p;
- uint32_t last_prefix = pat_len - 1;
-
- for (p = pat_len - 1; p >= 0; p--) {
- /* Compare whether pat[p-pat_len] is suffix of pat */
- if (strncmp(pat + p, pat, pat_len - p) == 0) {
- last_prefix = p + 1;
- }
- delta2[p] = last_prefix + (pat_len - 1 - p);
- }
-
- for (p = 0; p < (int) pat_len - 1; p++) {
- /* Get longest suffix of pattern ending on character pat[p] */
- int suf_len = max_suffix_len(pat, pat_len, p);
- if (pat[p - suf_len] != pat[pat_len - 1 - suf_len]) {
- delta2[pat_len - 1 - suf_len] = pat_len - 1 - p + suf_len;
- }
- }
-}
-
-static char * bm_search(const char *str, size_t str_len, const char *pat, size_t pat_len) {
- int delta1[ALPHABET_LEN];
- int delta2[pat_len];
- int i;
-
- bm_make_delta1(delta1, pat, pat_len);
- bm_make_delta2(delta2, pat, pat_len);
-
- if (pat_len == 0) {
- return (char *) str;
- }
-
- i = pat_len - 1;
- while (i < (int) str_len) {
- int j = pat_len - 1;
- while (j >= 0 && (str[i] == pat[j])) {
- i--;
- j--;
- }
- if (j < 0) {
- return (char *) (str + i + 1);
- }
- i += MAX(delta1[(uint8_t) str[i]], delta2[j]);
- }
-
- return NULL;
-}
-
-static int get_img_version(char *ver_str, size_t len) {
- int ret = 0;
- int fd;
- char *img_data = NULL;
- char *offset = NULL;
-
- fd = open(IMG_PART_PATH, O_RDONLY);
- if (fd < 0) {
- ret = errno;
- goto err_ret;
- }
-
- img_data = (char *) mmap(NULL, IMG_SZ, PROT_READ, MAP_PRIVATE, fd, 0);
- if (img_data == (char *)-1) {
- ret = errno;
- goto err_fd_close;
- }
-
- /* Do Boyer-Moore search across IMG data */
- offset = bm_search(img_data, IMG_SZ, IMG_VER_STR, IMG_VER_STR_LEN);
- if (offset != NULL) {
- strncpy(ver_str, offset + IMG_VER_STR_LEN, len);
- } else {
- ret = -ENOENT;
- }
-
- munmap(img_data, IMG_SZ);
-err_fd_close:
- close(fd);
-err_ret:
- return ret;
-}
-
-int is2GB()
-{
- struct sysinfo sys;
- sysinfo(&sys);
- return sys.totalram > 1024ull * 1024 * 1024;
-}
-
-void init_target_properties()
-{
- char modem_version[IMG_VER_BUF_LEN];
- int rc;
- std::string product = property_get("ro.product.name");
- if ((strstr(product.c_str(), "a6000") == NULL))
- return;
-
- rc = get_img_version(modem_version, IMG_VER_BUF_LEN);
- if (!rc) {
- property_set("gsm.version.baseband", modem_version);
- ERROR("Detected modem version=%s\n", modem_version);
-}
-
- property_override("ro.build.product", "Kraft-A6000");
- property_override("ro.product.device", "Kraft-A6000");
- property_override("ro.product.model", "Lenovo A6000");
- property_override("ro.product.name", "Kraft-A6000");
- property_set("dalvik.vm.heapstartsize", "8m");
- property_set("dalvik.vm.heapgrowthlimit", is2GB() ? "192m" : "96m");
- property_set("dalvik.vm.heapsize", is2GB() ? "512m" : "256m");
- property_set("dalvik.vm.heaptargetutilization", "0.75");
- property_set("dalvik.vm.heapminfree", is2GB() ? "512k" : "2m");
- property_set("dalvik.vm.heapmaxfree", "8m");
-
-}
diff --git a/overlay-lineage/frameworks/base/core/res/res/values/config.xml b/overlay-lineage/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..ab9d16a
--- /dev/null
+++ b/overlay-lineage/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<resources>
+ <!-- Hardware 'face' keys present on the device, stored as a bit field.
+ This integer should equal the sum of the corresponding value for each
+ of the following keys present:
+ 1 - Home
+ 2 - Back
+ 4 - Menu
+ 8 - Assistant (search)
+ 16 - App switch
+ 32 - Camera
+ 64 - Volume keys
+ For example, a device with Home, Back and Menu keys would set this
+ config to 7. -->
+ <integer name="config_deviceHardwareKeys">83</integer>
+
+ <!-- Hardware keys present on the device with the ability to wake, stored as a bit field.
+ This integer should equal the sum of the corresponding value for each
+ of the following keys present:
+ 1 - Home
+ 2 - Back
+ 4 - Menu
+ 8 - Assistant (search)
+ 16 - App switch
+ 32 - Camera
+ 64 - Volume rocker
+ For example, a device with Home, Back and Menu keys would set this
+ config to 7. -->
+ <integer name="config_deviceHardwareWakeKeys">64</integer>
+
+ <!-- Control the behavior when the user long presses the app switch button.
+ 0 - Nothing
+ 1 - Menu key
+ 2 - Recent apps view in SystemUI
+ 3 - Launch assist intent
+ 4 - Voice Search
+ 5 - In-app Search
+ 6 - Launch camera
+ 7 - Turn screen off
+ 8 - Last app
+ This needs to match the constants in
+ services/core/java/com/android/server/policy/PhoneWindowManager.java
+ -->
+ <integer name="config_longPressOnAppSwitchBehavior">8</integer>
+
+ <!-- Control the behavior when the user double-taps the home button.
+ 0 - Nothing
+ 1 - Menu
+ 2 - Recent apps view in SystemUI
+ 3 - Launch assist intent
+ 4 - Voice Search
+ 5 - In-app Search
+ This needs to match the constants in
+ policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+ -->
+ <integer name="config_doubleTapOnHomeBehavior">0</integer>
+
+ <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
+ <bool name="config_intrusiveNotificationLed">true</bool>
+
+ <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
+ <bool name="config_intrusiveBatteryLed">true</bool>
+
+ <!-- Default color for notification LED is blue. -->
+ <color name="config_defaultNotificationColor">#ff00ffff</color>
+
+ <!-- Disable button brightness settings -->
+ <integer name="config_buttonBrightnessSettingDefault">0</integer>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 75af249..fe702c5 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -71,7 +71,7 @@
The brightness values must be between 0 and 255 and be non-decreasing.
This must be overridden in platform specific overlays -->
<integer-array name="config_autoBrightnessLcdBacklightValues">
- <item>7</item>
+ <item>6</item>
<item>10</item>
<item>16</item>
<item>29</item>
@@ -89,34 +89,6 @@
<bool name="config_hotswapCapable">false</bool>
- <!-- Hardware 'face' keys present on the device, stored as a bit field.
- This integer should equal the sum of the corresponding value for each
- of the following keys present:
- 1 - Home
- 2 - Back
- 4 - Menu
- 8 - Assistant (search)
- 16 - App switch
- 32 - Camera
- 64 - Volume keys
- For example, a device with Home, Back and Menu keys would set this
- config to 7. -->
- <integer name="config_deviceHardwareKeys">83</integer>
-
- <!-- Hardware keys present on the device with the ability to wake, stored as a bit field.
- This integer should equal the sum of the corresponding value for each
- of the following keys present:
- 1 - Home
- 2 - Back
- 4 - Menu
- 8 - Assistant (search)
- 16 - App switch
- 32 - Camera
- 64 - Volume rocker
- For example, a device with Home, Back and Menu keys would set this
- config to 7. -->
- <integer name="config_deviceHardwareWakeKeys">64</integer>
-
<!-- Control the behavior when the user long presses the home button.
0 - Nothing
1 - Menu key
@@ -129,33 +101,6 @@
-->
<integer name="config_longPressOnHomeBehavior">3</integer>
- <!-- Control the behavior when the user long presses the app switch button.
- 0 - Nothing
- 1 - Menu key
- 2 - Recent apps view in SystemUI
- 3 - Launch assist intent
- 4 - Voice Search
- 5 - In-app Search
- 6 - Launch camera
- 7 - Turn screen off
- 8 - Last app
- This needs to match the constants in
- services/core/java/com/android/server/policy/PhoneWindowManager.java
- -->
- <integer name="config_longPressOnAppSwitchBehavior">8</integer>
-
- <!-- Control the behavior when the user double-taps the home button.
- 0 - Nothing
- 1 - Menu
- 2 - Recent apps view in SystemUI
- 3 - Launch assist intent
- 4 - Voice Search
- 5 - In-app Search
- This needs to match the constants in
- policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
- -->
- <integer name="config_doubleTapOnHomeBehavior">0</integer>
-
<bool name="config_allowAllRotations">true</bool>
<!-- Vibrator pattern for feedback about a long screen/key press -->
@@ -183,7 +128,7 @@
<!-- Screen brightness used to dim the screen while dozing in a very low power state.
May be less than the minimum allowed brightness setting
that can be set by the user. -->
- <integer name="config_screenBrightnessDoze">3</integer>
+ <integer name="config_screenBrightnessDoze">8</integer>
<!-- ComponentName of a dream to show whenever the system would otherwise have
gone to sleep. When the PowerManager is asked to go to sleep, it will instead
@@ -222,15 +167,8 @@
<item>"/system/framework/arm/boot-core-libart.oat"</item>
<item>"/data/dalvik-cache/arm/system@framework@boot.oat"</item>
<item>"/data/dalvik-cache/arm/system@framework@services.jar@classes.dex"</item>
- </string-array>
-
- <!-- Configuration to support SIM contact batch operation.-->
- <bool name="config_sim_phonebook_batch_operation">false</bool>
+ </string-array>
<!-- enabling WifiDisplay(Miracast Source)-->
<bool name="config_enableWifiDisplay">true</bool>
-
- <!-- Enable Blur for a capable device -->
- <bool name="config_uiBlurEnabled">true</bool>
-
</resources>