Compare commits
No commits in common. "lineage-17.0" and "lineage-21-light" have entirely different histories.
lineage-17
...
lineage-21
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/patches_treble_personal/vendor_hardware_overlay
|
@ -1,39 +0,0 @@
|
||||
From efbdeeea6ac6ac7e6a33ba9034d0d26a2da2c92e Mon Sep 17 00:00:00 2001
|
||||
From: Danny Baumann <dannybaumann@web.de>
|
||||
Date: Wed, 29 Aug 2018 11:21:52 +0200
|
||||
Subject: [PATCH 1/6] Implement per-process target SDK version override.
|
||||
|
||||
Change-Id: I65bbdbe96541d8aacdd4de125cdb9c1435129413
|
||||
|
||||
This is only partial cherry-pick. Value won't be set via Android.bp
|
||||
---
|
||||
linker/linker.cpp | 13 ++++++++++++-
|
||||
1 file changed, 12 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
||||
index b59df7302..ccdb131ca 100644
|
||||
--- a/linker/linker.cpp
|
||||
+++ b/linker/linker.cpp
|
||||
@@ -4217,7 +4217,18 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
|
||||
// somain and ld_preloads are added to these namespaces after LD_PRELOAD libs are linked
|
||||
}
|
||||
|
||||
- set_application_target_sdk_version(config->target_sdk_version());
|
||||
+ uint32_t target_sdk = config->target_sdk_version();
|
||||
+#ifdef SDK_VERSION_OVERRIDES
|
||||
+ for (const auto& entry : android::base::Split(SDK_VERSION_OVERRIDES, " ")) {
|
||||
+ auto splitted = android::base::Split(entry, "=");
|
||||
+ if (splitted.size() == 2 && splitted[0] == executable_path) {
|
||||
+ target_sdk = static_cast<uint32_t>(std::stoul(splitted[1]));
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ DEBUG("Target SDK for %s = %d", executable_path, target_sdk);
|
||||
+#endif
|
||||
+ set_application_target_sdk_version(target_sdk);
|
||||
|
||||
std::vector<android_namespace_t*> created_namespaces;
|
||||
created_namespaces.reserve(namespaces.size());
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From e77d8ff8326def1d6b457bfd4c8b232dc58dd7cb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 3 Jan 2019 17:50:03 +0100
|
||||
Subject: [PATCH 4/6] Read SDK version override from property
|
||||
|
||||
Change-Id: I88ca5d0bde15ee4f2b2bd1255e98f9592973dbf9
|
||||
---
|
||||
linker/linker.cpp | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
||||
index ccdb131ca..f45a40b9d 100644
|
||||
--- a/linker/linker.cpp
|
||||
+++ b/linker/linker.cpp
|
||||
@@ -4218,7 +4218,9 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
|
||||
}
|
||||
|
||||
uint32_t target_sdk = config->target_sdk_version();
|
||||
-#ifdef SDK_VERSION_OVERRIDES
|
||||
+
|
||||
+ std::string sdkVersionOverrides = android::base::GetProperty("persist.sys.phh.sdk_override", "");
|
||||
+ static const char *SDK_VERSION_OVERRIDES = sdkVersionOverrides.c_str();
|
||||
for (const auto& entry : android::base::Split(SDK_VERSION_OVERRIDES, " ")) {
|
||||
auto splitted = android::base::Split(entry, "=");
|
||||
if (splitted.size() == 2 && splitted[0] == executable_path) {
|
||||
@@ -4227,7 +4229,7 @@ std::vector<android_namespace_t*> init_default_namespaces(const char* executable
|
||||
}
|
||||
}
|
||||
DEBUG("Target SDK for %s = %d", executable_path, target_sdk);
|
||||
-#endif
|
||||
+
|
||||
set_application_target_sdk_version(target_sdk);
|
||||
|
||||
std::vector<android_namespace_t*> created_namespaces;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,36 +0,0 @@
|
||||
From f32750cc994642f6ba792051f20c3f930f3007d2 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 12:54:23 +0200
|
||||
Subject: [PATCH 5/6] Use vndk_lite ld.config only on same-version vendor
|
||||
|
||||
When running Q over P lite, there is currently absolutely no chance the
|
||||
device boots, because it will be using Q vndk.
|
||||
Thus using ld.config.28.txt when running Q over P lite gives a little more
|
||||
chance for the device to boot, than when using vndk_lite ld.config.
|
||||
Also, once this patch is applied, the required effort to boot
|
||||
Q over P lite is exclusively in vndk, which is manageable.
|
||||
|
||||
Change-Id: I55257cd7c738b1d20582e198e1d5621e1c87a03e
|
||||
---
|
||||
linker/linker.cpp | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/linker/linker.cpp b/linker/linker.cpp
|
||||
index f45a40b9d..9082fde53 100644
|
||||
--- a/linker/linker.cpp
|
||||
+++ b/linker/linker.cpp
|
||||
@@ -4069,7 +4069,10 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) {
|
||||
}
|
||||
|
||||
static std::string get_ld_config_file_vndk_path() {
|
||||
- if (android::base::GetBoolProperty("ro.vndk.lite", false)) {
|
||||
+ bool same_version_system_vendor = false;
|
||||
+ if(std::to_string(__ANDROID_API__) == Config::get_vndk_version_string('.'))
|
||||
+ same_version_system_vendor = true;
|
||||
+ if (android::base::GetBoolProperty("ro.vndk.lite", false) && same_version_system_vendor) {
|
||||
return kLdConfigVndkLiteFilePath;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,38 +0,0 @@
|
||||
From 13acd597e0dd22c5fa462007b20fe4f2398db297 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 13:00:55 +0200
|
||||
Subject: [PATCH 6/6] fixup! Actually restore pre-P mutex behavior
|
||||
|
||||
---
|
||||
libc/bionic/pthread_mutex.cpp | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/libc/bionic/pthread_mutex.cpp b/libc/bionic/pthread_mutex.cpp
|
||||
index 969feb43c..bd9fabdb6 100644
|
||||
--- a/libc/bionic/pthread_mutex.cpp
|
||||
+++ b/libc/bionic/pthread_mutex.cpp
|
||||
@@ -528,7 +528,7 @@ int pthread_mutex_init(pthread_mutex_t* mutex_interface, const pthread_mutexattr
|
||||
}
|
||||
|
||||
if (((*attr & MUTEXATTR_PROTOCOL_MASK) >> MUTEXATTR_PROTOCOL_SHIFT) == PTHREAD_PRIO_INHERIT
|
||||
- && bionic_get_application_target_sdk_version() >= __ANDROID_API_P__) {
|
||||
+ && android_get_application_target_sdk_version() >= __ANDROID_API_P__) {
|
||||
#if !defined(__LP64__)
|
||||
if (state & MUTEX_SHARED_MASK) {
|
||||
return EINVAL;
|
||||
@@ -798,12 +798,6 @@ static int __attribute__((noinline)) HandleUsingDestroyedMutex(pthread_mutex_t*
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
-static int __always_inline HandleUsingDestroyedMutex(pthread_mutex_t* mutex,
|
||||
- const char* function_name) {
|
||||
- __fortify_fatal("%s called on a destroyed mutex (%p)", function_name, mutex);
|
||||
- return EBUSY;
|
||||
-}
|
||||
-
|
||||
int pthread_mutex_lock(pthread_mutex_t* mutex_interface) {
|
||||
#if !defined(__LP64__)
|
||||
// Some apps depend on being able to pass NULL as a mutex and get EINVAL
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 58a98bd24e41cdacdbd472aaed2ab994400fe68c Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:31:07 +0200
|
||||
Subject: [PATCH] Don't reboot if we couldn't get bootctrl
|
||||
|
||||
Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af
|
||||
---
|
||||
update_verifier/update_verifier.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp
|
||||
index d04c455d..27e9f616 100644
|
||||
--- a/update_verifier/update_verifier.cpp
|
||||
+++ b/update_verifier/update_verifier.cpp
|
||||
@@ -310,7 +310,7 @@ int update_verifier(int argc, char** argv) {
|
||||
sp<IBootControl> module = IBootControl::getService();
|
||||
if (module == nullptr) {
|
||||
LOG(ERROR) << "Error getting bootctrl module.";
|
||||
- return reboot_device();
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
uint32_t current_slot = module->getCurrentSlot();
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 47af450ead33251ed80186d3b203e74d4930a775 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 6 Sep 2019 15:10:28 +0200
|
||||
Subject: [PATCH] Whitelist radio HALs (needed because they need to e in
|
||||
framework because of weird jarjar issue)
|
||||
|
||||
Change-Id: If1ccbedde92955bb86f4c6db6d68502784de1d8d
|
||||
---
|
||||
core/tasks/check_boot_jars/package_whitelist.txt | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/core/tasks/check_boot_jars/package_whitelist.txt b/core/tasks/check_boot_jars/package_whitelist.txt
|
||||
index d7dc368ee..7b6d5d8e7 100644
|
||||
--- a/core/tasks/check_boot_jars/package_whitelist.txt
|
||||
+++ b/core/tasks/check_boot_jars/package_whitelist.txt
|
||||
@@ -254,3 +254,6 @@ org\.lineageos\.platform\.internal
|
||||
org\.codeaurora\.ims.*
|
||||
# telephony-ext:
|
||||
org\.codeaurora\.internal.*
|
||||
+
|
||||
+vendor\.samsung\.hardware\.radio\.V1_2
|
||||
+vendor\.mediatek\.hardware\.radio\.V2_0
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 1c3ecb1fd46c76111d44f600532068f307ccacbc Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sat, 14 Sep 2019 21:25:07 +0200
|
||||
Subject: [PATCH 2/2] Add BOARD_SYSTEMIMAGE_AS_SYSTEM parameter to build SaS
|
||||
GSI
|
||||
|
||||
Change-Id: I764f0ef4e3be9a338fbe93944445cedc29d2bb81
|
||||
---
|
||||
core/Makefile | 1 +
|
||||
tools/releasetools/build_image.py | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/core/Makefile b/core/Makefile
|
||||
index 4611fb388..9ab207c6d 100644
|
||||
--- a/core/Makefile
|
||||
+++ b/core/Makefile
|
||||
@@ -1345,6 +1345,7 @@ endif # PRODUCT_USE_DYNAMIC_PARTITIONS
|
||||
# $(3): additional "key=value" pairs to append to the dictionary file.
|
||||
define generate-image-prop-dictionary
|
||||
$(if $(filter $(2),system),\
|
||||
+ $(if $(BOARD_SYSTEMIMAGE_AS_SYSTEM),$(hide) echo "system_as_system=$(BOARD_SYSTEMIMAGE_AS_SYSTEM)" >> $(1))
|
||||
$(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1))
|
||||
$(if $(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE),$(hide) echo "system_other_size=$(INTERNAL_SYSTEM_OTHER_PARTITION_SIZE)" >> $(1))
|
||||
$(if $(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "system_fs_type=$(BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
|
||||
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
|
||||
index 4136ed432..96f7ddcb0 100755
|
||||
--- a/tools/releasetools/build_image.py
|
||||
+++ b/tools/releasetools/build_image.py
|
||||
@@ -157,6 +157,8 @@ def SetUpInDirAndFsConfig(origin_in, prop_dict):
|
||||
|
||||
if prop_dict["mount_point"] != "system":
|
||||
return origin_in, fs_config
|
||||
+ if "system_as_system" in prop_dict:
|
||||
+ return origin_in, fs_config
|
||||
|
||||
if "first_pass" in prop_dict:
|
||||
prop_dict["mount_point"] = "/"
|
||||
@@ -564,6 +566,8 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
|
||||
if not copy_prop("system_extfs_rsv_pct", "extfs_rsv_pct"):
|
||||
d["extfs_rsv_pct"] = "0"
|
||||
copy_prop("system_reserved_size", "partition_reserved_size")
|
||||
+
|
||||
+ copy_prop("system_as_system", "system_as_system")
|
||||
elif mount_point == "system_other":
|
||||
# We inherit the selinux policies of /system since we contain some of its
|
||||
# files.
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 2357a8f50b6ec8e1ed4d863c4b18aaed8af6a3db Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 2 Mar 2018 22:49:55 +0100
|
||||
Subject: [PATCH 1/6] Enable multipl_decls by default. This is needed because
|
||||
8.0 init doesn't add -m
|
||||
|
||||
Change-Id: I43dc661d519f7b8576d72a828d8cbd444592bf5e
|
||||
---
|
||||
secilc/secilc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
||||
index ad6862ba..8799e99a 100644
|
||||
--- a/secilc/secilc.c
|
||||
+++ b/secilc/secilc.c
|
||||
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
||||
int target = SEPOL_TARGET_SELINUX;
|
||||
int mls = -1;
|
||||
int disable_dontaudit = 0;
|
||||
- int multiple_decls = 0;
|
||||
+ int multiple_decls = 1;
|
||||
int disable_neverallow = 0;
|
||||
int preserve_tunables = 0;
|
||||
int handle_unknown = -1;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 04ac55163d403dba2d986cb41805663ea5fa465a Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 9 Apr 2018 00:19:49 +0200
|
||||
Subject: [PATCH 2/6] Increase default log_level to get actual selinux error in
|
||||
kmsg
|
||||
|
||||
---
|
||||
secilc/secilc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
||||
index 8799e99a..631b4b0a 100644
|
||||
--- a/secilc/secilc.c
|
||||
+++ b/secilc/secilc.c
|
||||
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
||||
int opt_index = 0;
|
||||
char *fc_buf = NULL;
|
||||
size_t fc_size;
|
||||
- enum cil_log_level log_level = CIL_ERR;
|
||||
+ enum cil_log_level log_level = CIL_WARN;
|
||||
static struct option long_opts[] = {
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 0883dddcc377f9c8c271b4ee1b5796cca6b9938c Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 3 Dec 2018 20:54:54 +0100
|
||||
Subject: [PATCH 3/6] ::Kirin:: Workaround some conflicting Kirin tether
|
||||
SELinux context
|
||||
|
||||
Some Kirin devices declared some android.hardware.tetheroffload HALs,
|
||||
but they didn't use AOSP contexts.
|
||||
This leads to libselinux aborting when loading hwservice_contexts.
|
||||
|
||||
Workaround it the ugly way, by making them match.
|
||||
This most likely kills tetheroffload for those devices.
|
||||
---
|
||||
libselinux/src/label_backends_android.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
|
||||
index eaca5947..ab92985b 100644
|
||||
--- a/libselinux/src/label_backends_android.c
|
||||
+++ b/libselinux/src/label_backends_android.c
|
||||
@@ -62,6 +62,16 @@ static int nodups_specs(struct saved_data *data)
|
||||
curr_spec->property_key)) {
|
||||
if (strcmp(spec_arr[jj].lr.ctx_raw,
|
||||
curr_spec->lr.ctx_raw)) {
|
||||
+ if(strcmp(spec_arr[jj].lr.ctx_raw, "u:object_r:hal_ipacm_hwservice:s0") == 0) {
|
||||
+ free(spec_arr[jj].lr.ctx_raw);
|
||||
+ spec_arr[jj].lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
|
||||
+ continue;
|
||||
+ }
|
||||
+ if(strcmp(curr_spec->lr.ctx_raw, "u:object_r:hal_ipacm_hwservice:s0") == 0) {
|
||||
+ free(curr_spec->lr.ctx_raw);
|
||||
+ curr_spec->lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
|
||||
+ continue;
|
||||
+ }
|
||||
rc = -1;
|
||||
errno = EINVAL;
|
||||
selinux_log
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From fac785e80fa91a71c29c95817110154e4c60464d Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 6 Sep 2019 15:07:25 +0200
|
||||
Subject: [PATCH 4/6] Allow /devices/virtual/block/ genfscon conflict (seen on
|
||||
Xiaomi Mi 9)
|
||||
|
||||
Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895
|
||||
---
|
||||
libsepol/cil/src/cil_post.c | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c
|
||||
index 0b09cecc..255c9e12 100644
|
||||
--- a/libsepol/cil/src/cil_post.c
|
||||
+++ b/libsepol/cil/src/cil_post.c
|
||||
@@ -477,7 +477,23 @@ int cil_post_genfscon_context_compare(const void *a, const void *b)
|
||||
{
|
||||
struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a;
|
||||
struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b;
|
||||
- return context_compare(a_genfscon->context, b_genfscon->context);
|
||||
+ int rc = context_compare(a_genfscon->context, b_genfscon->context);
|
||||
+ if(rc) {
|
||||
+ fprintf(stderr, "hello %s\n", a_genfscon->fs_str);
|
||||
+ int bypass = 0;
|
||||
+ /*
|
||||
+ * This conflict has been seen on Xiaomi Mi 9:
|
||||
+ * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0))))
|
||||
+ * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0))))
|
||||
+ */
|
||||
+ if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0)
|
||||
+ bypass = 1;
|
||||
+ if(bypass == 1) {
|
||||
+ fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
int cil_post_netifcon_context_compare(const void *a, const void *b)
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From c741063fdd7cbb01dda51737db457e4043af0d04 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:34:28 +0200
|
||||
Subject: [PATCH 5/6] Most horrific: Remove ramdisk's zygote init scripts
|
||||
|
||||
This is needed because:
|
||||
- only secilc is run soon enough in /system to
|
||||
remove it
|
||||
- placing an init.zygote in system won't have init replace it, it's the
|
||||
first that appears that wins
|
||||
|
||||
Change-Id: I8be31ceb9ef2124d04994d9fb08fc8012a2f819e
|
||||
---
|
||||
secilc/secilc.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/secilc/secilc.c b/secilc/secilc.c
|
||||
index 631b4b0a..3dd6e7ce 100644
|
||||
--- a/secilc/secilc.c
|
||||
+++ b/secilc/secilc.c
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <getopt.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
+#include <unistd.h>
|
||||
+
|
||||
#ifdef ANDROID
|
||||
#include <cil/cil.h>
|
||||
#else
|
||||
@@ -121,6 +123,11 @@ int main(int argc, char *argv[])
|
||||
};
|
||||
int i;
|
||||
|
||||
+ unlink("/init.zygote32.rc");
|
||||
+ unlink("/init.zygote64_32.rc");
|
||||
+ unlink("/init.zygote64.rc");
|
||||
+ unlink("/init.zygote32_64.rc");
|
||||
+
|
||||
while (1) {
|
||||
opt_char = getopt_long(argc, argv, "o:f:U:hvt:M:PDmNc:GX:", long_opts, &opt_index);
|
||||
if (opt_char == -1) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 80f7a20f831e6d2028678899c39fe779024433f1 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:37:04 +0200
|
||||
Subject: [PATCH 6/6] if service is "rcs", accept conflict. Seen on Moto E5
|
||||
|
||||
Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd
|
||||
---
|
||||
libselinux/src/label_backends_android.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
|
||||
index ab92985b..ca16327c 100644
|
||||
--- a/libselinux/src/label_backends_android.c
|
||||
+++ b/libselinux/src/label_backends_android.c
|
||||
@@ -72,14 +72,24 @@ static int nodups_specs(struct saved_data *data)
|
||||
curr_spec->lr.ctx_raw = strdup("u:object_r:hal_tetheroffload_hwservice:s0");
|
||||
continue;
|
||||
}
|
||||
- rc = -1;
|
||||
- errno = EINVAL;
|
||||
selinux_log
|
||||
(SELINUX_ERROR,
|
||||
"Multiple different specifications for %s (%s and %s).\n",
|
||||
curr_spec->property_key,
|
||||
spec_arr[jj].lr.ctx_raw,
|
||||
curr_spec->lr.ctx_raw);
|
||||
+ int ignore = 0;
|
||||
+ /*
|
||||
+ * This issue has been found on Moto E5
|
||||
+ * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0).
|
||||
+ */
|
||||
+ if(!strcmp(curr_spec->property_key, "rcs"))
|
||||
+ ignore = 1;
|
||||
+
|
||||
+ if(!ignore) {
|
||||
+ rc = -1;
|
||||
+ errno = EINVAL;
|
||||
+ }
|
||||
} else {
|
||||
selinux_log
|
||||
(SELINUX_WARNING,
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,84 +0,0 @@
|
||||
From 477ef41ac3a639f4c34c8ecf323d25ed2d3e8e8e Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 25 Oct 2019 13:29:20 +0200
|
||||
Subject: [PATCH 7/7] Fix boot on Moto devices using unknown class
|
||||
|
||||
vendor sepolicy never contains new class or classorder, and are not
|
||||
allowed to.
|
||||
Though this is not tested, and it turns out Moto did it anyway.
|
||||
This raises an issue, because class need to be ordered, and thus the cil
|
||||
contains the ordering. This ordering needs to be merged.
|
||||
Android 10 added new classes, so the ordering can no longer be merged,
|
||||
and secilc fails on those devices, preventing boot.
|
||||
|
||||
Considering vendor are not supposed to declare new class (and thus
|
||||
declare classorder), this fix ignores class-es/classorder in vendor
|
||||
SELinux policy.
|
||||
|
||||
Since the vendor selinux policy has allows rules based on this context,
|
||||
those allows will fail since the class doesn't exist.
|
||||
Workaround this by ignoring rules with the problematic class
|
||||
( keystore_moto_key )
|
||||
|
||||
Lucky us, this new class `keystore_moto_key` is used by Moto for
|
||||
framework to framework (more accurately priv app to keymaster), since
|
||||
our own framework doesn't use this class, simply ignoring it fixes the
|
||||
issue.
|
||||
|
||||
Change-Id: I66339857634ebfdba359f12a99dfd0bff709d80b
|
||||
---
|
||||
libsepol/cil/src/cil_build_ast.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c
|
||||
index b90b0f60..6f391940 100644
|
||||
--- a/libsepol/cil/src/cil_build_ast.c
|
||||
+++ b/libsepol/cil/src/cil_build_ast.c
|
||||
@@ -386,6 +386,14 @@ int cil_gen_class(struct cil_db *db, struct cil_tree_node *parse_current, struct
|
||||
struct cil_tree_node *perms = NULL;
|
||||
int rc = SEPOL_ERR;
|
||||
|
||||
+ {
|
||||
+ const char* path = cil_tree_get_cil_path(parse_current);
|
||||
+ if(strstr(path, "vendor")) {
|
||||
+ cil_clear_node(ast_node);
|
||||
+ return SEPOL_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
|
||||
if (rc != SEPOL_OK) {
|
||||
goto exit;
|
||||
@@ -452,6 +460,14 @@ int cil_gen_classorder(struct cil_db *db, struct cil_tree_node *parse_current, s
|
||||
struct cil_list_item *head = NULL;
|
||||
int rc = SEPOL_ERR;
|
||||
|
||||
+ {
|
||||
+ const char* path = cil_tree_get_cil_path(parse_current);
|
||||
+ if(strstr(path, "vendor")) {
|
||||
+ cil_clear_node(ast_node);
|
||||
+ return SEPOL_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (db == NULL || parse_current == NULL || ast_node == NULL) {
|
||||
goto exit;
|
||||
}
|
||||
@@ -2050,6 +2066,14 @@ int cil_gen_avrule(struct cil_tree_node *parse_current, struct cil_tree_node *as
|
||||
rule->src_str = parse_current->next->data;
|
||||
rule->tgt_str = parse_current->next->next->data;
|
||||
|
||||
+ {
|
||||
+ const char *classname = parse_current->next->next->next->cl_head->data;
|
||||
+ if(strcmp(classname, "keystore_moto_key") == 0) {
|
||||
+ cil_clear_node(ast_node);
|
||||
+ return SEPOL_OK;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
rc = cil_fill_classperms_list(parse_current->next->next->next, &rule->perms.classperms);
|
||||
if (rc != SEPOL_OK) {
|
||||
goto exit;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From ba695ca22d256bb8a27f699c0759162a48999cf7 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Tue, 22 Oct 2019 20:54:25 +0800
|
||||
Subject: [PATCH] GrGLCaps: allow ignoring vendor-supplied texture swizzle flag
|
||||
|
||||
* This is broken on MTK 8.1 vendor
|
||||
|
||||
Change-Id: I1ccae06f643f01e4ea6539e1d4e3c7df8d6e30ae
|
||||
---
|
||||
Android.bp | 1 +
|
||||
src/gpu/gl/GrGLCaps.h | 11 +++++++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/Android.bp b/Android.bp
|
||||
index 3d2ab6d370..099cd6ba0b 100644
|
||||
--- a/Android.bp
|
||||
+++ b/Android.bp
|
||||
@@ -3,6 +3,7 @@
|
||||
cc_library_static {
|
||||
name: "libskia",
|
||||
host_supported: true,
|
||||
+ shared_libs: [ "libbase" ],
|
||||
cflags: [
|
||||
"-U_FORTIFY_SOURCE",
|
||||
"-DATRACE_TAG=ATRACE_TAG_VIEW",
|
||||
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
|
||||
index 4a97e84cf8..aee7a5509e 100644
|
||||
--- a/src/gpu/gl/GrGLCaps.h
|
||||
+++ b/src/gpu/gl/GrGLCaps.h
|
||||
@@ -17,6 +17,11 @@
|
||||
#include "SkTHash.h"
|
||||
#include "SkTArray.h"
|
||||
|
||||
+#if defined(SK_BUILD_FOR_ANDROID)
|
||||
+#include "android-base/properties.h"
|
||||
+using android::base::GetBoolProperty;
|
||||
+#endif
|
||||
+
|
||||
class GrGLContextInfo;
|
||||
class GrGLRenderTarget;
|
||||
|
||||
@@ -330,8 +335,14 @@ public:
|
||||
/// Are textures with GL_TEXTURE_RECTANGLE type supported.
|
||||
bool rectangleTextureSupport() const { return fRectangleTextureSupport; }
|
||||
|
||||
+#if !defined(SK_BUILD_FOR_ANDROID)
|
||||
/// GL_ARB_texture_swizzle
|
||||
bool textureSwizzleSupport() const { return fTextureSwizzleSupport; }
|
||||
+#else
|
||||
+ bool textureSwizzleSupport() const {
|
||||
+ return !GetBoolProperty("ro.skia.ignore_swizzle", false) && fTextureSwizzleSupport;
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
bool mipMapLevelAndLodControlSupport() const { return fMipMapLevelAndLodControlSupport; }
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,81 +0,0 @@
|
||||
From 5286da2b7f598de0566d1ad1a5e070bdb5d698d1 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 24 Apr 2018 00:14:28 +0200
|
||||
Subject: [PATCH 01/11] FIH devices: Fix "Earpiece" audio output
|
||||
|
||||
On some FIH devices (confirmed on Razer, and probably on Aquos SS2),
|
||||
Earpiece is not listed in attachedDevices, and devicePort's profile
|
||||
mentions it is AUDIO_CHANNEL_IN_MONO, instead of AUDIO_CHANNEL_OUT_MONO.
|
||||
|
||||
Detect such cases (output device, but got only AUDIO_CHANNEL_IN_MONO),
|
||||
and fix both channelMasks and attachedDevices
|
||||
|
||||
Change-Id: I4a88ba6d34d0fcd346eeea2ca903772f0271040a
|
||||
---
|
||||
.../managerdefinitions/src/Serializer.cpp | 27 ++++++++++++++++---
|
||||
1 file changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 5f820c214..0b561320b 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -395,14 +395,22 @@ Return<AudioGainTraits::Element> AudioGainTraits::deserialize(const xmlNode *cur
|
||||
}
|
||||
|
||||
Return<AudioProfileTraits::Element> AudioProfileTraits::deserialize(const xmlNode *cur,
|
||||
- PtrSerializingCtx /*serializingContext*/)
|
||||
+ PtrSerializingCtx serializingContext)
|
||||
{
|
||||
+ bool isOutput = serializingContext != nullptr;
|
||||
std::string samplingRates = getXmlAttribute(cur, Attributes::samplingRates);
|
||||
std::string format = getXmlAttribute(cur, Attributes::format);
|
||||
std::string channels = getXmlAttribute(cur, Attributes::channelMasks);
|
||||
+ ChannelTraits::Collection channelsMask = channelMasksFromString(channels, ",");
|
||||
+
|
||||
+ //Some Foxconn devices have wrong earpiece channel mask, leading to no channel mask
|
||||
+ if(channelsMask.size() == 1 && channelsMask[0] == AUDIO_CHANNEL_IN_MONO && isOutput) {
|
||||
+ fixedEarpieceChannels = true;
|
||||
+ channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ",");
|
||||
+ }
|
||||
|
||||
Element profile = new AudioProfile(formatFromString(format, gDynamicFormat),
|
||||
- channelMasksFromString(channels, ","),
|
||||
+ channelsMask,
|
||||
samplingRatesFromString(samplingRates, ","));
|
||||
|
||||
profile->setDynamicFormat(profile->getFormat() == gDynamicFormat);
|
||||
@@ -517,10 +525,15 @@ Return<DevicePortTraits::Element> DevicePortTraits::deserialize(const xmlNode *c
|
||||
}
|
||||
|
||||
AudioProfileTraits::Collection profiles;
|
||||
- status_t status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
||||
+ status_t status;
|
||||
+ if(audio_is_output_devices(type))
|
||||
+ status = deserializeCollection<AudioProfileTraits>(doc, root, profiles, (PtrSerializingCtx)1);
|
||||
+ else
|
||||
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
||||
if (status != NO_ERROR) {
|
||||
return Status::fromStatusT(status);
|
||||
}
|
||||
+
|
||||
if (profiles.isEmpty()) {
|
||||
profiles.add(AudioProfile::createFullDynamic());
|
||||
}
|
||||
@@ -672,6 +685,14 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if(fixedEarpieceChannels) {
|
||||
+ sp<DeviceDescriptor> device =
|
||||
+ module->getDeclaredDevices().getDeviceFromTagName(String8("Earpiece"));
|
||||
+ if(device != 0)
|
||||
+ ctx->addAvailableDevice(device);
|
||||
+ fixedEarpieceChannels = false;
|
||||
+ }
|
||||
return module;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From ddf773c1e301c5bc37fe156676ad6deb55fb7e8e Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Pohl <pohl199885@gmail.com>
|
||||
Date: Fri, 15 Jun 2018 19:58:07 +0200
|
||||
Subject: [PATCH 02/11] Fix WiFi-Display on Huawei devices (EMUI 8.0)
|
||||
|
||||
Huaweis media stack doesn't handle intra-refresh-mode, so skip the error instead.
|
||||
|
||||
Thanks to Chris Vandomelen for pointing that out.
|
||||
---
|
||||
media/libstagefright/ACodec.cpp | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
|
||||
index 3d67c911a..007b84cea 100644
|
||||
--- a/media/libstagefright/ACodec.cpp
|
||||
+++ b/media/libstagefright/ACodec.cpp
|
||||
@@ -4358,9 +4358,8 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
|
||||
if (msg->findInt32("intra-refresh-mode", &intraRefreshMode)) {
|
||||
err = setCyclicIntraMacroblockRefresh(msg, intraRefreshMode);
|
||||
if (err != OK) {
|
||||
- ALOGE("Setting intra macroblock refresh mode (%d) failed: 0x%x",
|
||||
- err, intraRefreshMode);
|
||||
- return err;
|
||||
+ ALOGE("setupAVCEncoderParameters(): set intra-refresh-mode failed, ignoring..");
|
||||
+ //return err;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 6e5e5dbc804ef1aa686731d588bdb959919de29e Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 22:59:06 +0200
|
||||
Subject: [PATCH 03/11] ::Kirin:: Remove lock to prevent self-lock
|
||||
|
||||
With Huawei Camera HAL, we get the following call order:
|
||||
cameraserver CameraService::enumerateProviders (*)
|
||||
=> HAL ICameraProvider::getVendorTags
|
||||
=> HAL ICameraProviderCallback::cameraDeviceStatusChange
|
||||
=> cameraserver CameraService::addState
|
||||
=> cameraserver CameraService::updateCameraNumAndIds (*)
|
||||
|
||||
The two functions marked with (*) take mServiceLock
|
||||
Hence the safe-lock
|
||||
---
|
||||
services/camera/libcameraservice/CameraService.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||
index 3e6210294..3736a9e24 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||
@@ -254,7 +254,7 @@ void CameraService::onNewProviderRegistered() {
|
||||
}
|
||||
|
||||
void CameraService::updateCameraNumAndIds() {
|
||||
- Mutex::Autolock l(mServiceLock);
|
||||
+ //Mutex::Autolock l(mServiceLock);
|
||||
mNumberOfCameras = mCameraProviderManager->getCameraCount();
|
||||
mNormalDeviceIds =
|
||||
mCameraProviderManager->getAPI1CompatibleCameraDeviceIds();
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From d76a1c23cb4a61bac8e1cdc33bca4201b5c1972f Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 23:05:26 +0200
|
||||
Subject: [PATCH 04/11] We might not have a mFlashlight at this state, but
|
||||
that's ok
|
||||
|
||||
---
|
||||
services/camera/libcameraservice/CameraService.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||
index 3736a9e24..12ab2f47e 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||
@@ -279,7 +279,7 @@ void CameraService::addStates(const String8 id) {
|
||||
conflicting));
|
||||
}
|
||||
|
||||
- if (mFlashlight->hasFlashUnit(id)) {
|
||||
+ if (mFlashlight != nullptr && mFlashlight->hasFlashUnit(id)) {
|
||||
Mutex::Autolock al(mTorchStatusMutex);
|
||||
mTorchStatusMap.add(id, TorchModeStatus::AVAILABLE_OFF);
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,62 +0,0 @@
|
||||
From a5bc47c2602ae78b0471e8f55538a4cca083decf Mon Sep 17 00:00:00 2001
|
||||
From: Artem Borisov <dedsa2002@gmail.com>
|
||||
Date: Tue, 25 Sep 2018 12:39:22 +0300
|
||||
Subject: [PATCH 05/11] CameraService: Support calling addStates in
|
||||
enumerateProviders
|
||||
|
||||
Some pre-P camera HALs trigger onDeviceStatusChange callback during HAL init.
|
||||
This is horribly wrong and causes a race condition between enumerateProviders
|
||||
and onDeviceStatusChange. While it wasn't really harmful in O, in P call sequence
|
||||
was changed and now this race condition leads to two problems: null pointer dereference
|
||||
in addStates because mFlashlight is not initialized at a proper timing; mServiceLock
|
||||
deadlock because updateCameraNumAndIds and enumerateProviders are called at the same time.
|
||||
Moving addStates back to enumerateProviders makes the sequence more similar to O, and doesn't
|
||||
let these two issues to happen.
|
||||
Enable TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE when it is necessary.
|
||||
|
||||
@Dil3mm4 edit: Instead of TARGET_CAMERA_NEEDS_ADD_STATES_IN_ENUMERATE let's use a system property to make it more generic and suitable for GSI use.
|
||||
|
||||
Change-Id: Ife25b9753fdb679ab0c77f385e1b8527551a4711
|
||||
---
|
||||
.../camera/libcameraservice/CameraService.cpp | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||
index 12ab2f47e..d208a36a9 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||
@@ -204,6 +204,20 @@ status_t CameraService::enumerateProviders() {
|
||||
|
||||
for (auto& cameraId : deviceIds) {
|
||||
String8 id8 = String8(cameraId.c_str());
|
||||
+ if (property_get_bool("persist.sys.camera.huawei", false)) {
|
||||
+ bool cameraFound = false;
|
||||
+ {
|
||||
+ Mutex::Autolock lock(mCameraStatesLock);
|
||||
+ auto iter = mCameraStates.find(id8);
|
||||
+ if (iter != mCameraStates.end()) {
|
||||
+ cameraFound = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!cameraFound) {
|
||||
+ addStates(id8);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (getCameraState(id8) == nullptr) {
|
||||
onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
|
||||
}
|
||||
@@ -317,8 +331,10 @@ void CameraService::onDeviceStatusChanged(const String8& id,
|
||||
ALOGI("%s: Unknown camera ID %s, a new camera is added",
|
||||
__FUNCTION__, id.string());
|
||||
|
||||
+ if (!property_get_bool("persist.sys.camera.huawei", false)) {
|
||||
// First add as absent to make sure clients are notified below
|
||||
addStates(id);
|
||||
+ }
|
||||
|
||||
updateStatus(newStatus, id);
|
||||
} else {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From 04e7317ef801f4124f4a074519d7a077dac14702 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 9 Dec 2018 15:56:59 +0100
|
||||
Subject: [PATCH 06/11] Revert "Set rlimit rtprio for cameraserver"
|
||||
|
||||
This reverts commit 4ae244cab4fe715fc2729e906b7dda3075fbbac3.
|
||||
|
||||
We need to revert this because some init/systems (Moto E5, G6) doesn't
|
||||
like this instruction at all (read: this prevents boot)
|
||||
---
|
||||
camera/cameraserver/cameraserver.rc | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/camera/cameraserver/cameraserver.rc b/camera/cameraserver/cameraserver.rc
|
||||
index a9aae0b15..fea5a1d5c 100644
|
||||
--- a/camera/cameraserver/cameraserver.rc
|
||||
+++ b/camera/cameraserver/cameraserver.rc
|
||||
@@ -4,4 +4,3 @@ service cameraserver /system/bin/cameraserver
|
||||
group audio camera input drmrpc
|
||||
ioprio rt 4
|
||||
writepid /dev/cpuset/camera-daemon/tasks /dev/stune/top-app/tasks
|
||||
- rlimit rtprio 10 10
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From bb6f508a514d09fdab79583886f7953dd42bfa0c Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 4 Sep 2019 22:28:56 +0200
|
||||
Subject: [PATCH 07/11] fixup! FIH devices: Fix "Earpiece" audio output
|
||||
|
||||
---
|
||||
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 0b561320b..c8cb54b5f 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -394,6 +394,7 @@ Return<AudioGainTraits::Element> AudioGainTraits::deserialize(const xmlNode *cur
|
||||
}
|
||||
}
|
||||
|
||||
+static bool fixedEarpieceChannels = false;
|
||||
Return<AudioProfileTraits::Element> AudioProfileTraits::deserialize(const xmlNode *cur,
|
||||
PtrSerializingCtx serializingContext)
|
||||
{
|
||||
@@ -527,7 +528,7 @@ Return<DevicePortTraits::Element> DevicePortTraits::deserialize(const xmlNode *c
|
||||
AudioProfileTraits::Collection profiles;
|
||||
status_t status;
|
||||
if(audio_is_output_devices(type))
|
||||
- status = deserializeCollection<AudioProfileTraits>(doc, root, profiles, (PtrSerializingCtx)1);
|
||||
+ status = deserializeCollection<AudioProfileTraits>(cur, &profiles, (PtrSerializingCtx)1);
|
||||
else
|
||||
status = deserializeCollection<AudioProfileTraits>(cur, &profiles, NULL);
|
||||
if (status != NO_ERROR) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 582695245e6ce2bafaf3b11b9d3b69dcf88d0037 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 5 Aug 2019 17:27:47 +0200
|
||||
Subject: [PATCH 08/11] Fix use-after-free (object on stack)
|
||||
|
||||
Change-Id: I9ae666b10873eac4e7a55032071e7b15b0de058a
|
||||
---
|
||||
.../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index c8cb54b5f..9f2bdc4b3 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -517,7 +517,7 @@ Return<DevicePortTraits::Element> DevicePortTraits::deserialize(const xmlNode *c
|
||||
if (!encodedFormatsLiteral.empty()) {
|
||||
encodedFormats = formatsFromString(encodedFormatsLiteral, " ");
|
||||
}
|
||||
- Element deviceDesc = new DeviceDescriptor(type, encodedFormats, String8(name.c_str()));
|
||||
+ Element deviceDesc = new DeviceDescriptor(type, encodedFormats, String8(strdup(name.c_str())));
|
||||
|
||||
std::string address = getXmlAttribute(cur, Attributes::address);
|
||||
if (!address.empty()) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,129 +0,0 @@
|
||||
From c02350cbd42543fdfac9bd61b630182a0da1ecf9 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 5 Aug 2019 18:09:50 +0200
|
||||
Subject: [PATCH 09/11] Fix BT in-call on CAF devices
|
||||
|
||||
See https://github.com/phhusson/treble_experimentations/issues/374
|
||||
|
||||
In Qualcomm's BSP audio_policy_configuration.xml, one route is missing,
|
||||
from primary output and telephony to BT SCO.
|
||||
|
||||
Add it if we detect telephony and bt sco, but no such route.
|
||||
|
||||
Change-Id: Ifea0f88276ec9a0811f3cb1973c4b06f2c82077b
|
||||
---
|
||||
.../managerdefinitions/src/Serializer.cpp | 91 +++++++++++++++++++
|
||||
1 file changed, 91 insertions(+)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 9f2bdc4b3..9c7e5c49d 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -607,6 +607,96 @@ Return<RouteTraits::Element> RouteTraits::deserialize(const xmlNode *cur, PtrSer
|
||||
return route;
|
||||
}
|
||||
|
||||
+static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortTraits::Collection& devicePorts, HwModule* ctx) {
|
||||
+ // On many Qualcomm devices, there is a BT SCO Headset Mic => primary input mix
|
||||
+ // But Telephony Rx => BT SCO Headset route is missing
|
||||
+ // When we detect such case, add the missing route
|
||||
+
|
||||
+ // If we have:
|
||||
+ // <route type="mix" sink="Telephony Tx" sources="voice_tx"/>
|
||||
+ // <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,Wired Headset Mic,BT SCO Headset Mic"/>
|
||||
+ // <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink" />
|
||||
+ // And no <route type="mix" sink="BT SCO Headset" />
|
||||
+
|
||||
+ // Add:
|
||||
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
||||
+ bool foundBtScoHeadsetDevice = false;
|
||||
+ for(const auto& device: devicePorts) {
|
||||
+ if(device->getTagName() == String8("BT SCO Headset")) {
|
||||
+ foundBtScoHeadsetDevice = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if(!foundBtScoHeadsetDevice) {
|
||||
+ ALOGE("No BT SCO Headset device found, don't patch policy");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ bool foundTelephony = false;
|
||||
+ bool foundBtScoInput = false;
|
||||
+ bool foundScoHeadsetRoute = false;
|
||||
+ for(const auto& route: routes) {
|
||||
+ ALOGE("Looking at route %d\n", route->getType());
|
||||
+ if(route->getType() != AUDIO_ROUTE_MIX)
|
||||
+ continue;
|
||||
+ auto sink = route->getSink();
|
||||
+ ALOGE("... With sink %s\n", sink->getTagName().c_str());
|
||||
+ if(sink->getTagName() == String8("Telephony Tx")) {
|
||||
+ foundTelephony = true;
|
||||
+ continue;
|
||||
+ }
|
||||
+ if(sink->getTagName() == String8("BT SCO Headset")) {
|
||||
+ foundScoHeadsetRoute = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ for(const auto& source: route->getSources()) {
|
||||
+ ALOGE("... With source %s\n", source->getTagName().c_str());
|
||||
+ if(source->getTagName() == String8("BT SCO Headset Mic")) {
|
||||
+ foundBtScoInput = true;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ //The route we want to add is already there
|
||||
+ ALOGE("Done looking for existing routes");
|
||||
+ if(foundScoHeadsetRoute)
|
||||
+ return;
|
||||
+
|
||||
+ ALOGE("No existing route found... %d %d", foundTelephony ? 1 : 0, foundBtScoInput ? 1 : 0);
|
||||
+ //We couldn't find the routes we assume are required for the function we want to add
|
||||
+ if(!foundTelephony || !foundBtScoInput)
|
||||
+ return;
|
||||
+ ALOGE("Adding our own.");
|
||||
+
|
||||
+ // Add:
|
||||
+ // <route type="mix" sink="BT SCO Headset" sources="primary output,deep_buffer,compressed_offload,Telephony Rx"/>
|
||||
+ AudioRoute *newRoute = new AudioRoute(AUDIO_ROUTE_MIX);
|
||||
+
|
||||
+ auto sink = ctx->findPortByTagName(String8("BT SCO Headset"));
|
||||
+ ALOGE("Got sink %p\n", sink.get());
|
||||
+ newRoute->setSink(sink);
|
||||
+
|
||||
+ AudioPortVector sources;
|
||||
+ for(const auto& sourceName: {
|
||||
+ "primary output",
|
||||
+ "deep_buffer",
|
||||
+ "compressed_offload",
|
||||
+ "Telephony Rx"
|
||||
+ }) {
|
||||
+ auto source = ctx->findPortByTagName(String8(sourceName));
|
||||
+ ALOGE("Got source %p\n", source.get());
|
||||
+ sources.add(source);
|
||||
+ source->addRoute(newRoute);
|
||||
+ }
|
||||
+
|
||||
+ newRoute->setSources(sources);
|
||||
+
|
||||
+ sink->addRoute(newRoute);
|
||||
+
|
||||
+ auto ret = routes.add(newRoute);
|
||||
+ ALOGE("route add returned %zd", ret);
|
||||
+}
|
||||
+
|
||||
Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrSerializingCtx ctx)
|
||||
{
|
||||
std::string name = getXmlAttribute(cur, Attributes::name);
|
||||
@@ -646,6 +736,7 @@ Return<ModuleTraits::Element> ModuleTraits::deserialize(const xmlNode *cur, PtrS
|
||||
if (status != NO_ERROR) {
|
||||
return Status::fromStatusT(status);
|
||||
}
|
||||
+ fixupQualcommBtScoRoute(routes, devicePorts, module.get());
|
||||
module->setRoutes(routes);
|
||||
|
||||
for (const xmlNode *children = cur->xmlChildrenNode; children != NULL;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From a71fbad371842877a92190204450b5c6753b3509 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Vidal <vincent.vidal@onera.fr>
|
||||
Date: Thu, 12 Sep 2019 14:17:14 +0200
|
||||
Subject: [PATCH 10/11] Fix null pointer for unknown audio sources in "Fix BT
|
||||
in-call on CAF devices"
|
||||
|
||||
Some audio sources may not exist on some devices (e.g. Axon 7), leading to a segmentation fault.
|
||||
---
|
||||
.../common/managerdefinitions/src/Serializer.cpp | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index 9c7e5c49d..8bfdb5b0a 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -685,8 +685,10 @@ static void fixupQualcommBtScoRoute(RouteTraits::Collection& routes, DevicePortT
|
||||
}) {
|
||||
auto source = ctx->findPortByTagName(String8(sourceName));
|
||||
ALOGE("Got source %p\n", source.get());
|
||||
- sources.add(source);
|
||||
- source->addRoute(newRoute);
|
||||
+ if (source.get() != nullptr) {
|
||||
+ sources.add(source);
|
||||
+ source->addRoute(newRoute);
|
||||
+ }
|
||||
}
|
||||
|
||||
newRoute->setSources(sources);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,94 +0,0 @@
|
||||
From 7ad31b03ab941886ac1e930a1f1dd1232461cd18 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 1 Oct 2019 13:35:49 +0200
|
||||
Subject: [PATCH] Add (partial, cam id is hardcoded) support for Asus ZF6 motor
|
||||
camera
|
||||
|
||||
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
|
||||
---
|
||||
.../camera/libcameraservice/CameraService.cpp | 26 +++++++++++++++++++
|
||||
.../camera/libcameraservice/CameraService.h | 3 +++
|
||||
2 files changed, 29 insertions(+)
|
||||
|
||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||
index 62cbc7ddb..ddddfda97 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/wait.h>
|
||||
#include <inttypes.h>
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -131,6 +132,7 @@ Mutex CameraService::sProxyMutex;
|
||||
sp<hardware::ICameraServiceProxy> CameraService::sCameraServiceProxy;
|
||||
|
||||
CameraService::CameraService() :
|
||||
+ mPhysicalFrontCamStatus(false),
|
||||
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
|
||||
mNumberOfCameras(0),
|
||||
mSoundRef(0), mInitialized(false) {
|
||||
@@ -1549,6 +1551,7 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
|
||||
mServiceLock.lock();
|
||||
} else {
|
||||
// Otherwise, add client to active clients list
|
||||
+ physicalFrontCam(cameraId == "1");
|
||||
finishConnectLocked(client, partial);
|
||||
|
||||
sp<ICameraMotor> cameraMotor = ICameraMotor::getService();
|
||||
@@ -1564,6 +1567,27 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
|
||||
return ret;
|
||||
}
|
||||
|
||||
+void CameraService::physicalFrontCam(bool on) {
|
||||
+ if(on == mPhysicalFrontCamStatus) return;
|
||||
+ mPhysicalFrontCamStatus = on;
|
||||
+
|
||||
+ if(access("/dev/asusMotoDrv", F_OK) == 0) {
|
||||
+ int pid = fork();
|
||||
+ if(pid == 0) {
|
||||
+ const char* cmd[] = {
|
||||
+ "/system/bin/asus-motor",
|
||||
+ "0",
|
||||
+ NULL
|
||||
+ };
|
||||
+ cmd[1] = on ? "0" : "1";
|
||||
+ execve("/system/bin/asus-motor", (char**)cmd, environ);
|
||||
+ _exit(1);
|
||||
+ } else {
|
||||
+ waitpid(pid, NULL, 0);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
Status CameraService::setTorchMode(const String16& cameraId, bool enabled,
|
||||
const sp<IBinder>& clientBinder) {
|
||||
Mutex::Autolock lock(mServiceLock);
|
||||
@@ -2427,6 +2451,8 @@ binder::Status CameraService::BasicClient::disconnect() {
|
||||
cameraMotor->onDisconnect(mCameraIdStr.string());
|
||||
}
|
||||
|
||||
+ sCameraService->physicalFrontCam(false);
|
||||
+
|
||||
sCameraService->removeByClient(this);
|
||||
sCameraService->logDisconnected(mCameraIdStr, mClientPid, String8(mClientPackageName));
|
||||
sCameraService->mCameraProviderManager->removeRef(CameraProviderManager::DeviceMode::CAMERA,
|
||||
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
|
||||
index 065157dad..6d22da619 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.h
|
||||
+++ b/services/camera/libcameraservice/CameraService.h
|
||||
@@ -182,6 +182,9 @@ public:
|
||||
// Monitored UIDs availability notification
|
||||
void notifyMonitoredUids();
|
||||
|
||||
+ bool mPhysicalFrontCamStatus;
|
||||
+ void physicalFrontCam(bool on);
|
||||
+
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Client functionality
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,38 +0,0 @@
|
||||
From d3828e0c23e79717b3b47ae29980be0b4726dc89 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 3 Dec 2019 14:04:17 +0100
|
||||
Subject: [PATCH 12/12] Fix for some Huawei camera (that's not ideal because it
|
||||
is a revert, it needs to be further investigated and cleaned)
|
||||
|
||||
---
|
||||
services/camera/libcameraservice/CameraService.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
|
||||
index ca0231c9e..9bb5db067 100644
|
||||
--- a/services/camera/libcameraservice/CameraService.cpp
|
||||
+++ b/services/camera/libcameraservice/CameraService.cpp
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#define LOG_TAG "CameraService"
|
||||
#define ATRACE_TAG ATRACE_TAG_CAMERA
|
||||
-//#define LOG_NDEBUG 0
|
||||
+#define LOG_NDEBUG 0
|
||||
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
@@ -223,9 +223,9 @@ status_t CameraService::enumerateProviders() {
|
||||
}
|
||||
}
|
||||
|
||||
- if (getCameraState(id8) == nullptr) {
|
||||
+ //if (getCameraState(id8) == nullptr) {
|
||||
onDeviceStatusChanged(id8, CameraDeviceStatus::PRESENT);
|
||||
- }
|
||||
+ //}
|
||||
}
|
||||
|
||||
return OK;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 9f8c77fea17968dd20e76b83b28f2fce2630a087 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sat, 24 Mar 2018 08:01:48 +0100
|
||||
Subject: [PATCH 01/36] Fix backlight control on Galaxy S9(+)
|
||||
|
||||
Change-Id: I1fbbb47939c377597ef8ad6b88b2acea5f4acaa6
|
||||
---
|
||||
.../android/server/lights/LightsService.java | 17 +++++++++++++----
|
||||
1 file changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index ac906bb23d3..e23e2cd3c4d 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -21,6 +21,7 @@ import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.PowerManager;
|
||||
+import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.provider.Settings;
|
||||
import android.util.Slog;
|
||||
@@ -71,6 +72,7 @@ public class LightsService extends SystemService {
|
||||
": brightness=0x" + Integer.toHexString(brightness));
|
||||
return;
|
||||
}
|
||||
+
|
||||
// Ideally, we'd like to set the brightness mode through the SF/HWC as well, but
|
||||
// right now we just fall back to the old path through Lights brightessMode is
|
||||
// anything but USER or the device shouldBeInLowPersistenceMode().
|
||||
@@ -86,11 +88,18 @@ public class LightsService extends SystemService {
|
||||
}
|
||||
SurfaceControl.setDisplayBrightness(mDisplayToken,
|
||||
(float) brightness / mSurfaceControlMaximumBrightness);
|
||||
- } else {
|
||||
- int color = brightness & 0x000000ff;
|
||||
- color = 0xff000000 | (color << 16) | (color << 8) | color;
|
||||
- setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
}
|
||||
+
|
||||
+ String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
+ if(fp.contains("starlte") || fp.contains("star2lte")) {
|
||||
+ setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ int color = brightness & 0x000000ff;
|
||||
+ color = 0xff000000 | (color << 16) | (color << 8) | color;
|
||||
+ setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From ae073ba9abbd86e82d06261ad260ea27fbc04f14 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 28 Nov 2017 18:28:04 +0100
|
||||
Subject: [PATCH] Relax requirement for visible flag to sdcards
|
||||
|
||||
The vast majority of sdcard readers are stable enough to be declared by
|
||||
the API. (I see no counter-example)
|
||||
FBE broke adoptable storage with SDCard, hence this need.
|
||||
|
||||
Change-Id: Ia616671c03562d1eadaff5531a5c708a62d7ad3a
|
||||
---
|
||||
.../core/java/com/android/server/StorageManagerService.java | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
|
||||
index 72f40cc0351..20ffd687e89 100644
|
||||
--- a/services/core/java/com/android/server/StorageManagerService.java
|
||||
+++ b/services/core/java/com/android/server/StorageManagerService.java
|
||||
@@ -1282,7 +1282,8 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
|
||||
// Adoptable public disks are visible to apps, since they meet
|
||||
// public API requirement of being in a stable location.
|
||||
- if (vol.disk.isAdoptable()) {
|
||||
+ // Assume all SDs match this as well
|
||||
+ if (vol.disk.isAdoptable() || vol.disk.isSd()) {
|
||||
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
|
||||
} else if (vol.disk.isSd()) {
|
||||
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,52 +0,0 @@
|
||||
From 78dcdf304f0baa325fe8d39e2e7cb64b46b9a089 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 1 May 2018 17:47:36 +0200
|
||||
Subject: [PATCH 03/36] Also scan /system/overlay
|
||||
|
||||
Change-Id: Ib0223560606b80cdaaa986b159b34b4db0154589
|
||||
---
|
||||
core/jni/android_util_AssetManager.cpp | 6 +++++-
|
||||
core/jni/fd_utils.cpp | 3 ++-
|
||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
|
||||
index 2b471fec9c8..4518c7e66a5 100644
|
||||
--- a/core/jni/android_util_AssetManager.cpp
|
||||
+++ b/core/jni/android_util_AssetManager.cpp
|
||||
@@ -163,7 +163,7 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) {
|
||||
}
|
||||
|
||||
// Generic idmap parameters
|
||||
- const char* argv[10];
|
||||
+ const char* argv[11];
|
||||
int argc = 0;
|
||||
struct stat st;
|
||||
|
||||
@@ -207,6 +207,10 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) {
|
||||
argv[argc++] = AssetManager::OEM_OVERLAY_DIR;
|
||||
}
|
||||
|
||||
+ if(stat("/system/overlay", &st) == 0) {
|
||||
+ argv[argc++] = "/system/overlay";
|
||||
+ }
|
||||
+
|
||||
// Finally, invoke idmap (if any overlay directory exists)
|
||||
if (argc > 5) {
|
||||
execv(AssetManager::IDMAP_BIN, (char* const*)argv);
|
||||
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
|
||||
index fa5f931470b..488c2f8e9e8 100644
|
||||
--- a/core/jni/fd_utils.cpp
|
||||
+++ b/core/jni/fd_utils.cpp
|
||||
@@ -118,7 +118,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
|
||||
|| android::base::StartsWith(path, kSystemOdmOverlayDir)
|
||||
|| android::base::StartsWith(path, kOdmOverlayDir)
|
||||
|| android::base::StartsWith(path, kSystemOemOverlayDir)
|
||||
- || android::base::StartsWith(path, kOemOverlayDir))
|
||||
+ || android::base::StartsWith(path, kOemOverlayDir)
|
||||
+ || android::base::StartsWith(path, "/system/overlay"))
|
||||
&& android::base::EndsWith(path, kApkSuffix)
|
||||
&& path.find("/../") == std::string::npos) {
|
||||
return true;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From e1a57d1f38bb45e69c9a2178ab34fd08adafe810 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 17 May 2018 20:28:35 +0200
|
||||
Subject: [PATCH 04/36] Don't crash if there is IR HAL is not declared
|
||||
|
||||
---
|
||||
services/core/java/com/android/server/ConsumerIrService.java | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
index 2ed6c77baa0..c574a03c9a3 100644
|
||||
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
||||
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
@@ -50,8 +50,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
|
||||
if (!mHasNativeHal) {
|
||||
throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!");
|
||||
}
|
||||
- } else if (mHasNativeHal) {
|
||||
- throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!");
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From c318f6086d6c12bb92de652440ee985256fd60c2 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 30 May 2018 14:05:30 +0200
|
||||
Subject: [PATCH 05/36] Fix(?) #62
|
||||
|
||||
---
|
||||
.../src/com/android/keyguard/KeyguardUpdateMonitor.java | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
||||
index 6a4dbc8d722..39535c32860 100644
|
||||
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
||||
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
||||
@@ -1117,7 +1117,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
|
||||
|
||||
@Override
|
||||
public void onAuthenticationError(int errMsgId, CharSequence errString) {
|
||||
- handleFingerprintError(errMsgId, errString.toString());
|
||||
+ if(errString != null)
|
||||
+ handleFingerprintError(errMsgId, errString.toString());
|
||||
+ else
|
||||
+ handleFingerprintError(errMsgId, "unknown error");
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 6556ccbc704c6cb4a3bae5e9411082f6e1e1ff71 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <pierre-hugues.husson@softathome.com>
|
||||
Date: Thu, 7 Jun 2018 13:36:51 +0200
|
||||
Subject: [PATCH 06/36] S9 brightness override only for screen
|
||||
|
||||
Change-Id: Ie16a46336fa64850014b962429f7a20ff569222f
|
||||
---
|
||||
.../com/android/server/lights/LightsService.java | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index e23e2cd3c4d..327979166c2 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -91,11 +91,13 @@ public class LightsService extends SystemService {
|
||||
return;
|
||||
}
|
||||
|
||||
- String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
- if(fp.contains("starlte") || fp.contains("star2lte")) {
|
||||
- setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
- return;
|
||||
- }
|
||||
+ if(mId == 0) {
|
||||
+ String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
+ if(fp.contains("starlte") || fp.contains("star2lte")) {
|
||||
+ setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
int color = brightness & 0x000000ff;
|
||||
color = 0xff000000 | (color << 16) | (color << 8) | color;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 21d4fc3b58aa737f78378c0df4987604bf4e32e0 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <pierre-hugues.husson@softathome.com>
|
||||
Date: Thu, 7 Jun 2018 13:42:02 +0200
|
||||
Subject: [PATCH 07/36] [WIP] Fix OP6 brightness
|
||||
|
||||
---
|
||||
.../com/android/server/lights/LightsService.java | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index 327979166c2..f0035c67f4a 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -97,6 +97,18 @@ public class LightsService extends SystemService {
|
||||
setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ boolean qcomExtendBrightness = SystemProperties.getBoolean("persist.extend.brightness", false);
|
||||
+ int scale = SystemProperties.getInt("persist.display.max_brightness", 1023);
|
||||
+ if(fp.contains("OnePlus6")) {
|
||||
+ qcomExtendBrightness = true;
|
||||
+ scale = 1023;
|
||||
+ }
|
||||
+
|
||||
+ if(qcomExtendBrightness) {
|
||||
+ setLightLocked(brightness * scale / 255, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
int color = brightness & 0x000000ff;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 7235d15f8ba322a1806a8736751cac88cecb9b53 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 10 Jun 2018 22:54:55 +0200
|
||||
Subject: [PATCH 08/36] Try to make brightness more generic using property set
|
||||
by rw-system
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index f0035c67f4a..529026a1e7c 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -100,9 +100,11 @@ public class LightsService extends SystemService {
|
||||
|
||||
boolean qcomExtendBrightness = SystemProperties.getBoolean("persist.extend.brightness", false);
|
||||
int scale = SystemProperties.getInt("persist.display.max_brightness", 1023);
|
||||
- if(fp.contains("OnePlus6")) {
|
||||
+ //This is set by vndk-detect
|
||||
+ int qcomScale = SystemProperties.getInt("persist.sys.qcom-brightness", -1);
|
||||
+ if(qcomScale != -1) {
|
||||
qcomExtendBrightness = true;
|
||||
- scale = 1023;
|
||||
+ scale = qcomScale;
|
||||
}
|
||||
|
||||
if(qcomExtendBrightness) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 5d557f64f712c73d97669f10532b5a2867c6f1d3 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 12 Jun 2018 22:55:32 +0200
|
||||
Subject: [PATCH 09/36] property-matching RROs: allow to prefix the value with
|
||||
+ to do glob match instead of exact match
|
||||
|
||||
---
|
||||
cmds/idmap/scan.cpp | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
|
||||
index d69dd79555a..2be6d23ac78 100644
|
||||
--- a/cmds/idmap/scan.cpp
|
||||
+++ b/cmds/idmap/scan.cpp
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <dirent.h>
|
||||
#include <inttypes.h>
|
||||
+#include <fnmatch.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -92,6 +93,10 @@ namespace {
|
||||
property_get(prop, propBuf, NULL);
|
||||
val = strndup16to8(value.string(), value.size());
|
||||
|
||||
+ if(val[0]=='+') {
|
||||
+ return fnmatch(val+1, propBuf, 0) != 0;
|
||||
+ }
|
||||
+
|
||||
return (strcmp(propBuf, val) == 0);
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From a95da9d8c3508280233a42dcbfc6440fbc95c563 Mon Sep 17 00:00:00 2001
|
||||
From: Song Fuchang <song.fc@gmail.com>
|
||||
Date: Sun, 17 Jun 2018 22:39:37 +0800
|
||||
Subject: [PATCH 10/36] Fix typo on fnmatch return value check
|
||||
|
||||
---
|
||||
cmds/idmap/scan.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
|
||||
index 2be6d23ac78..0acff23d031 100644
|
||||
--- a/cmds/idmap/scan.cpp
|
||||
+++ b/cmds/idmap/scan.cpp
|
||||
@@ -94,7 +94,7 @@ namespace {
|
||||
val = strndup16to8(value.string(), value.size());
|
||||
|
||||
if(val[0]=='+') {
|
||||
- return fnmatch(val+1, propBuf, 0) != 0;
|
||||
+ return fnmatch(val+1, propBuf, 0) == 0;
|
||||
}
|
||||
|
||||
return (strcmp(propBuf, val) == 0);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 695e8613f1bcee3f03269eb7f28ed9a91b41e2ad Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 25 Jun 2018 22:43:32 +0200
|
||||
Subject: [PATCH 11/36] Add Qualcomm starlte
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index 529026a1e7c..65f9ea87ae5 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -93,7 +93,9 @@ public class LightsService extends SystemService {
|
||||
|
||||
if(mId == 0) {
|
||||
String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
- if(fp.contains("starlte") || fp.contains("star2lte")) {
|
||||
+ if(
|
||||
+ fp.contains("starlte") || fp.contains("star2lte") ||
|
||||
+ fp.contains("starqlte") || fp.contains("star2qlte")) {
|
||||
setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From f1176c850abc148002e5986db5ccecac116b91c9 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 2 Jul 2018 23:36:39 +0200
|
||||
Subject: [PATCH 12/36] [Galaxy S9] "remaining" of HAL onEnroll is actually a
|
||||
percent of progress
|
||||
|
||||
Change-Id: I8a586163eca93ae3c5bd968d1e7ddbf994ddcc91
|
||||
---
|
||||
.../server/biometrics/fingerprint/FingerprintService.java | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
index 24fd1b7a6da..dc56a95217c 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
@@ -588,7 +588,13 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
final Fingerprint fingerprint =
|
||||
new Fingerprint(getBiometricUtils().getUniqueName(getContext(), groupId),
|
||||
groupId, fingerId, deviceId);
|
||||
- FingerprintService.super.handleEnrollResult(fingerprint, remaining);
|
||||
+
|
||||
+ int remaining2 = remaining;
|
||||
+ String fp = android.os.SystemProperties.get("ro.vendor.build.fingerprint");
|
||||
+ if(fp != null && (fp.contains("starlte") || fp.contains("star2lte") || fp.contains("starqlte") || fp.contains("star2qlte")))
|
||||
+ remaining2 = 100 - remaining2;
|
||||
+
|
||||
+ FingerprintService.super.handleEnrollResult(fingerprint, remaining2);
|
||||
});
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,25 +0,0 @@
|
||||
From ca9cc0e485753ac43ea8fba76638b00495669f39 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 6 Aug 2018 12:49:00 +0200
|
||||
Subject: [PATCH 13/36] Show APN Settings for CDMA carriers
|
||||
|
||||
---
|
||||
telephony/java/android/telephony/CarrierConfigManager.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
|
||||
index 19f8203f750..4e0fcbb7358 100755
|
||||
--- a/telephony/java/android/telephony/CarrierConfigManager.java
|
||||
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
|
||||
@@ -3073,7 +3073,7 @@ public class CarrierConfigManager {
|
||||
sDefaults.putBoolean(KEY_MDN_IS_ADDITIONAL_VOICEMAIL_NUMBER_BOOL, false);
|
||||
sDefaults.putBoolean(KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
|
||||
sDefaults.putBoolean(KEY_PREFER_2G_BOOL, true);
|
||||
- sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, false);
|
||||
+ sDefaults.putBoolean(KEY_SHOW_APN_SETTING_CDMA_BOOL, true);
|
||||
sDefaults.putBoolean(KEY_SHOW_CDMA_CHOICES_BOOL, false);
|
||||
sDefaults.putBoolean(KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL, false);
|
||||
sDefaults.putBoolean(KEY_SUPPORT_EMERGENCY_SMS_OVER_IMS_BOOL, false);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 1597769b8c2d3faabd76ba20368409293709a2d5 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 10:51:06 +0200
|
||||
Subject: [PATCH 14/36] idmap: Don't silently ignore RROs with same priority
|
||||
|
||||
Change-Id: I64a6899f1b30e0cd9e9a872b7ca83d831f038cbe
|
||||
---
|
||||
cmds/idmap/scan.cpp | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
|
||||
index 0acff23d031..d1dde52732f 100644
|
||||
--- a/cmds/idmap/scan.cpp
|
||||
+++ b/cmds/idmap/scan.cpp
|
||||
@@ -29,6 +29,8 @@ namespace {
|
||||
|
||||
bool operator<(Overlay const& rhs) const
|
||||
{
|
||||
+ if(rhs.priority == priority)
|
||||
+ return rhs.apk_path > apk_path;
|
||||
return rhs.priority > priority;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 807d3807f81b4893cd5186c60cfcf94920281a41 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kondik <steve@cyngn.com>
|
||||
Date: Sat, 3 Jan 2015 05:13:26 -0800
|
||||
Subject: [PATCH 16/36] power: Disable keyboard/button lights while
|
||||
dozing/dreaming
|
||||
|
||||
* With hardkeys and doze mode enabled, entering suspend results in
|
||||
an epic battle over the lights. It's a bad situation. Disable
|
||||
them when we're sleepy.
|
||||
|
||||
Change-Id: I7f1fc35a1573717d1ea101a07c4171d6f66d1553
|
||||
---
|
||||
.../core/java/com/android/server/power/PowerManagerService.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
|
||||
index 5cccc77ac53..e7d5315a2b9 100644
|
||||
--- a/services/core/java/com/android/server/power/PowerManagerService.java
|
||||
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
|
||||
@@ -2040,7 +2040,7 @@ public final class PowerManagerService extends SystemService
|
||||
final long nextProfileTimeout = getNextProfileTimeoutLocked(now);
|
||||
|
||||
mUserActivitySummary = 0;
|
||||
- if (mLastUserActivityTime >= mLastWakeTime) {
|
||||
+ if (mWakefulness == WAKEFULNESS_AWAKE && mLastUserActivityTime >= mLastWakeTime) {
|
||||
nextTimeout = mLastUserActivityTime
|
||||
+ screenOffTimeout - screenDimDuration;
|
||||
if (now < nextTimeout) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From d7a6847541ff67793487d581067ca724b3144c60 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 21 Aug 2018 22:24:02 +0200
|
||||
Subject: [PATCH] Don't wake IR HAL to the infinity and beyond
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/ConsumerIrService.java | 7 -------
|
||||
services/core/jni/com_android_server_ConsumerIrService.cpp | 2 +-
|
||||
2 files changed, 1 insertion(+), 8 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
index 2ed6c77baa0..82ec033bc30 100644
|
||||
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
||||
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
@@ -46,13 +46,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub {
|
||||
mWakeLock.setReferenceCounted(true);
|
||||
|
||||
mHasNativeHal = halOpen();
|
||||
- if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR)) {
|
||||
- if (!mHasNativeHal) {
|
||||
- throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!");
|
||||
- }
|
||||
- } else if (mHasNativeHal) {
|
||||
- throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!");
|
||||
- }
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
||||
index 2ca348b3ae4..148fba9a688 100644
|
||||
--- a/services/core/jni/com_android_server_ConsumerIrService.cpp
|
||||
+++ b/services/core/jni/com_android_server_ConsumerIrService.cpp
|
||||
@@ -36,7 +36,7 @@ static sp<IConsumerIr> mHal;
|
||||
|
||||
static jboolean halOpen(JNIEnv* /* env */, jobject /* obj */) {
|
||||
// TODO(b/31632518)
|
||||
- mHal = IConsumerIr::getService();
|
||||
+ mHal = IConsumerIr::tryGetService();
|
||||
return mHal != nullptr;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 410c6135bef8bc83e49b182f7d3408c46ca47584 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 23 Aug 2018 23:39:16 +0200
|
||||
Subject: [PATCH 18/36] Switch samsung light fingerprint match to regexp, to
|
||||
include Note9
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index 65f9ea87ae5..aa014bf9ff4 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -93,9 +93,7 @@ public class LightsService extends SystemService {
|
||||
|
||||
if(mId == 0) {
|
||||
String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
- if(
|
||||
- fp.contains("starlte") || fp.contains("star2lte") ||
|
||||
- fp.contains("starqlte") || fp.contains("star2qlte")) {
|
||||
+ if(fp.matches(".*(crown|star)[q2]*lte.*")) {
|
||||
setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From 378df1aac9a2b439e20dcc60d216f8c15974fdca Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 27 Aug 2018 00:47:13 +0200
|
||||
Subject: [PATCH 19/36] Add a property toggle to enable high brightness range
|
||||
on samsung device
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index aa014bf9ff4..a18ae0d6159 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -94,7 +94,11 @@ public class LightsService extends SystemService {
|
||||
if(mId == 0) {
|
||||
String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
if(fp.matches(".*(crown|star)[q2]*lte.*")) {
|
||||
- setLightLocked(brightness*100, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
+ int newBrightness = brightness * 100;
|
||||
+ if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
+ newBrightness = (int) (brightness * 40960.0 / 255.0);
|
||||
+ }
|
||||
+ setLightLocked(newBrightness, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 6c3996a1e42192a481ac029932fc1c4eade50488 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 29 Aug 2018 11:05:54 +0200
|
||||
Subject: [PATCH 20/36] Add a property to override pre-o max aspect ratio
|
||||
|
||||
Change-Id: Id001a19fab7680feda841202b6e91c490d0d5ffa
|
||||
---
|
||||
.../core/java/com/android/server/wm/ActivityRecord.java | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
index 371a9435643..5b61f215f3f 100644
|
||||
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
@@ -2837,6 +2837,12 @@ final class ActivityRecord extends ConfigurationContainer {
|
||||
// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.
|
||||
private void updateOverrideConfiguration() {
|
||||
final Configuration overrideConfig = mTmpConfig;
|
||||
+ if(info.applicationInfo.targetSdkVersion < O) {
|
||||
+ try {
|
||||
+ maxAspectRatio = Float.parseFloat(SystemProperties.get("persist.sys.max_aspect_ratio.pre_o", ""));
|
||||
+ } catch (Throwable t) {}
|
||||
+ Log.d("PHH", "Overrode aspect ratio because pre-o to " + maxAspectRatio);
|
||||
+ }
|
||||
if (shouldUseSizeCompatMode()) {
|
||||
if (mCompatDisplayInsets != null) {
|
||||
// The override configuration is set only once in size compatibility mode.
|
||||
@@ -3070,7 +3076,7 @@ final class ActivityRecord extends ConfigurationContainer {
|
||||
// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.
|
||||
private void computeBounds(Rect outBounds, Rect containingAppBounds) {
|
||||
outBounds.setEmpty();
|
||||
- final float maxAspectRatio = info.maxAspectRatio;
|
||||
+ float maxAspectRatio = info.maxAspectRatio;
|
||||
final ActivityStack stack = getActivityStack();
|
||||
final float minAspectRatio = info.minAspectRatio;
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 05ed3ef7fba2ae7fc012ca296c60af4238c91550 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 28 Aug 2018 20:39:26 +0200
|
||||
Subject: [PATCH 21/36] Add japanese S9
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index a18ae0d6159..37e03880f1e 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -93,7 +93,8 @@ public class LightsService extends SystemService {
|
||||
|
||||
if(mId == 0) {
|
||||
String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
- if(fp.matches(".*(crown|star)[q2]*lte.*")) {
|
||||
+ if(fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
+ fp.matches(".*(SC-0[23]K|SCV3[89]).*")) {
|
||||
int newBrightness = brightness * 100;
|
||||
if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
newBrightness = (int) (brightness * 40960.0 / 255.0);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,36 +0,0 @@
|
||||
From 089eae49049ea602363949e8593acfd5447530c6 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 8 Nov 2018 23:04:03 +0100
|
||||
Subject: [PATCH 22/36] Re-order services so that it works even without qtaguid
|
||||
|
||||
---
|
||||
.../com/android/server/net/NetworkPolicyManagerService.java | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
||||
index 6c34e1313f7..337b22c3587 100644
|
||||
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
||||
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
||||
@@ -725,6 +725,9 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
||||
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "systemReady");
|
||||
final int oldPriority = Process.getThreadPriority(Process.myTid());
|
||||
try {
|
||||
+ mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
|
||||
+ mNetworkStats = LocalServices.getService(NetworkStatsManagerInternal.class);
|
||||
+
|
||||
// Boost thread's priority during system server init
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
|
||||
if (!isBandwidthControlEnabled()) {
|
||||
@@ -732,9 +735,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
||||
return;
|
||||
}
|
||||
|
||||
- mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class);
|
||||
- mNetworkStats = LocalServices.getService(NetworkStatsManagerInternal.class);
|
||||
-
|
||||
synchronized (mUidRulesFirstLock) {
|
||||
synchronized (mNetworkPoliciesSecondLock) {
|
||||
updatePowerSaveWhitelistUL();
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 1fa1945234225aa9d6201a7da2990fd17b544dc7 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 10 Mar 2019 19:35:06 +0100
|
||||
Subject: [PATCH 23/36] Different value for astarqlte. Probably more devices to
|
||||
add later
|
||||
|
||||
---
|
||||
.../java/com/android/server/lights/LightsService.java | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index 37e03880f1e..993483c342b 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -93,6 +93,15 @@ public class LightsService extends SystemService {
|
||||
|
||||
if(mId == 0) {
|
||||
String fp = SystemProperties.get("ro.vendor.build.fingerprint", "hello");
|
||||
+ if(fp.matches(".*astarqlte.*")) {
|
||||
+ int newBrightness = brightness;
|
||||
+ if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
+ newBrightness = (int) (brightness * 365.0 / 255.0);
|
||||
+ }
|
||||
+ setLightLocked(newBrightness, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if(fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
fp.matches(".*(SC-0[23]K|SCV3[89]).*")) {
|
||||
int newBrightness = brightness * 100;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,70 +0,0 @@
|
||||
From 8049bd5138e52042ed47b8b0700753cb77b57641 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 24 Mar 2019 23:05:14 +0100
|
||||
Subject: [PATCH] Support new samsung light hal
|
||||
|
||||
Change-Id: I88ca834894320129737b4e31fa8f7e5ee918889a
|
||||
---
|
||||
services/core/jni/Android.bp | 1 +
|
||||
...om_android_server_lights_LightsService.cpp | 19 +++++++++++++++++++
|
||||
2 files changed, 20 insertions(+)
|
||||
|
||||
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
|
||||
index fdcefd42316..d8645012e24 100644
|
||||
--- a/services/core/jni/Android.bp
|
||||
+++ b/services/core/jni/Android.bp
|
||||
@@ -135,6 +135,7 @@ cc_defaults {
|
||||
"android.system.suspend@1.0",
|
||||
"suspend_control_aidl_interface-cpp",
|
||||
"vendor.lineage.power@1.0",
|
||||
+ "vendor.samsung.hardware.light@2.0",
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
index 35d8219651d..20de7985d1d 100644
|
||||
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <android/hardware/light/2.0/ILight.h>
|
||||
#include <android/hardware/light/2.0/types.h>
|
||||
+#include <vendor/samsung/hardware/light/2.0/ISecLight.h>
|
||||
+#include <vendor/samsung/hardware/light/2.0/types.h>
|
||||
#include <android-base/chrono_utils.h>
|
||||
#include <utils/misc.h>
|
||||
#include <utils/Log.h>
|
||||
@@ -40,6 +42,8 @@ using Type = ::android::hardware::light::V2_0::Type;
|
||||
template<typename T>
|
||||
using Return = ::android::hardware::Return<T>;
|
||||
|
||||
+using ISecLight = ::vendor::samsung::hardware::light::V2_0::ISecLight;
|
||||
+using SecType = ::vendor::samsung::hardware::light::V2_0::SecType;
|
||||
static bool sLightSupported = true;
|
||||
|
||||
static bool validate(jint light, jint flash, jint brightness) {
|
||||
@@ -151,6 +155,21 @@ static void setLight_native(
|
||||
colorAlpha = (colorAlpha * brightnessLevel) / 0xFF;
|
||||
colorARGB = (colorAlpha << 24) + (colorARGB & 0x00FFFFFF);
|
||||
}
|
||||
+
|
||||
+ sp<ISecLight> secHal = ISecLight::getService();
|
||||
+
|
||||
+ if(secHal != nullptr) {
|
||||
+ SecType type = static_cast<SecType>(light);
|
||||
+ LightState state = constructState(
|
||||
+ colorARGB, flashMode, onMS, offMS, brightnessMode);
|
||||
+
|
||||
+ {
|
||||
+ android::base::Timer t;
|
||||
+ Return<Status> ret = secHal->setLightSec(type, state);
|
||||
+ processReturn(ret, static_cast<Type>(light), state);
|
||||
+ if (t.duration() > 50ms) ALOGD("Excessive delay setting light");
|
||||
+ }
|
||||
+ }
|
||||
|
||||
Type type = static_cast<Type>(light);
|
||||
LightState state = constructState(
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 454a0898504d1af98f687ebdbc8bc7b13a3d3ff5 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 24 Apr 2019 20:09:53 +0200
|
||||
Subject: [PATCH 25/36] Fix backlight on S10*. Add an additional property to
|
||||
check, so testers can try it more easily
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index 993483c342b..a578ed894c4 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -102,7 +102,9 @@ public class LightsService extends SystemService {
|
||||
return;
|
||||
}
|
||||
|
||||
- if(fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
+ if(SystemProperties.getInt("persist.sys.phh.samsung_backlight", 0) == 1 ||
|
||||
+ fp.matches(".*beyond.*lte.*") ||
|
||||
+ fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
fp.matches(".*(SC-0[23]K|SCV3[89]).*")) {
|
||||
int newBrightness = brightness * 100;
|
||||
if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 571bf63da97814631982b28b41f96781a13848a8 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 2 Jul 2019 21:15:07 +0200
|
||||
Subject: [PATCH 26/36] Make samsung light HAL more overridable
|
||||
|
||||
---
|
||||
.../android/server/lights/LightsService.java | 24 ++++++++++++-------
|
||||
1 file changed, 15 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index a578ed894c4..ac102c94770 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -102,16 +102,22 @@ public class LightsService extends SystemService {
|
||||
return;
|
||||
}
|
||||
|
||||
- if(SystemProperties.getInt("persist.sys.phh.samsung_backlight", 0) == 1 ||
|
||||
- fp.matches(".*beyond.*lte.*") ||
|
||||
- fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
- fp.matches(".*(SC-0[23]K|SCV3[89]).*")) {
|
||||
- int newBrightness = brightness * 100;
|
||||
- if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
- newBrightness = (int) (brightness * 40960.0 / 255.0);
|
||||
+ int useSamsungBacklight = SystemProperties.getInt("persist.sys.phh.samsung_backlight", -1);
|
||||
+ if(useSamsungBacklight != 0) {
|
||||
+ if(useSamsungBacklight > 0 ||
|
||||
+ fp.matches(".*beyond.*lte.*") ||
|
||||
+ fp.matches(".*(crown|star)[q2]*lte.*") ||
|
||||
+ fp.matches(".*(SC-0[23]K|SCV3[89]).*")) {
|
||||
+ int ratio = 100;
|
||||
+ if(useSamsungBacklight > 1)
|
||||
+ ratio = useSamsungBacklight;
|
||||
+ int newBrightness = brightness * ratio;
|
||||
+ if(SystemProperties.getBoolean("persist.sys.samsung.full_brightness", false)) {
|
||||
+ newBrightness = (int) (brightness * 40960.0 / 255.0);
|
||||
+ }
|
||||
+ setLightLocked(newBrightness, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
+ return;
|
||||
}
|
||||
- setLightLocked(newBrightness, LIGHT_FLASH_HARDWARE, 0, 0, brightnessMode);
|
||||
- return;
|
||||
}
|
||||
|
||||
boolean qcomExtendBrightness = SystemProperties.getBoolean("persist.extend.brightness", false);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From d02ed45de2a9ad381a735ae0649f61dbca1f1d41 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 2 Jul 2019 21:19:29 +0200
|
||||
Subject: [PATCH 27/36] Make Samsung fingerprint broken HAL overridable
|
||||
|
||||
Change-Id: I8be38daa7c80fdb61e9209f12215e6daea171d03
|
||||
---
|
||||
.../server/biometrics/fingerprint/FingerprintService.java | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
index dc56a95217c..19593e7e047 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
@@ -590,8 +590,10 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
groupId, fingerId, deviceId);
|
||||
|
||||
int remaining2 = remaining;
|
||||
+ int overrideSamsung = android.os.SystemProperties.getInt("persist.sys.phh.samsung_fingerprint", -1);
|
||||
+
|
||||
String fp = android.os.SystemProperties.get("ro.vendor.build.fingerprint");
|
||||
- if(fp != null && (fp.contains("starlte") || fp.contains("star2lte") || fp.contains("starqlte") || fp.contains("star2qlte")))
|
||||
+ if(overrideSamsung == 1 || (overrideSamsung != 0 && fp != null && fp.startsWith("samsung/")))
|
||||
remaining2 = 100 - remaining2;
|
||||
|
||||
FingerprintService.super.handleEnrollResult(fingerprint, remaining2);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From 677389d4f112ca9368d55e1eb661727e5974eeb1 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 11 Aug 2019 10:30:37 +0200
|
||||
Subject: [PATCH 29/36] Add property to use linear brightness slider
|
||||
|
||||
---
|
||||
.../com/android/settingslib/display/BrightnessUtils.java | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
|
||||
index 55723f9d8ed..da8ce4a67e9 100644
|
||||
--- a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
|
||||
+++ b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
|
||||
@@ -50,7 +50,12 @@ public class BrightnessUtils {
|
||||
* @param max The maximum acceptable value for the setting.
|
||||
* @return The corresponding setting value.
|
||||
*/
|
||||
+ private static final boolean useLinearBrightness = android.os.SystemProperties.getBoolean("persist.sys.phh.linear_brightness", false);
|
||||
public static final int convertGammaToLinear(int val, int min, int max) {
|
||||
+ if(useLinearBrightness) {
|
||||
+ if(val < 4) return 1;
|
||||
+ return val/4;
|
||||
+ }
|
||||
final float normalizedVal = MathUtils.norm(0, GAMMA_SPACE_MAX, val);
|
||||
final float ret;
|
||||
if (normalizedVal <= R) {
|
||||
@@ -87,6 +92,7 @@ public class BrightnessUtils {
|
||||
* @return The corresponding slider value
|
||||
*/
|
||||
public static final int convertLinearToGamma(int val, int min, int max) {
|
||||
+ if(useLinearBrightness) return val*4;
|
||||
// For some reason, HLG normalizes to the range [0, 12] rather than [0, 1]
|
||||
final float normalizedVal = MathUtils.norm(min, max, val) * 12;
|
||||
final float ret;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,45 +0,0 @@
|
||||
From f93124e38386cc549fa02126c776098923f73ed7 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 12 Aug 2019 23:08:26 +0200
|
||||
Subject: [PATCH 30/36] Add support for samsung touch proximity sensor as
|
||||
fallback to real proximity sensor
|
||||
|
||||
---
|
||||
.../server/display/DisplayPowerController.java | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
index fb381c33cbc..a262c86b7c7 100644
|
||||
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
@@ -529,6 +529,13 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
||||
|
||||
if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) {
|
||||
mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
||||
+ if(mProximitySensor == null) {
|
||||
+ List<Sensor> sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
|
||||
+ for(Sensor sensor: sensors) {
|
||||
+ if("com.samsung.sensor.touch_proximity".equals(sensor.getStringType()))
|
||||
+ mProximitySensor = sensor;
|
||||
+ }
|
||||
+ }
|
||||
if (mProximitySensor != null) {
|
||||
mProximityThreshold = Math.min(mProximitySensor.getMaximumRange(),
|
||||
TYPICAL_PROXIMITY_THRESHOLD);
|
||||
@@ -1944,6 +1951,13 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
if (mProximitySensorEnabled) {
|
||||
final long time = SystemClock.uptimeMillis();
|
||||
+ if("com.samsung.sensor.touch_proximity".equals(mProximitySensor.getStringType())) {
|
||||
+ int v = (int)event.values[0];
|
||||
+ boolean positive = (v <= 4);
|
||||
+ android.util.Log.d("PHH", "Samsung sensor changed " + positive + ":" + v);
|
||||
+ handleProximitySensorEvent(time, positive);
|
||||
+ return;
|
||||
+ }
|
||||
final float distance = event.values[0];
|
||||
boolean positive = distance >= 0.0f && distance < mProximityThreshold;
|
||||
handleProximitySensorEvent(time, positive);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,30 +0,0 @@
|
||||
From f852fefd22c754345767a7c3d3024f4f93791a3d Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 14 Aug 2019 08:50:47 +0200
|
||||
Subject: [PATCH 31/36] Use Samsung power HAL
|
||||
|
||||
Samsung likes to have two android.hardware.power@1.0 implementation
|
||||
side-by-side, one that works, one that doesn't.
|
||||
Pick the one that works.
|
||||
---
|
||||
.../core/jni/com_android_server_power_PowerManagerService.cpp | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
index 73bb579bd27..a211eef3d24 100644
|
||||
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
@@ -92,7 +92,9 @@ static bool checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodNa
|
||||
// The caller must be holding gPowerHalMutex.
|
||||
static void connectPowerHalLocked() {
|
||||
if (gPowerHalExists && gPowerHalV1_0_ == nullptr) {
|
||||
- gPowerHalV1_0_ = IPowerV1_0::getService();
|
||||
+ gPowerHalV1_0_ = IPowerV1_0::getService("miscpower");
|
||||
+ if(gPowerHalV1_0_ == nullptr)
|
||||
+ gPowerHalV1_0_ = IPowerV1_0::getService();
|
||||
if (gPowerHalV1_0_ != nullptr) {
|
||||
ALOGI("Loaded power HAL 1.0 service");
|
||||
// Try cast to powerHAL V1_1
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 32ce2b67710daf2e8b81f99a3660210f96d04f3a Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 14 Aug 2019 23:36:45 +0200
|
||||
Subject: [PATCH 32/36] Also add com.samsung.sensor.physical_proximity (if
|
||||
available, it is more a true proximity sensor than touch proximity sensor)
|
||||
|
||||
---
|
||||
.../com/android/server/display/DisplayPowerController.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
index a262c86b7c7..7c38f62b256 100644
|
||||
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
|
||||
@@ -529,6 +529,13 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call
|
||||
|
||||
if (!DEBUG_PRETEND_PROXIMITY_SENSOR_ABSENT) {
|
||||
mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY);
|
||||
+ if(mProximitySensor == null) {
|
||||
+ List<Sensor> sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
|
||||
+ for(Sensor sensor: sensors) {
|
||||
+ if("com.samsung.sensor.physical_proximity".equals(sensor.getStringType()))
|
||||
+ mProximitySensor = sensor;
|
||||
+ }
|
||||
+ }
|
||||
if(mProximitySensor == null) {
|
||||
List<Sensor> sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
|
||||
for(Sensor sensor: sensors) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,413 +0,0 @@
|
||||
From b15c825ccb48260a85695db41aff138787d1817f Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 24 Mar 2019 22:48:39 +0100
|
||||
Subject: [PATCH] wip
|
||||
|
||||
Change-Id: I50fa9a7a670cef5b93fc4a3a027f1587b1214831
|
||||
---
|
||||
Android.bp | 2 +
|
||||
services/core/Android.bp | 1 +
|
||||
.../biometrics/fingerprint/FacolaView.java | 210 ++++++++++++++++++
|
||||
.../fingerprint/FingerprintService.java | 26 ++-
|
||||
.../testharness/TestHarnessModeService.java | 7 +-
|
||||
.../com/android/server/wm/ActivityRecord.java | 6 -
|
||||
...om_android_server_lights_LightsService.cpp | 15 +-
|
||||
7 files changed, 255 insertions(+), 12 deletions(-)
|
||||
create mode 100644 services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
|
||||
diff --git a/Android.bp b/Android.bp
|
||||
index 16abdbf79de..d01dc639c8f 100644
|
||||
--- a/Android.bp
|
||||
+++ b/Android.bp
|
||||
@@ -777,6 +777,8 @@ java_defaults {
|
||||
"android.hardware.vibrator-V1.2-java",
|
||||
"android.hardware.vibrator-V1.3-java",
|
||||
"android.hardware.wifi-V1.0-java-constants",
|
||||
+ "vendor.mediatek.hardware.radio-V2.0-java",
|
||||
+ "vendor.samsung.hardware.radio-V1.2-java",
|
||||
"devicepolicyprotosnano",
|
||||
],
|
||||
|
||||
diff --git a/services/core/Android.bp b/services/core/Android.bp
|
||||
index ee26710cf7b..2e7118da1c0 100644
|
||||
--- a/services/core/Android.bp
|
||||
+++ b/services/core/Android.bp
|
||||
@@ -55,6 +55,7 @@ java_library_static {
|
||||
"dnsresolver_aidl_interface-V2-java",
|
||||
"netd_aidl_interface-V2-java",
|
||||
"netd_event_listener_interface-java",
|
||||
+ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
|
||||
],
|
||||
}
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
new file mode 100644
|
||||
index 00000000000..8829bcb7e48
|
||||
--- /dev/null
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -0,0 +1,210 @@
|
||||
+/**
|
||||
+ * Copyright (C) 2019 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.
|
||||
+ */
|
||||
+
|
||||
+package com.android.server.biometrics.fingerprint;
|
||||
+
|
||||
+import android.graphics.Canvas;
|
||||
+import android.graphics.Color;
|
||||
+import android.graphics.Paint;
|
||||
+import android.content.Context;
|
||||
+import android.view.View.OnTouchListener;
|
||||
+import android.view.View;
|
||||
+import android.widget.ImageView;
|
||||
+import android.view.MotionEvent;
|
||||
+import android.util.Slog;
|
||||
+
|
||||
+import android.view.WindowManager;
|
||||
+import android.graphics.PixelFormat;
|
||||
+import android.view.Gravity;
|
||||
+
|
||||
+import java.io.PrintWriter;
|
||||
+
|
||||
+import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
|
||||
+
|
||||
+import android.os.Handler;
|
||||
+import android.os.HandlerThread;
|
||||
+import android.os.ServiceManager;
|
||||
+
|
||||
+public class FacolaView extends ImageView implements OnTouchListener {
|
||||
+ private final int mX, mY, mW, mH;
|
||||
+ private final Paint mPaintFingerprint = new Paint();
|
||||
+ private final Paint mPaintShow = new Paint();
|
||||
+ private IXiaomiFingerprint mXiaomiFingerprint = null;
|
||||
+ private boolean mInsideCircle = false;
|
||||
+ private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
|
||||
+
|
||||
+ private final static float UNTOUCHED_DIM = .1f;
|
||||
+ private final static float TOUCHED_DIM = .9f;
|
||||
+
|
||||
+ private final HandlerThread mHandlerThread;
|
||||
+ private final Handler mHandler;
|
||||
+
|
||||
+ private final WindowManager mWM;
|
||||
+ FacolaView(Context context) {
|
||||
+ super(context);
|
||||
+
|
||||
+ mHandlerThread = new HandlerThread("FacolaThread");
|
||||
+ mHandlerThread.start();
|
||||
+ mHandler = new Handler(mHandlerThread.getLooper());
|
||||
+
|
||||
+ String[] location = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y", "").split(",");
|
||||
+ String[] size = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.size.width_height", "").split(",");
|
||||
+ Slog.d("PHH-Enroll", "FacolaView hello");
|
||||
+ if(size.length == 2 && location.length == 2) {
|
||||
+ Slog.d("PHH-Enroll", "Got real values");
|
||||
+ mX = Integer.parseInt(location[0]);
|
||||
+ mY = Integer.parseInt(location[1]);
|
||||
+ mW = Integer.parseInt(size[0]);
|
||||
+ mH = Integer.parseInt(size[1]);
|
||||
+ } else {
|
||||
+ mX = -1;
|
||||
+ mY = -1;
|
||||
+ mW = -1;
|
||||
+ mH = -1;
|
||||
+ }
|
||||
+
|
||||
+ mPaintFingerprint.setAntiAlias(true);
|
||||
+ mPaintFingerprint.setColor(Color.GREEN);
|
||||
+
|
||||
+ mPaintShow.setAntiAlias(true);
|
||||
+ mPaintShow.setColor(Color.argb(0x18, 0x00, 0xff, 0x00));
|
||||
+ setOnTouchListener(this);
|
||||
+ mWM = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
+ Slog.d("PHH-Enroll", "Created facola...");
|
||||
+ try {
|
||||
+ if(mW != -1)
|
||||
+ mXiaomiFingerprint = IXiaomiFingerprint.getService();
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed getting xiaomi fingerprint service", e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void onDraw(Canvas canvas) {
|
||||
+ super.onDraw(canvas);
|
||||
+
|
||||
+ Slog.d("PHH-Enroll", "Drawing at " + mX + ", " + mY + ", " + mW + ", " + mH);
|
||||
+ //TODO w!=h?
|
||||
+ if(mInsideCircle) {
|
||||
+ try {
|
||||
+ int nitValue = 3;
|
||||
+ if(mXiaomiFingerprint != null)
|
||||
+ mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
+ }
|
||||
+
|
||||
+ canvas.drawCircle(mW/2, mH/2, (float) (mW/2.0f), this.mPaintFingerprint);
|
||||
+ } else {
|
||||
+ try {
|
||||
+ if(mXiaomiFingerprint != null)
|
||||
+ mXiaomiFingerprint.extCmd(0xa, 0);
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
+ }
|
||||
+ canvas.drawCircle(mW/2, mH/2, (float) (mW/2.0f), this.mPaintShow);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onTouch(View v, MotionEvent event) {
|
||||
+ float x = event.getAxisValue(MotionEvent.AXIS_X);
|
||||
+ float y = event.getAxisValue(MotionEvent.AXIS_Y);
|
||||
+
|
||||
+ boolean newInside = (x > 0 && x < mW) && (y > 0 && y < mW);
|
||||
+ if(event.getAction() == MotionEvent.ACTION_UP)
|
||||
+ newInside = false;
|
||||
+
|
||||
+ Slog.d("PHH-Enroll", "Got action " + event.getAction() + ", x = " + x + ", y = " + y + ", inside = " + mInsideCircle + "/" + newInside);
|
||||
+ if(newInside == mInsideCircle) return mInsideCircle;
|
||||
+ mInsideCircle = newInside;
|
||||
+
|
||||
+ invalidate();
|
||||
+
|
||||
+ if(!mInsideCircle) {
|
||||
+ mParams.screenBrightness = .0f;
|
||||
+ mParams.dimAmount = UNTOUCHED_DIM;
|
||||
+ mWM.updateViewLayout(this, mParams);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ mParams.dimAmount = TOUCHED_DIM;
|
||||
+ mParams.screenBrightness = 1.0f;
|
||||
+ mWM.updateViewLayout(this, mParams);
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ public void show() {
|
||||
+ Slog.d("PHH-Enroll", "Show", new Exception());
|
||||
+ if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
|
||||
+
|
||||
+ try {
|
||||
+ PrintWriter writer = new PrintWriter("/sys/devices/virtual/touch/tp_dev/fod_status", "UTF-8");
|
||||
+ writer.println("1");
|
||||
+ writer.close();
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed setting fod status for touchscreen");
|
||||
+ }
|
||||
+
|
||||
+ mParams.x = mX;
|
||||
+ mParams.y = mY;
|
||||
+
|
||||
+ mParams.height = mW;
|
||||
+ mParams.width = mH;
|
||||
+ mParams.format = PixelFormat.TRANSLUCENT;
|
||||
+
|
||||
+ mParams.type = WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY;
|
||||
+ mParams.setTitle("Fingerprint on display");
|
||||
+ mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
|
||||
+ WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH |
|
||||
+ WindowManager.LayoutParams.FLAG_DIM_BEHIND |
|
||||
+ WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
|
||||
+ mParams.dimAmount = UNTOUCHED_DIM;
|
||||
+
|
||||
+ mParams.packageName = "android";
|
||||
+
|
||||
+ mParams.gravity = Gravity.TOP | Gravity.LEFT;
|
||||
+ mHandler.post( () -> {
|
||||
+ mWM.addView(this, mParams);
|
||||
+ });
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public void hide() {
|
||||
+ Slog.d("PHH-Enroll", "Hide", new Exception());
|
||||
+ if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
|
||||
+
|
||||
+ try {
|
||||
+ if(mXiaomiFingerprint != null)
|
||||
+ mXiaomiFingerprint.extCmd(0xa, 0);
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
+ }
|
||||
+ try {
|
||||
+ PrintWriter writer = new PrintWriter("/sys/devices/virtual/touch/tp_dev/fod_status", "UTF-8");
|
||||
+ writer.println("0");
|
||||
+ writer.close();
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed setting fod status for touchscreen");
|
||||
+ }
|
||||
+
|
||||
+ Slog.d("PHH-Enroll", "Removed facola");
|
||||
+ mHandler.post( () -> {
|
||||
+ mWM.removeView(this);
|
||||
+ });
|
||||
+ }
|
||||
+}
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
index 19593e7e047..c7de87126e8 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
@@ -120,8 +120,10 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
+ private FacolaView mFacola;
|
||||
|
||||
private final class FingerprintAuthClient extends AuthenticationClientImpl {
|
||||
+
|
||||
@Override
|
||||
protected boolean isFingerprint() {
|
||||
return true;
|
||||
@@ -170,6 +172,26 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
|
||||
return super.handleFailedAttempt();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean onAcquired(int acquiredInfo, int vendorCode) {
|
||||
+ boolean result = super.onAcquired(acquiredInfo, vendorCode);
|
||||
+ android.util.Log.d("PHH-Enroll", "acquired ret " + result);
|
||||
+ if(result) mFacola.hide();
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int start() {
|
||||
+ mFacola.show();
|
||||
+ return super.start();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int stop(boolean initiatedByClient) {
|
||||
+ mFacola.hide();
|
||||
+ return super.stop(initiatedByClient);
|
||||
+ }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +202,6 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
/**
|
||||
* The following methods contain common code which is shared in biometrics/common.
|
||||
*/
|
||||
-
|
||||
@Override // Binder call
|
||||
public long preEnroll(IBinder token) {
|
||||
checkPermission(MANAGE_FINGERPRINT);
|
||||
@@ -725,6 +746,7 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
mAlarmManager = context.getSystemService(AlarmManager.class);
|
||||
context.registerReceiver(mLockoutReceiver, new IntentFilter(getLockoutResetIntent()),
|
||||
getLockoutBroadcastPermission(), null /* handler */);
|
||||
+ mFacola = new FacolaView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -952,6 +974,7 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
Slog.w(TAG, "startPreEnroll: no fingerprint HAL!");
|
||||
return 0;
|
||||
}
|
||||
+ mFacola.show();
|
||||
try {
|
||||
return daemon.preEnroll();
|
||||
} catch (RemoteException e) {
|
||||
@@ -966,6 +989,7 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
Slog.w(TAG, "startPostEnroll: no fingerprint HAL!");
|
||||
return 0;
|
||||
}
|
||||
+ mFacola.hide();
|
||||
try {
|
||||
return daemon.postEnroll();
|
||||
} catch (RemoteException e) {
|
||||
diff --git a/services/core/java/com/android/server/testharness/TestHarnessModeService.java b/services/core/java/com/android/server/testharness/TestHarnessModeService.java
|
||||
index fcf87ee2a4b..0aa948417c1 100644
|
||||
--- a/services/core/java/com/android/server/testharness/TestHarnessModeService.java
|
||||
+++ b/services/core/java/com/android/server/testharness/TestHarnessModeService.java
|
||||
@@ -150,7 +150,12 @@ public class TestHarnessModeService extends SystemService {
|
||||
+ "PersistentDataBlockManagerInternal was bound!");
|
||||
return null;
|
||||
}
|
||||
- byte[] testHarnessModeData = blockManager.getTestHarnessModeData();
|
||||
+ byte[] testHarnessModeData = null;
|
||||
+ try {
|
||||
+ testHarnessModeData = blockManager.getTestHarnessModeData();
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.e(TAG, "Failed to read block for test harness", e);
|
||||
+ }
|
||||
if (testHarnessModeData == null || testHarnessModeData.length == 0) {
|
||||
// There's no data to apply, so leave it as-is.
|
||||
return null;
|
||||
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
index 479babc4c7d..1f972dd4918 100644
|
||||
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
|
||||
@@ -2833,12 +2833,6 @@ final class ActivityRecord extends ConfigurationContainer {
|
||||
// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.
|
||||
private void updateOverrideConfiguration() {
|
||||
final Configuration overrideConfig = mTmpConfig;
|
||||
- if(info.applicationInfo.targetSdkVersion < O) {
|
||||
- try {
|
||||
- maxAspectRatio = Float.parseFloat(SystemProperties.get("persist.sys.max_aspect_ratio.pre_o", ""));
|
||||
- } catch (Throwable t) {}
|
||||
- Log.d("PHH", "Overrode aspect ratio because pre-o to " + maxAspectRatio);
|
||||
- }
|
||||
if (shouldUseSizeCompatMode()) {
|
||||
if (mCompatDisplayInsets != null) {
|
||||
// The override configuration is set only once in size compatibility mode.
|
||||
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
index 20de7985d1d..2b50d04233e 100644
|
||||
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
@@ -46,6 +46,9 @@ using ISecLight = ::vendor::samsung::hardware::light::V2_0::ISecLight;
|
||||
using SecType = ::vendor::samsung::hardware::light::V2_0::SecType;
|
||||
static bool sLightSupported = true;
|
||||
|
||||
+static sp<ISecLight> sSecHal;
|
||||
+static bool sSecTried = false;
|
||||
+
|
||||
static bool validate(jint light, jint flash, jint brightness) {
|
||||
bool valid = true;
|
||||
|
||||
@@ -155,20 +158,24 @@ static void setLight_native(
|
||||
colorAlpha = (colorAlpha * brightnessLevel) / 0xFF;
|
||||
colorARGB = (colorAlpha << 24) + (colorARGB & 0x00FFFFFF);
|
||||
}
|
||||
-
|
||||
- sp<ISecLight> secHal = ISecLight::getService();
|
||||
|
||||
- if(secHal != nullptr) {
|
||||
+ if(!sSecTried) {
|
||||
+ sSecHal = ISecLight::getService();
|
||||
+ sSecTried = true;
|
||||
+ }
|
||||
+
|
||||
+ if(sSecHal != nullptr) {
|
||||
SecType type = static_cast<SecType>(light);
|
||||
LightState state = constructState(
|
||||
colorARGB, flashMode, onMS, offMS, brightnessMode);
|
||||
|
||||
{
|
||||
android::base::Timer t;
|
||||
- Return<Status> ret = secHal->setLightSec(type, state);
|
||||
+ Return<Status> ret = sSecHal->setLightSec(type, state);
|
||||
processReturn(ret, static_cast<Type>(light), state);
|
||||
if (t.duration() > 50ms) ALOGD("Excessive delay setting light");
|
||||
}
|
||||
+ return;
|
||||
}
|
||||
|
||||
Type type = static_cast<Type>(light);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,65 +0,0 @@
|
||||
From 8167bee50010c872b82a2183e0ac17779b6b565e Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 12 Aug 2019 23:10:21 +0200
|
||||
Subject: [PATCH 34/36] User statsd/incidentd arent known to init 8.0. disable
|
||||
those services
|
||||
|
||||
Change-Id: I074654e194f764ffbc6961ff0ae304e36a9b5d1e
|
||||
---
|
||||
cmds/incidentd/incidentd.rc | 10 +++++-----
|
||||
cmds/statsd/statsd.rc | 18 +++++++++---------
|
||||
2 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/cmds/incidentd/incidentd.rc b/cmds/incidentd/incidentd.rc
|
||||
index 9c16a1c52e8..cc20c936fda 100644
|
||||
--- a/cmds/incidentd/incidentd.rc
|
||||
+++ b/cmds/incidentd/incidentd.rc
|
||||
@@ -12,11 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
-service incidentd /system/bin/incidentd
|
||||
- class main
|
||||
- user incidentd
|
||||
- group incidentd log readproc
|
||||
- capabilities KILL SYS_PTRACE
|
||||
+#service incidentd /system/bin/incidentd
|
||||
+# class main
|
||||
+# user incidentd
|
||||
+# group incidentd log readproc
|
||||
+# capabilities KILL SYS_PTRACE
|
||||
|
||||
on post-fs-data
|
||||
# Create directory for incidentd
|
||||
diff --git a/cmds/statsd/statsd.rc b/cmds/statsd/statsd.rc
|
||||
index a98ecd586b4..564cf98d0a9 100644
|
||||
--- a/cmds/statsd/statsd.rc
|
||||
+++ b/cmds/statsd/statsd.rc
|
||||
@@ -12,15 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
-service statsd /system/bin/statsd
|
||||
- class main
|
||||
- socket statsdw dgram+passcred 0222 statsd statsd
|
||||
- user statsd
|
||||
- group statsd log
|
||||
- writepid /dev/cpuset/system-background/tasks
|
||||
-
|
||||
-on property:ro.statsd.enable=false
|
||||
- stop statsd
|
||||
+#service statsd /system/bin/statsd
|
||||
+# class main
|
||||
+# socket statsdw dgram+passcred 0222 statsd statsd
|
||||
+# user statsd
|
||||
+# group statsd log
|
||||
+# writepid /dev/cpuset/system-background/tasks
|
||||
+#
|
||||
+#on property:ro.statsd.enable=false
|
||||
+# stop statsd
|
||||
|
||||
on post-fs-data
|
||||
# Create directory for statsd
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From e73eb752f04a301bb4195a40ef3d73be5bb705d6 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:38:08 +0200
|
||||
Subject: [PATCH 35/36] Check for samsung light service everytime
|
||||
|
||||
This is needed because it is possible sec light service isn't ready at
|
||||
that time.
|
||||
TODO: check that the services exists at all, so that this is done only
|
||||
on Samsung devices
|
||||
|
||||
Change-Id: I30f049f3b06f83c455301b589b3558ff384ec300
|
||||
---
|
||||
services/core/jni/com_android_server_lights_LightsService.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
index bea321da890..75793a7c0f2 100644
|
||||
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
@@ -150,7 +150,7 @@ static void setLight_native(
|
||||
|
||||
if(!sSecTried) {
|
||||
sSecHal = ISecLight::getService();
|
||||
- sSecTried = true;
|
||||
+ //sSecTried = true;
|
||||
}
|
||||
|
||||
if(sSecHal != nullptr) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,121 +0,0 @@
|
||||
From f2c2a6a4707dde7f62d29aa5b204d96f9693e0e0 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:39:50 +0200
|
||||
Subject: [PATCH 36/36] Forawrdport Samsung "fod" support for ultrasound fp
|
||||
|
||||
Change-Id: I9f787a01dab922cd94f9e552a6f3f53a00ca8448
|
||||
---
|
||||
.../biometrics/fingerprint/FacolaView.java | 61 ++++++++++++++++++-
|
||||
1 file changed, 58 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
index 8829bcb7e48..f61582990cf 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -30,6 +30,9 @@ import android.view.WindowManager;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.view.Gravity;
|
||||
|
||||
+import java.io.BufferedReader;
|
||||
+import java.io.File;
|
||||
+import java.io.FileReader;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
|
||||
@@ -53,9 +56,12 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
private final Handler mHandler;
|
||||
|
||||
private final WindowManager mWM;
|
||||
+ private final boolean samsungFod = samsungHasCmd("fod_enable");
|
||||
FacolaView(Context context) {
|
||||
super(context);
|
||||
|
||||
+ android.util.Log.d("PHH", "Samsung FOD " + samsungFod);
|
||||
+
|
||||
mHandlerThread = new HandlerThread("FacolaThread");
|
||||
mHandlerThread.start();
|
||||
mHandler = new Handler(mHandlerThread.getLooper());
|
||||
@@ -64,7 +70,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
String[] size = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.size.width_height", "").split(",");
|
||||
Slog.d("PHH-Enroll", "FacolaView hello");
|
||||
if(size.length == 2 && location.length == 2) {
|
||||
- Slog.d("PHH-Enroll", "Got real values");
|
||||
+ Slog.d("PHH-Enroll", "Got real values");
|
||||
mX = Integer.parseInt(location[0]);
|
||||
mY = Integer.parseInt(location[1]);
|
||||
mW = Integer.parseInt(size[0]);
|
||||
@@ -149,7 +155,10 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
}
|
||||
|
||||
public void show() {
|
||||
- Slog.d("PHH-Enroll", "Show", new Exception());
|
||||
+ Slog.d("PHH-Enroll", "Show", new Exception());
|
||||
+ if(samsungFod) {
|
||||
+ samsungCmd("fod_enable,1,1");
|
||||
+ }
|
||||
if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
|
||||
|
||||
try {
|
||||
@@ -185,7 +194,10 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
- Slog.d("PHH-Enroll", "Hide", new Exception());
|
||||
+ Slog.d("PHH-Enroll", "Hide", new Exception());
|
||||
+ if(samsungFod) {
|
||||
+ samsungCmd("fod_enable,0");
|
||||
+ }
|
||||
if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
|
||||
|
||||
try {
|
||||
@@ -207,4 +219,47 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
mWM.removeView(this);
|
||||
});
|
||||
}
|
||||
+
|
||||
+ private static boolean samsungHasCmd(String cmd) {
|
||||
+ try {
|
||||
+ File f = new File("/sys/devices/virtual/sec/tsp/cmd_list");
|
||||
+ if(!f.exists()) return false;
|
||||
+
|
||||
+ BufferedReader b = new BufferedReader(new FileReader(f));
|
||||
+ String line = null;
|
||||
+ while( (line = b.readLine()) != null) {
|
||||
+ if(line.equals(cmd)) return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ } catch(Exception e) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static String readFile(String path) {
|
||||
+ try {
|
||||
+ File f = new File(path);
|
||||
+
|
||||
+ BufferedReader b = new BufferedReader(new FileReader(f));
|
||||
+ return b.readLine();
|
||||
+ } catch(Exception e) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static void samsungCmd(String cmd) {
|
||||
+ try {
|
||||
+ PrintWriter writer = new PrintWriter("/sys/devices/virtual/sec/tsp/cmd", "UTF-8");
|
||||
+ writer.println(cmd);
|
||||
+ writer.close();
|
||||
+
|
||||
+ String status = readFile("/sys/devices/virtual/sec/tsp/cmd_status");
|
||||
+ String ret = readFile("/sys/devices/virtual/sec/tsp/cmd_result");
|
||||
+
|
||||
+ android.util.Log.d("PHH", "Sending command " + cmd + " returned " + ret + ":" + status);
|
||||
+ } catch(Exception e) {
|
||||
+ android.util.Log.d("PHH", "Failed sending command " + cmd, e);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,166 +0,0 @@
|
||||
From f1e202e71f6ab47a1870aa91e65d8c777770b88d Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 14 Oct 2019 23:50:46 +0200
|
||||
Subject: [PATCH 37/38] Scan /system/overlay and fix support for properties in
|
||||
idmap2
|
||||
|
||||
Change-Id: Ic04b5b1cc7b5d8cee67b1e2fdaa8aa793546b6d6
|
||||
---
|
||||
cmds/idmap2/idmap2/Scan.cpp | 6 ++++-
|
||||
cmds/idmap2/include/idmap2/ResourceUtils.h | 3 +++
|
||||
cmds/idmap2/libidmap2/ResourceUtils.cpp | 26 +++++++++++++++++++
|
||||
.../android/content/pm/PackageParser.java | 9 ++++++-
|
||||
core/jni/android_util_AssetManager.cpp | 3 +++
|
||||
.../server/pm/PackageManagerService.java | 6 +++++
|
||||
6 files changed, 51 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp
|
||||
index cfac5f31e2e..adac1ef88cf 100644
|
||||
--- a/cmds/idmap2/idmap2/Scan.cpp
|
||||
+++ b/cmds/idmap2/idmap2/Scan.cpp
|
||||
@@ -159,13 +159,17 @@ Result<Unit> Scan(const std::vector<std::string>& args) {
|
||||
Result<OverlayManifestInfo> overlay_info =
|
||||
ExtractOverlayManifestInfo(path, /* assert_overlay */ false);
|
||||
if (!overlay_info) {
|
||||
- return overlay_info.GetError();
|
||||
+ continue;
|
||||
}
|
||||
|
||||
if (!overlay_info->is_static) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+ if (!overlay_info->property_match) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
if (overlay_info->target_package.empty() ||
|
||||
overlay_info->target_package != target_package_name) {
|
||||
continue;
|
||||
diff --git a/cmds/idmap2/include/idmap2/ResourceUtils.h b/cmds/idmap2/include/idmap2/ResourceUtils.h
|
||||
index 8797a788dd1..0f98f4d1a2d 100644
|
||||
--- a/cmds/idmap2/include/idmap2/ResourceUtils.h
|
||||
+++ b/cmds/idmap2/include/idmap2/ResourceUtils.h
|
||||
@@ -30,6 +30,9 @@ namespace android::idmap2::utils {
|
||||
struct OverlayManifestInfo {
|
||||
std::string target_package; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
std::string target_name; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
+ std::string property_name; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
+ std::string property_value; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
+ bool property_match; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
bool is_static; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
int priority = -1; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||
};
|
||||
diff --git a/cmds/idmap2/libidmap2/ResourceUtils.cpp b/cmds/idmap2/libidmap2/ResourceUtils.cpp
|
||||
index 71ba3f0f1ac..7fda402b80f 100644
|
||||
--- a/cmds/idmap2/libidmap2/ResourceUtils.cpp
|
||||
+++ b/cmds/idmap2/libidmap2/ResourceUtils.cpp
|
||||
@@ -18,7 +18,9 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
+#include <fnmatch.h>
|
||||
|
||||
+#include "android-base/properties.h"
|
||||
#include "androidfw/StringPiece.h"
|
||||
#include "androidfw/Util.h"
|
||||
#include "idmap2/Result.h"
|
||||
@@ -93,6 +95,30 @@ Result<OverlayManifestInfo> ExtractOverlayManifestInfo(const std::string& path,
|
||||
info.target_name = iter->second;
|
||||
}
|
||||
|
||||
+ iter = tag->find("requiredSystemPropertyName");
|
||||
+ if (iter != tag->end()) {
|
||||
+ info.property_name = iter->second;
|
||||
+ }
|
||||
+
|
||||
+ iter = tag->find("requiredSystemPropertyValue");
|
||||
+ if (iter != tag->end()) {
|
||||
+ info.property_value = iter->second;
|
||||
+ }
|
||||
+
|
||||
+ info.property_match = false;
|
||||
+ if(!info.property_name.empty() && !info.property_value.empty()) {
|
||||
+ std::string prop = android::base::GetProperty(info.property_name, "");
|
||||
+ if(info.property_value == prop) {
|
||||
+ info.property_match = true;
|
||||
+ }
|
||||
+ if(info.property_value[0] == '+') {
|
||||
+ info.property_match =
|
||||
+ fnmatch(info.property_value.c_str()+1, prop.c_str(), 0) == 0;
|
||||
+ }
|
||||
+ } else {
|
||||
+ info.property_match = true;
|
||||
+ }
|
||||
+
|
||||
iter = tag->find("isStatic");
|
||||
if (iter != tag->end()) {
|
||||
info.is_static = std::stoul(iter->second) != 0U;
|
||||
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
|
||||
index b3776787cc2..2147cc61728 100644
|
||||
--- a/core/java/android/content/pm/PackageParser.java
|
||||
+++ b/core/java/android/content/pm/PackageParser.java
|
||||
@@ -1353,6 +1353,7 @@ public class PackageParser {
|
||||
} catch (PackageParserException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
+ android.util.Log.d("PHH", "failed reading manifest because of", e);
|
||||
throw new PackageParserException(INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION,
|
||||
"Failed to read manifest from " + apkPath, e);
|
||||
} finally {
|
||||
@@ -1392,6 +1393,7 @@ public class PackageParser {
|
||||
} catch (PackageParserException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
+ android.util.Log.d("PHH", "failed reading manifest because of", e);
|
||||
throw new PackageParserException(INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION,
|
||||
"Failed to read manifest from " + apkPath, e);
|
||||
} finally {
|
||||
@@ -2556,7 +2558,12 @@ public class PackageParser {
|
||||
|
||||
// check property value - make sure it is both set and equal to expected value
|
||||
final String currValue = SystemProperties.get(propName);
|
||||
- return (currValue != null && currValue.equals(propValue));
|
||||
+ if(propValue.charAt(0) == '+') {
|
||||
+ String valRegexp = propValue.replace("*", ".*").substring(1);
|
||||
+ return currValue != null && currValue.matches(valRegexp);
|
||||
+ } else {
|
||||
+ return (currValue != null && currValue.equals(propValue));
|
||||
+ }
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
|
||||
index 4518c7e66a5..9e1b6db9ad9 100644
|
||||
--- a/core/jni/android_util_AssetManager.cpp
|
||||
+++ b/core/jni/android_util_AssetManager.cpp
|
||||
@@ -233,6 +233,9 @@ static jobjectArray NativeCreateIdmapsForStaticOverlaysTargetingAndroid(JNIEnv*
|
||||
// --input-directory can be given multiple times, but idmap2 expects the directory to exist
|
||||
std::vector<std::string> input_dirs;
|
||||
struct stat st;
|
||||
+ if (stat("/system/overlay", &st) == 0) {
|
||||
+ input_dirs.push_back("/system/overlay");
|
||||
+ }
|
||||
if (stat(AssetManager::VENDOR_OVERLAY_DIR, &st) == 0) {
|
||||
input_dirs.push_back(AssetManager::VENDOR_OVERLAY_DIR);
|
||||
}
|
||||
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
index 7469e099421..203eb793610 100644
|
||||
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
|
||||
@@ -2608,6 +2608,12 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
// any apps.)
|
||||
// For security and version matching reason, only consider overlay packages if they
|
||||
// reside in the right directory.
|
||||
+ scanDirTracedLI(new File("/system/overlay"),
|
||||
+ mDefParseFlags
|
||||
+ | PackageParser.PARSE_IS_SYSTEM_DIR,
|
||||
+ scanFlags
|
||||
+ | SCAN_AS_SYSTEM,
|
||||
+ 0);
|
||||
scanDirTracedLI(new File(VENDOR_OVERLAY_DIR),
|
||||
mDefParseFlags
|
||||
| PackageParser.PARSE_IS_SYSTEM_DIR,
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,97 +0,0 @@
|
||||
From 9bba3cbb885f9917c120bfc7f072002f9e8cd4ed Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 22 Oct 2019 00:33:23 +0200
|
||||
Subject: [PATCH 38/38] Improve FacolaView life cycle, though it is still
|
||||
missing few cases. It might require to change BiometricServiceBase for actual
|
||||
fix
|
||||
|
||||
Change-Id: Ida96f8aca360c23cd5535f0ee92fd77dada2ebec
|
||||
---
|
||||
.../server/biometrics/fingerprint/FacolaView.java | 9 ++++++++-
|
||||
.../biometrics/fingerprint/FingerprintService.java | 14 ++++++++++++++
|
||||
2 files changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
index f61582990cf..4ff373a108d 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -57,6 +57,8 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
|
||||
private final WindowManager mWM;
|
||||
private final boolean samsungFod = samsungHasCmd("fod_enable");
|
||||
+
|
||||
+ private boolean mHidden = true;
|
||||
FacolaView(Context context) {
|
||||
super(context);
|
||||
|
||||
@@ -106,7 +108,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
//TODO w!=h?
|
||||
if(mInsideCircle) {
|
||||
try {
|
||||
- int nitValue = 3;
|
||||
+ int nitValue = 2;
|
||||
if(mXiaomiFingerprint != null)
|
||||
mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
} catch(Exception e) {
|
||||
@@ -156,6 +158,8 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
|
||||
public void show() {
|
||||
Slog.d("PHH-Enroll", "Show", new Exception());
|
||||
+ if(!mHidden) return;
|
||||
+ mHidden = false;
|
||||
if(samsungFod) {
|
||||
samsungCmd("fod_enable,1,1");
|
||||
}
|
||||
@@ -194,7 +198,10 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
}
|
||||
|
||||
public void hide() {
|
||||
+ mInsideCircle = false;
|
||||
Slog.d("PHH-Enroll", "Hide", new Exception());
|
||||
+ if(mHidden) return;
|
||||
+ mHidden = true;
|
||||
if(samsungFod) {
|
||||
samsungCmd("fod_enable,0");
|
||||
}
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
index c7de87126e8..972b4703860 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
|
||||
@@ -181,6 +181,16 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
return result;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean onAuthenticated(BiometricAuthenticator.Identifier identifier,
|
||||
+ boolean authenticated, ArrayList<Byte> token) {
|
||||
+ boolean result = super.onAuthenticated(identifier, authenticated, token);
|
||||
+ android.util.Log.d("PHH-Enroll", "auth-ed ret " + result);
|
||||
+ if(result) mFacola.hide();
|
||||
+ return result;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
@Override
|
||||
public int start() {
|
||||
mFacola.show();
|
||||
@@ -219,6 +229,7 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
final IFingerprintServiceReceiver receiver, final int flags,
|
||||
final String opPackageName) {
|
||||
checkPermission(MANAGE_FINGERPRINT);
|
||||
+ mFacola.show();
|
||||
|
||||
final boolean restricted = isRestricted();
|
||||
final int groupId = userId; // default group for fingerprint enrollment
|
||||
@@ -641,6 +652,9 @@ public class FingerprintService extends BiometricServiceBase {
|
||||
public void onError(final long deviceId, final int error, final int vendorCode) {
|
||||
mHandler.post(() -> {
|
||||
FingerprintService.super.handleError(deviceId, error, vendorCode);
|
||||
+ if ( error == BiometricConstants.BIOMETRIC_ERROR_CANCELED) {
|
||||
+ mFacola.hide();
|
||||
+ }
|
||||
// TODO: this chunk of code should be common to all biometric services
|
||||
if (error == BiometricConstants.BIOMETRIC_ERROR_HW_UNAVAILABLE) {
|
||||
// If we get HW_UNAVAILABLE, try to connect again later...
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 12005c0b0a7f7e9c33bd8cf79ffaee609c43dafb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 22 Oct 2019 15:31:54 +0200
|
||||
Subject: [PATCH 39/39] Link hwui with libbase, because of updated skia
|
||||
dependency
|
||||
|
||||
Change-Id: I201df2cd8f66674948b56fb6d5be5e8c3cb48bd1
|
||||
---
|
||||
libs/hwui/Android.bp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
|
||||
index ebba4cb79df..b9808751130 100644
|
||||
--- a/libs/hwui/Android.bp
|
||||
+++ b/libs/hwui/Android.bp
|
||||
@@ -70,6 +70,7 @@ cc_defaults {
|
||||
"libandroidfw",
|
||||
"libcrypto",
|
||||
"libsync",
|
||||
+ "libbase",
|
||||
],
|
||||
static_libs: [
|
||||
"libEGL_blobCache",
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,35 +0,0 @@
|
||||
From 1573fc903e5c874b7a4fa78284801aa67a9f1ff7 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 27 Oct 2019 16:27:55 +0100
|
||||
Subject: [PATCH 40/40] Fix crash on some devices by checking for null client
|
||||
|
||||
Some device get the following system_server crash:
|
||||
*** FATAL EXCEPTION IN SYSTEM PROCESS: main
|
||||
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.server.biometrics.ClientMonitor.onEnumerationResult(android.hardware.biometrics.BiometricAuthenticator$Identifier, int)' on a null object reference
|
||||
at com.android.server.biometrics.BiometricServiceBase.handleEnumerate(BiometricServiceBase.java:777)
|
||||
at com.android.server.biometrics.fingerprint.FingerprintService.access$6901(FingerprintService.java:93)
|
||||
at com.android.server.biometrics.fingerprint.FingerprintService$1.lambda$onEnumerate$5$FingerprintService$1(FingerprintService.java:686)
|
||||
at com.android.server.biometrics.fingerprint.-$$Lambda$FingerprintService$1$3I9ge5BoesXZUovbayCOCR754fc.run(Unknown Source:10)
|
||||
|
||||
Fix it by checking for `null` client before acting on it
|
||||
|
||||
Change-Id: If39d8c1b26c8c0a44b3d9292b646cb71ff258a95
|
||||
---
|
||||
.../java/com/android/server/biometrics/BiometricServiceBase.java | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
|
||||
index d3c62bed7b5..b6710992a6e 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java
|
||||
@@ -774,6 +774,7 @@ public abstract class BiometricServiceBase extends SystemService
|
||||
protected void handleEnumerate(BiometricAuthenticator.Identifier identifier, int remaining) {
|
||||
ClientMonitor client = getCurrentClient();
|
||||
|
||||
+ if(client == null) return;
|
||||
client.onEnumerationResult(identifier, remaining);
|
||||
|
||||
// All templates in the HAL for this user were enumerated
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,475 +0,0 @@
|
||||
From 6d0a4d0c2d14754f42189e8bce03e3f40d8d5668 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 15 Dec 2019 16:38:44 +0100
|
||||
Subject: [PATCH] Support Samsung Q Light HAL
|
||||
|
||||
Change-Id: Ic5745eb115a14de348391e69ed6bf3c2a24b157e
|
||||
---
|
||||
services/core/jni/Android.bp | 1 +
|
||||
services/core/jni/Android.bp.orig | 165 ++++++++++++++
|
||||
...om_android_server_lights_LightsService.cpp | 26 +++
|
||||
...droid_server_lights_LightsService.cpp.orig | 207 ++++++++++++++++++
|
||||
4 files changed, 399 insertions(+)
|
||||
create mode 100644 services/core/jni/Android.bp.orig
|
||||
create mode 100644 services/core/jni/com_android_server_lights_LightsService.cpp.orig
|
||||
|
||||
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
|
||||
index d8645012e24..3ffa7561028 100644
|
||||
--- a/services/core/jni/Android.bp
|
||||
+++ b/services/core/jni/Android.bp
|
||||
@@ -136,6 +136,7 @@ cc_defaults {
|
||||
"suspend_control_aidl_interface-cpp",
|
||||
"vendor.lineage.power@1.0",
|
||||
"vendor.samsung.hardware.light@2.0",
|
||||
+ "vendor.samsung.hardware.light@3.0",
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
diff --git a/services/core/jni/Android.bp.orig b/services/core/jni/Android.bp.orig
|
||||
new file mode 100644
|
||||
index 00000000000..d8645012e24
|
||||
--- /dev/null
|
||||
+++ b/services/core/jni/Android.bp.orig
|
||||
@@ -0,0 +1,165 @@
|
||||
+cc_library_static {
|
||||
+ name: "libservices.core",
|
||||
+ defaults: ["libservices.core-libs"],
|
||||
+
|
||||
+ cflags: [
|
||||
+ "-Wall",
|
||||
+ "-Werror",
|
||||
+ "-Wno-unused-parameter",
|
||||
+ "-Wthread-safety",
|
||||
+
|
||||
+ "-DEGL_EGLEXT_PROTOTYPES",
|
||||
+ "-DGL_GLEXT_PROTOTYPES",
|
||||
+ ],
|
||||
+
|
||||
+ srcs: [
|
||||
+ "BroadcastRadio/JavaRef.cpp",
|
||||
+ "BroadcastRadio/NativeCallbackThread.cpp",
|
||||
+ "BroadcastRadio/BroadcastRadioService.cpp",
|
||||
+ "BroadcastRadio/Tuner.cpp",
|
||||
+ "BroadcastRadio/TunerCallback.cpp",
|
||||
+ "BroadcastRadio/convert.cpp",
|
||||
+ "BroadcastRadio/regions.cpp",
|
||||
+ "com_android_server_AlarmManagerService.cpp",
|
||||
+ "com_android_server_am_BatteryStatsService.cpp",
|
||||
+ "com_android_server_connectivity_Vpn.cpp",
|
||||
+ "com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp",
|
||||
+ "com_android_server_ConsumerIrService.cpp",
|
||||
+ "com_android_server_devicepolicy_CryptoTestHelper.cpp",
|
||||
+ "com_android_server_HardwarePropertiesManagerService.cpp",
|
||||
+ "com_android_server_hdmi_HdmiCecController.cpp",
|
||||
+ "com_android_server_input_InputManagerService.cpp",
|
||||
+ "com_android_server_lights_LightsService.cpp",
|
||||
+ "com_android_server_location_GnssLocationProvider.cpp",
|
||||
+ "com_android_server_locksettings_SyntheticPasswordManager.cpp",
|
||||
+ "com_android_server_net_NetworkStatsService.cpp",
|
||||
+ "com_android_server_power_PowerManagerService.cpp",
|
||||
+ "com_android_server_security_VerityUtils.cpp",
|
||||
+ "com_android_server_SerialService.cpp",
|
||||
+ "com_android_server_storage_AppFuseBridge.cpp",
|
||||
+ "com_android_server_SystemServer.cpp",
|
||||
+ "com_android_server_TestNetworkService.cpp",
|
||||
+ "com_android_server_tv_TvUinputBridge.cpp",
|
||||
+ "com_android_server_tv_TvInputHal.cpp",
|
||||
+ "com_android_server_vr_VrManagerService.cpp",
|
||||
+ "com_android_server_UsbAlsaJackDetector.cpp",
|
||||
+ "com_android_server_UsbDeviceManager.cpp",
|
||||
+ "com_android_server_UsbDescriptorParser.cpp",
|
||||
+ "com_android_server_UsbMidiDevice.cpp",
|
||||
+ "com_android_server_UsbHostManager.cpp",
|
||||
+ "com_android_server_VibratorService.cpp",
|
||||
+ "com_android_server_PersistentDataBlockService.cpp",
|
||||
+ "com_android_server_GraphicsStatsService.cpp",
|
||||
+ "com_android_server_am_AppCompactor.cpp",
|
||||
+ "com_android_server_am_LowMemDetector.cpp",
|
||||
+ "onload.cpp",
|
||||
+ ":lib_networkStatsFactory_native",
|
||||
+ ],
|
||||
+
|
||||
+ include_dirs: [
|
||||
+ "bionic/libc/private",
|
||||
+ "frameworks/base/libs",
|
||||
+ "frameworks/native/services",
|
||||
+ "system/gatekeeper/include",
|
||||
+ ],
|
||||
+}
|
||||
+
|
||||
+cc_defaults {
|
||||
+ name: "libservices.core-libs",
|
||||
+ shared_libs: [
|
||||
+ "libandroid_runtime",
|
||||
+ "libandroidfw",
|
||||
+ "libaudioclient",
|
||||
+ "libbase",
|
||||
+ "libappfuse",
|
||||
+ "libbinder",
|
||||
+ "libcutils",
|
||||
+ "libcrypto",
|
||||
+ "liblog",
|
||||
+ "libhardware",
|
||||
+ "libhardware_legacy",
|
||||
+ "libhidlbase",
|
||||
+ "libkeystore_binder",
|
||||
+ "libmtp",
|
||||
+ "libnativehelper",
|
||||
+ "libutils",
|
||||
+ "libui",
|
||||
+ "libinput",
|
||||
+ "libinputflinger",
|
||||
+ "libinputflinger_base",
|
||||
+ "libinputservice",
|
||||
+ "libschedulerservicehidl",
|
||||
+ "libsensorservice",
|
||||
+ "libsensorservicehidl",
|
||||
+ "libgui",
|
||||
+ "libusbhost",
|
||||
+ "libtinyalsa",
|
||||
+ "libEGL",
|
||||
+ "libGLESv2",
|
||||
+ "libnetutils",
|
||||
+ "libhidlbase",
|
||||
+ "libhidltransport",
|
||||
+ "libhwbinder",
|
||||
+ "libutils",
|
||||
+ "libhwui",
|
||||
+ "libbpf_android",
|
||||
+ "libnetdbpf",
|
||||
+ "libnetdutils",
|
||||
+ "libpsi",
|
||||
+ "android.hardware.audio.common@2.0",
|
||||
+ "android.hardware.broadcastradio@1.0",
|
||||
+ "android.hardware.broadcastradio@1.1",
|
||||
+ "android.hardware.contexthub@1.0",
|
||||
+ "android.hardware.gnss@1.0",
|
||||
+ "android.hardware.gnss@1.1",
|
||||
+ "android.hardware.gnss@2.0",
|
||||
+ "android.hardware.gnss.measurement_corrections@1.0",
|
||||
+ "android.hardware.gnss.visibility_control@1.0",
|
||||
+ "android.hardware.input.classifier@1.0",
|
||||
+ "android.hardware.ir@1.0",
|
||||
+ "android.hardware.light@2.0",
|
||||
+ "android.hardware.power@1.0",
|
||||
+ "android.hardware.power@1.1",
|
||||
+ "android.hardware.power.stats@1.0",
|
||||
+ "android.hardware.tetheroffload.config@1.0",
|
||||
+ "android.hardware.thermal@1.0",
|
||||
+ "android.hardware.tv.cec@1.0",
|
||||
+ "android.hardware.tv.input@1.0",
|
||||
+ "android.hardware.vibrator@1.0",
|
||||
+ "android.hardware.vibrator@1.1",
|
||||
+ "android.hardware.vibrator@1.2",
|
||||
+ "android.hardware.vibrator@1.3",
|
||||
+ "android.hardware.vr@1.0",
|
||||
+ "android.frameworks.schedulerservice@1.0",
|
||||
+ "android.frameworks.sensorservice@1.0",
|
||||
+ "android.system.suspend@1.0",
|
||||
+ "suspend_control_aidl_interface-cpp",
|
||||
+ "vendor.lineage.power@1.0",
|
||||
+ "vendor.samsung.hardware.light@2.0",
|
||||
+ ],
|
||||
+
|
||||
+ static_libs: [
|
||||
+ "android.hardware.broadcastradio@common-utils-1x-lib",
|
||||
+ ],
|
||||
+
|
||||
+ product_variables: {
|
||||
+ arc: {
|
||||
+ shared_libs: [
|
||||
+ "libarcbridge",
|
||||
+ "libarcbridgeservice",
|
||||
+ "libarctimer",
|
||||
+ "libbase",
|
||||
+ "libcap",
|
||||
+ "libchrome",
|
||||
+ "libmojo",
|
||||
+ ],
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+filegroup {
|
||||
+ name: "lib_networkStatsFactory_native",
|
||||
+ srcs: [
|
||||
+ "com_android_server_net_NetworkStatsFactory.cpp",
|
||||
+ ],
|
||||
+}
|
||||
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
index a21c6e2c8ef..dedc7734131 100644
|
||||
--- a/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <android/hardware/light/2.0/types.h>
|
||||
#include <vendor/samsung/hardware/light/2.0/ISecLight.h>
|
||||
#include <vendor/samsung/hardware/light/2.0/types.h>
|
||||
+#include <vendor/samsung/hardware/light/3.0/ISehLight.h>
|
||||
+#include <vendor/samsung/hardware/light/3.0/types.h>
|
||||
#include <android-base/chrono_utils.h>
|
||||
#include <utils/misc.h>
|
||||
#include <utils/Log.h>
|
||||
@@ -44,9 +46,13 @@ using Return = ::android::hardware::Return<T>;
|
||||
|
||||
using ISecLight = ::vendor::samsung::hardware::light::V2_0::ISecLight;
|
||||
using SecType = ::vendor::samsung::hardware::light::V2_0::SecType;
|
||||
+using ISehLight = ::vendor::samsung::hardware::light::V3_0::ISehLight;
|
||||
+using SehType = ::vendor::samsung::hardware::light::V3_0::SehType;
|
||||
+using SehLightState = ::vendor::samsung::hardware::light::V3_0::SehLightState;
|
||||
static bool sLightSupported = true;
|
||||
|
||||
static sp<ISecLight> sSecHal;
|
||||
+static sp<ISehLight> sSehHal;
|
||||
static bool sSecTried = false;
|
||||
|
||||
static bool validate(jint light, jint flash, jint brightness) {
|
||||
@@ -161,6 +167,7 @@ static void setLight_native(
|
||||
|
||||
if(!sSecTried) {
|
||||
sSecHal = ISecLight::getService();
|
||||
+ sSehHal = ISehLight::getService();
|
||||
//sSecTried = true;
|
||||
}
|
||||
|
||||
@@ -178,6 +185,25 @@ static void setLight_native(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if(sSehHal != nullptr && light == 0 && flashMode == static_cast<jint>(Flash::HARDWARE)) {
|
||||
+ SehType type = static_cast<SehType>(light);
|
||||
+ SehLightState state {};
|
||||
+ state.flashMode = Flash::NONE;
|
||||
+ Brightness brightness = static_cast<Brightness>(brightnessMode);
|
||||
+ state.brightnessMode = brightness;
|
||||
+ state.extendedBrightness = colorARGB;
|
||||
+
|
||||
+ {
|
||||
+ android::base::Timer t;
|
||||
+ Return<Status> ret = sSehHal->sehSetLight(type, state);
|
||||
+ if(!ret.isOk()) {
|
||||
+ ALOGE("Failed to issue set light command.");
|
||||
+ }
|
||||
+ if (t.duration() > 50ms) ALOGD("Excessive delay setting light");
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
Type type = static_cast<Type>(light);
|
||||
LightState state = constructState(
|
||||
colorARGB, flashMode, onMS, offMS, brightnessMode);
|
||||
diff --git a/services/core/jni/com_android_server_lights_LightsService.cpp.orig b/services/core/jni/com_android_server_lights_LightsService.cpp.orig
|
||||
new file mode 100644
|
||||
index 00000000000..a21c6e2c8ef
|
||||
--- /dev/null
|
||||
+++ b/services/core/jni/com_android_server_lights_LightsService.cpp.orig
|
||||
@@ -0,0 +1,207 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2009 The Android Open Source Project
|
||||
+ * 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.
|
||||
+ */
|
||||
+
|
||||
+#define LOG_TAG "LightsService"
|
||||
+
|
||||
+#include "jni.h"
|
||||
+#include <nativehelper/JNIHelp.h>
|
||||
+#include "android_runtime/AndroidRuntime.h"
|
||||
+
|
||||
+#include <android/hardware/light/2.0/ILight.h>
|
||||
+#include <android/hardware/light/2.0/types.h>
|
||||
+#include <vendor/samsung/hardware/light/2.0/ISecLight.h>
|
||||
+#include <vendor/samsung/hardware/light/2.0/types.h>
|
||||
+#include <android-base/chrono_utils.h>
|
||||
+#include <utils/misc.h>
|
||||
+#include <utils/Log.h>
|
||||
+#include <map>
|
||||
+#include <stdio.h>
|
||||
+
|
||||
+namespace android {
|
||||
+
|
||||
+using Brightness = ::android::hardware::light::V2_0::Brightness;
|
||||
+using Flash = ::android::hardware::light::V2_0::Flash;
|
||||
+using ILight = ::android::hardware::light::V2_0::ILight;
|
||||
+using LightState = ::android::hardware::light::V2_0::LightState;
|
||||
+using Status = ::android::hardware::light::V2_0::Status;
|
||||
+using Type = ::android::hardware::light::V2_0::Type;
|
||||
+template<typename T>
|
||||
+using Return = ::android::hardware::Return<T>;
|
||||
+
|
||||
+using ISecLight = ::vendor::samsung::hardware::light::V2_0::ISecLight;
|
||||
+using SecType = ::vendor::samsung::hardware::light::V2_0::SecType;
|
||||
+static bool sLightSupported = true;
|
||||
+
|
||||
+static sp<ISecLight> sSecHal;
|
||||
+static bool sSecTried = false;
|
||||
+
|
||||
+static bool validate(jint light, jint flash, jint brightness) {
|
||||
+ bool valid = true;
|
||||
+
|
||||
+ if (light < 0 || light >= static_cast<jint>(Type::COUNT)) {
|
||||
+ ALOGE("Invalid light parameter %d.", light);
|
||||
+ valid = false;
|
||||
+ }
|
||||
+
|
||||
+ if (flash != static_cast<jint>(Flash::NONE) &&
|
||||
+ flash != static_cast<jint>(Flash::TIMED) &&
|
||||
+ flash != static_cast<jint>(Flash::HARDWARE)) {
|
||||
+ ALOGE("Invalid flash parameter %d.", flash);
|
||||
+ valid = false;
|
||||
+ }
|
||||
+
|
||||
+ if (brightness != static_cast<jint>(Brightness::USER) &&
|
||||
+ brightness != static_cast<jint>(Brightness::SENSOR) &&
|
||||
+ brightness != static_cast<jint>(Brightness::LOW_PERSISTENCE)) {
|
||||
+ ALOGE("Invalid brightness parameter %d.", brightness);
|
||||
+ valid = false;
|
||||
+ }
|
||||
+
|
||||
+ if (brightness == static_cast<jint>(Brightness::LOW_PERSISTENCE) &&
|
||||
+ light != static_cast<jint>(Type::BACKLIGHT)) {
|
||||
+ ALOGE("Cannot set low-persistence mode for non-backlight device.");
|
||||
+ valid = false;
|
||||
+ }
|
||||
+
|
||||
+ return valid;
|
||||
+}
|
||||
+
|
||||
+static LightState constructState(
|
||||
+ jint colorARGB,
|
||||
+ jint flashMode,
|
||||
+ jint onMS,
|
||||
+ jint offMS,
|
||||
+ jint brightnessMode){
|
||||
+ Flash flash = static_cast<Flash>(flashMode);
|
||||
+ Brightness brightness = static_cast<Brightness>(brightnessMode);
|
||||
+
|
||||
+ LightState state{};
|
||||
+
|
||||
+ if (brightness == Brightness::LOW_PERSISTENCE) {
|
||||
+ state.flashMode = Flash::NONE;
|
||||
+ } else {
|
||||
+ // Only set non-brightness settings when not in low-persistence mode
|
||||
+ state.flashMode = flash;
|
||||
+ state.flashOnMs = onMS;
|
||||
+ state.flashOffMs = offMS;
|
||||
+ }
|
||||
+
|
||||
+ state.color = colorARGB;
|
||||
+ state.brightnessMode = brightness;
|
||||
+
|
||||
+ return state;
|
||||
+}
|
||||
+
|
||||
+static void processReturn(
|
||||
+ const Return<Status> &ret,
|
||||
+ Type type,
|
||||
+ const LightState &state) {
|
||||
+ if (!ret.isOk()) {
|
||||
+ ALOGE("Failed to issue set light command.");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ switch (static_cast<Status>(ret)) {
|
||||
+ case Status::SUCCESS:
|
||||
+ break;
|
||||
+ case Status::LIGHT_NOT_SUPPORTED:
|
||||
+ ALOGE("Light requested not available on this device. %d", type);
|
||||
+ break;
|
||||
+ case Status::BRIGHTNESS_NOT_SUPPORTED:
|
||||
+ ALOGE("Brightness parameter not supported on this device: %d",
|
||||
+ state.brightnessMode);
|
||||
+ break;
|
||||
+ case Status::UNKNOWN:
|
||||
+ default:
|
||||
+ ALOGE("Unknown error setting light.");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void setLight_native(
|
||||
+ JNIEnv* /* env */,
|
||||
+ jobject /* clazz */,
|
||||
+ jint light,
|
||||
+ jint colorARGB,
|
||||
+ jint flashMode,
|
||||
+ jint onMS,
|
||||
+ jint offMS,
|
||||
+ jint brightnessMode,
|
||||
+ jint brightnessLevel) {
|
||||
+
|
||||
+ if (!sLightSupported) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!validate(light, flashMode, brightnessMode)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (brightnessLevel > 0 && brightnessLevel <= 0xFF) {
|
||||
+ int colorAlpha = (colorARGB & 0xFF000000) >> 24;
|
||||
+ if (colorAlpha == 0x00) {
|
||||
+ colorAlpha = 0xFF;
|
||||
+ }
|
||||
+ colorAlpha = (colorAlpha * brightnessLevel) / 0xFF;
|
||||
+ colorARGB = (colorAlpha << 24) + (colorARGB & 0x00FFFFFF);
|
||||
+ }
|
||||
+
|
||||
+ if(!sSecTried) {
|
||||
+ sSecHal = ISecLight::getService();
|
||||
+ //sSecTried = true;
|
||||
+ }
|
||||
+
|
||||
+ if(sSecHal != nullptr) {
|
||||
+ SecType type = static_cast<SecType>(light);
|
||||
+ LightState state = constructState(
|
||||
+ colorARGB, flashMode, onMS, offMS, brightnessMode);
|
||||
+
|
||||
+ {
|
||||
+ android::base::Timer t;
|
||||
+ Return<Status> ret = sSecHal->setLightSec(type, state);
|
||||
+ processReturn(ret, static_cast<Type>(light), state);
|
||||
+ if (t.duration() > 50ms) ALOGD("Excessive delay setting light");
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ Type type = static_cast<Type>(light);
|
||||
+ LightState state = constructState(
|
||||
+ colorARGB, flashMode, onMS, offMS, brightnessMode);
|
||||
+
|
||||
+ {
|
||||
+ android::base::Timer t;
|
||||
+ sp<ILight> hal = ILight::getService();
|
||||
+ if (hal == nullptr) {
|
||||
+ sLightSupported = false;
|
||||
+ return;
|
||||
+ }
|
||||
+ Return<Status> ret = hal->setLight(type, state);
|
||||
+ processReturn(ret, type, state);
|
||||
+ if (t.duration() > 50ms) ALOGD("Excessive delay setting light");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static const JNINativeMethod method_table[] = {
|
||||
+ { "setLight_native", "(IIIIIII)V", (void*)setLight_native },
|
||||
+};
|
||||
+
|
||||
+int register_android_server_LightsService(JNIEnv *env) {
|
||||
+ return jniRegisterNativeMethods(env, "com/android/server/lights/LightsService",
|
||||
+ method_table, NELEM(method_table));
|
||||
+}
|
||||
+
|
||||
+};
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,46 +0,0 @@
|
||||
From 6d095a568c1b3abc27bd9111155353c3688a761e Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 15 Dec 2019 16:58:38 +0100
|
||||
Subject: [PATCH 42/45] Add a nodim property for FacolaView
|
||||
|
||||
Set persist.sys.phh.nodim to true to remove diming/full brightness
|
||||
---
|
||||
.../android/server/biometrics/fingerprint/FacolaView.java | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
index 4ff373a108d..08436019bc9 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -57,6 +57,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
|
||||
private final WindowManager mWM;
|
||||
private final boolean samsungFod = samsungHasCmd("fod_enable");
|
||||
+ private final boolean noDim;
|
||||
|
||||
private boolean mHidden = true;
|
||||
FacolaView(Context context) {
|
||||
@@ -68,6 +69,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
mHandlerThread.start();
|
||||
mHandler = new Handler(mHandlerThread.getLooper());
|
||||
|
||||
+ noDim = android.os.SystemProperties.getBoolean("persist.sys.phh.nodim", false);
|
||||
String[] location = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.location.X_Y", "").split(",");
|
||||
String[] size = android.os.SystemProperties.get("persist.vendor.sys.fp.fod.size.width_height", "").split(",");
|
||||
Slog.d("PHH-Enroll", "FacolaView hello");
|
||||
@@ -149,8 +151,10 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
- mParams.dimAmount = TOUCHED_DIM;
|
||||
- mParams.screenBrightness = 1.0f;
|
||||
+ if(!noDim) {
|
||||
+ mParams.dimAmount = TOUCHED_DIM;
|
||||
+ mParams.screenBrightness = 1.0f;
|
||||
+ }
|
||||
mWM.updateViewLayout(this, mParams);
|
||||
|
||||
return true;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,90 +0,0 @@
|
||||
From 23fac793a4950f84a88ee2d5ceb3045d703a46e6 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 15 Dec 2019 22:14:12 +0100
|
||||
Subject: [PATCH] Add Samsung's Q power HAL to fix suspend
|
||||
|
||||
Change-Id: I1edd4de9932ab089b7051f1329f60c15b9d99aaa
|
||||
---
|
||||
services/core/jni/Android.bp | 1 +
|
||||
...ndroid_server_power_PowerManagerService.cpp | 18 ++++++++++++++++++
|
||||
2 files changed, 19 insertions(+)
|
||||
|
||||
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
|
||||
index 3ffa7561028..8f44be480c9 100644
|
||||
--- a/services/core/jni/Android.bp
|
||||
+++ b/services/core/jni/Android.bp
|
||||
@@ -135,6 +135,7 @@ cc_defaults {
|
||||
"android.system.suspend@1.0",
|
||||
"suspend_control_aidl_interface-cpp",
|
||||
"vendor.lineage.power@1.0",
|
||||
+ "vendor.samsung.hardware.miscpower@2.0",
|
||||
"vendor.samsung.hardware.light@2.0",
|
||||
"vendor.samsung.hardware.light@3.0",
|
||||
],
|
||||
diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
index 211ea50ddc9..bf0599fe18a 100644
|
||||
--- a/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
+++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <android/hardware/power/1.1/IPower.h>
|
||||
#include <android/system/suspend/1.0/ISystemSuspend.h>
|
||||
#include <android/system/suspend/ISuspendControlService.h>
|
||||
+#include <vendor/samsung/hardware/miscpower/2.0/ISehMiscPower.h>
|
||||
#include <nativehelper/JNIHelp.h>
|
||||
#include <vendor/lineage/power/1.0/ILineagePower.h>
|
||||
#include "jni.h"
|
||||
@@ -58,6 +59,7 @@ using IPowerV1_1 = android::hardware::power::V1_1::IPower;
|
||||
using IPowerV1_0 = android::hardware::power::V1_0::IPower;
|
||||
using ILineagePowerV1_0 = vendor::lineage::power::V1_0::ILineagePower;
|
||||
using vendor::lineage::power::V1_0::LineageFeature;
|
||||
+using ISehMiscPower = vendor::samsung::hardware::miscpower::V2_0::ISehMiscPower;
|
||||
|
||||
namespace android {
|
||||
|
||||
@@ -74,6 +76,7 @@ static jobject gPowerManagerServiceObj;
|
||||
static sp<IPowerV1_0> gPowerHalV1_0_ = nullptr;
|
||||
static sp<IPowerV1_1> gPowerHalV1_1_ = nullptr;
|
||||
static sp<ILineagePowerV1_0> gLineagePowerHalV1_0_ = nullptr;
|
||||
+static sp<ISehMiscPower> gSehMiscPower = nullptr;
|
||||
static bool gPowerHalExists = true;
|
||||
static bool gLineagePowerHalExists = true;
|
||||
static std::mutex gPowerHalMutex;
|
||||
@@ -98,6 +101,7 @@ static bool checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodNa
|
||||
// The caller must be holding gPowerHalMutex.
|
||||
static void connectPowerHalLocked() {
|
||||
if (gPowerHalExists && gPowerHalV1_0_ == nullptr) {
|
||||
+ gSehMiscPower = ISehMiscPower::getService();
|
||||
gPowerHalV1_0_ = IPowerV1_0::getService("miscpower");
|
||||
if(gPowerHalV1_0_ == nullptr)
|
||||
gPowerHalV1_0_ = IPowerV1_0::getService();
|
||||
@@ -130,6 +134,12 @@ void connectLineagePowerHalLocked() {
|
||||
}
|
||||
}
|
||||
|
||||
+sp<ISehMiscPower> getSehMiscPower() {
|
||||
+ std::lock_guard<std::mutex> lock(gPowerHalMutex);
|
||||
+ connectPowerHalLocked();
|
||||
+ return gSehMiscPower;
|
||||
+}
|
||||
+
|
||||
// Retrieve a copy of PowerHAL V1_0
|
||||
sp<IPowerV1_0> getPowerHalV1_0() {
|
||||
std::lock_guard<std::mutex> lock(gPowerHalMutex);
|
||||
@@ -314,6 +324,14 @@ static void nativeSetInteractive(JNIEnv* /* env */, jclass /* clazz */, jboolean
|
||||
enable ? "true" : "false", enable ? "on" : "off");
|
||||
}
|
||||
}
|
||||
+ sp<ISehMiscPower> sehMiscPower = getSehMiscPower();
|
||||
+ if(sehMiscPower != nullptr) {
|
||||
+ android::base::Timer t;
|
||||
+ Return<void> ret = sehMiscPower->setInteractiveAsync(enable, 0);
|
||||
+ if(!ret.isOk()) {
|
||||
+ ALOGE("set interactive async() failed: seh misc setInteractiveAsync");
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
static void nativeSetAutoSuspend(JNIEnv* /* env */, jclass /* clazz */, jboolean enable) {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,117 +0,0 @@
|
||||
From e156f6e2e7af7d743dc5ea52fe6a5623730141ef Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 15 Dec 2019 23:19:32 +0100
|
||||
Subject: [PATCH 44/45] FacolaView: Support goodix ext and fix wrong forced
|
||||
brightness
|
||||
|
||||
---
|
||||
services/core/Android.bp | 1 +
|
||||
.../biometrics/fingerprint/FacolaView.java | 30 ++++++++++++++-----
|
||||
2 files changed, 23 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/services/core/Android.bp b/services/core/Android.bp
|
||||
index b2e8af938f3..9f83e49c27d 100644
|
||||
--- a/services/core/Android.bp
|
||||
+++ b/services/core/Android.bp
|
||||
@@ -54,6 +54,7 @@ java_library_static {
|
||||
"dnsresolver_aidl_interface-V2-java",
|
||||
"netd_aidl_interface-V2-java",
|
||||
"netd_event_listener_interface-java",
|
||||
+ "vendor.goodix.extend.service-V2.0-java",
|
||||
"vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
|
||||
],
|
||||
}
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
index 08436019bc9..651cc97be39 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -36,6 +36,7 @@ import java.io.FileReader;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint;
|
||||
+import vendor.goodix.extend.service.V2_0.IGoodixFPExtendService;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
@@ -46,6 +47,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
private final Paint mPaintFingerprint = new Paint();
|
||||
private final Paint mPaintShow = new Paint();
|
||||
private IXiaomiFingerprint mXiaomiFingerprint = null;
|
||||
+ private IGoodixFPExtendService mGoodixFingerprint = null;
|
||||
private boolean mInsideCircle = false;
|
||||
private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
|
||||
|
||||
@@ -94,11 +96,17 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
setOnTouchListener(this);
|
||||
mWM = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
Slog.d("PHH-Enroll", "Created facola...");
|
||||
- try {
|
||||
- if(mW != -1)
|
||||
+ if(mW != -1) {
|
||||
+ try {
|
||||
mXiaomiFingerprint = IXiaomiFingerprint.getService();
|
||||
- } catch(Exception e) {
|
||||
- Slog.d("PHH-Enroll", "Failed getting xiaomi fingerprint service", e);
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed getting xiaomi fingerprint service", e);
|
||||
+ }
|
||||
+ try {
|
||||
+ mGoodixFingerprint = IGoodixFPExtendService.getService();
|
||||
+ } catch(Exception e) {
|
||||
+ Slog.d("PHH-Enroll", "Failed getting goodix fingerprint service", e);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +121,8 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
int nitValue = 2;
|
||||
if(mXiaomiFingerprint != null)
|
||||
mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
+ if(mGoodixFingerprint != null)
|
||||
+ mXiaomiFingerprint.extCmd(10, 1);
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
@@ -122,6 +132,8 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
try {
|
||||
if(mXiaomiFingerprint != null)
|
||||
mXiaomiFingerprint.extCmd(0xa, 0);
|
||||
+ if(mGoodixFingerprint != null)
|
||||
+ mXiaomiFingerprint.extCmd(10, 0);
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
@@ -151,10 +163,10 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
- if(!noDim) {
|
||||
- mParams.dimAmount = TOUCHED_DIM;
|
||||
- mParams.screenBrightness = 1.0f;
|
||||
- }
|
||||
+ if(!noDim) {
|
||||
+ mParams.dimAmount = TOUCHED_DIM;
|
||||
+ mParams.screenBrightness = 1.0f;
|
||||
+ }
|
||||
mWM.updateViewLayout(this, mParams);
|
||||
|
||||
return true;
|
||||
@@ -164,6 +176,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
Slog.d("PHH-Enroll", "Show", new Exception());
|
||||
if(!mHidden) return;
|
||||
mHidden = false;
|
||||
+ mInsideCircle = false;
|
||||
if(samsungFod) {
|
||||
samsungCmd("fod_enable,1,1");
|
||||
}
|
||||
@@ -191,6 +204,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
WindowManager.LayoutParams.FLAG_DIM_BEHIND |
|
||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
|
||||
mParams.dimAmount = UNTOUCHED_DIM;
|
||||
+ mParams.screenBrightness = .0f;
|
||||
|
||||
mParams.packageName = "android";
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,59 +0,0 @@
|
||||
From 482586467473be36e881922152c9cf410ab0b73c Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 16 Dec 2019 19:31:12 +0100
|
||||
Subject: [PATCH 45/45] Fix (big) goodix integration mistakes
|
||||
|
||||
---
|
||||
.../biometrics/fingerprint/FacolaView.java | 19 ++++++++++++-------
|
||||
1 file changed, 12 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
index 651cc97be39..b8ca25a48d2 100644
|
||||
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
|
||||
@@ -119,10 +119,11 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
if(mInsideCircle) {
|
||||
try {
|
||||
int nitValue = 2;
|
||||
- if(mXiaomiFingerprint != null)
|
||||
+ if(mXiaomiFingerprint != null) {
|
||||
mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
- if(mGoodixFingerprint != null)
|
||||
- mXiaomiFingerprint.extCmd(10, 1);
|
||||
+ } else if(mGoodixFingerprint != null) {
|
||||
+ mGoodixFingerprint.goodixExtendCommand(10, 1);
|
||||
+ }
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
@@ -130,10 +131,11 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
canvas.drawCircle(mW/2, mH/2, (float) (mW/2.0f), this.mPaintFingerprint);
|
||||
} else {
|
||||
try {
|
||||
- if(mXiaomiFingerprint != null)
|
||||
+ if(mXiaomiFingerprint != null) {
|
||||
mXiaomiFingerprint.extCmd(0xa, 0);
|
||||
- if(mGoodixFingerprint != null)
|
||||
- mXiaomiFingerprint.extCmd(10, 0);
|
||||
+ } else if(mGoodixFingerprint != null) {
|
||||
+ mGoodixFingerprint.goodixExtendCommand(10, 0);
|
||||
+ }
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
@@ -226,8 +228,11 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
if(mX == -1 || mY == -1 || mW == -1 || mH == -1) return;
|
||||
|
||||
try {
|
||||
- if(mXiaomiFingerprint != null)
|
||||
+ if(mXiaomiFingerprint != null) {
|
||||
mXiaomiFingerprint.extCmd(0xa, 0);
|
||||
+ } else if(mGoodixFingerprint != null) {
|
||||
+ mXiaomiFingerprint.extCmd(10, 0);
|
||||
+ }
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 0ce8e40182af9c1955a862f8bba608b90e6a0524 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 21:01:35 +0200
|
||||
Subject: [PATCH 1/5] AOSP 8.0/8.1 didn't use presentOrValidate, so it's
|
||||
broken. Don't use it
|
||||
|
||||
Change-Id: If86793dba3738680280f9dc0f7e7c802c0836690
|
||||
---
|
||||
services/surfaceflinger/DisplayHardware/HWComposer.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
index 1099041b4..2021c26b0 100644
|
||||
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
|
||||
@@ -424,7 +424,7 @@ status_t HWComposer::prepare(DisplayId displayId, const compositionengine::Outpu
|
||||
// The check below is incorrect. We actually rely on HWC here to fall
|
||||
// back to validate when there is any client layer.
|
||||
displayData.validateWasSkipped = false;
|
||||
- if (!displayData.hasClientComposition) {
|
||||
+ if ((false)) {
|
||||
sp<Fence> outPresentFence;
|
||||
uint32_t state = UINT32_MAX;
|
||||
error = hwcDisplay->presentOrValidate(&numTypes, &numRequests, &outPresentFence , &state);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From d51e5d5a041f8404b5d62cfca5f5765588ded4fb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 23:07:24 +0200
|
||||
Subject: [PATCH 2/5] Ignore usage bits verification
|
||||
|
||||
This didn't ignore as of 8.1, so we're ""safe""
|
||||
|
||||
Change-Id: I40c1d588c1fa104d844322b469f76e52bee1495a
|
||||
---
|
||||
libs/ui/Gralloc2.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libs/ui/Gralloc2.cpp b/libs/ui/Gralloc2.cpp
|
||||
index 5dc453005..90dc90f39 100644
|
||||
--- a/libs/ui/Gralloc2.cpp
|
||||
+++ b/libs/ui/Gralloc2.cpp
|
||||
@@ -108,7 +108,7 @@ status_t Gralloc2Mapper::validateBufferDescriptorInfo(
|
||||
if (descriptorInfo->usage & ~validUsageBits) {
|
||||
ALOGE("buffer descriptor contains invalid usage bits 0x%" PRIx64,
|
||||
descriptorInfo->usage & ~validUsageBits);
|
||||
- return BAD_VALUE;
|
||||
+ //return BAD_VALUE;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 8db7e963f05ebc59298cf8e9b74f98d670ec5742 Mon Sep 17 00:00:00 2001
|
||||
From: phh <phh@phh.me>
|
||||
Date: Wed, 22 Aug 2018 08:57:52 +0000
|
||||
Subject: [PATCH 3/5] Enable fallback to old ro.sf.hwrotation property
|
||||
|
||||
Change-Id: I46b75a15b85fc5bda31357a4beeb7dab77bd6fe1
|
||||
---
|
||||
services/surfaceflinger/SurfaceFlinger.cpp | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
index 6166789fc..14ca4729c 100644
|
||||
--- a/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
|
||||
@@ -329,7 +329,25 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
|
||||
SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
|
||||
break;
|
||||
}
|
||||
+
|
||||
ALOGV("Primary Display Orientation is set to %2d.", SurfaceFlinger::primaryDisplayOrientation);
|
||||
+ if(tmpPrimaryDisplayOrientation == SurfaceFlingerProperties::primary_display_orientation_values::ORIENTATION_0) {
|
||||
+ int sfRotation = property_get_int32("ro.sf.hwrotation", -1);
|
||||
+ switch(sfRotation) {
|
||||
+ case 0:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
|
||||
+ break;
|
||||
+ case 90:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation90;
|
||||
+ break;
|
||||
+ case 180:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation180;
|
||||
+ break;
|
||||
+ case 270:
|
||||
+ SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientation270;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries();
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,32 +0,0 @@
|
||||
From c554242731125a5e6a3f7d31d4f4af9049d8c7f4 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 12 Aug 2019 23:48:37 +0200
|
||||
Subject: [PATCH 4/5] Some Samsung devices requires lying colorspace
|
||||
|
||||
Change-Id: I4153b8e7abc10c519565e4e4386c6388621477b2
|
||||
---
|
||||
opengl/libs/EGL/egl_platform_entries.cpp | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
index e996be685..57ca592a7 100644
|
||||
--- a/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
+++ b/opengl/libs/EGL/egl_platform_entries.cpp
|
||||
@@ -458,8 +458,14 @@ EGLBoolean eglGetConfigAttribImpl(EGLDisplay dpy, EGLConfig config,
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Translates EGL color spaces to Android data spaces.
|
||||
+static int samsungColorspace = -1;
|
||||
static android_dataspace dataSpaceFromEGLColorSpace(EGLint colorspace) {
|
||||
+ if(samsungColorspace == -1) {
|
||||
+ samsungColorspace = property_get_bool("persist.sys.phh.samsung_colorspace", false);
|
||||
+ }
|
||||
if (colorspace == EGL_GL_COLORSPACE_LINEAR_KHR) {
|
||||
+ if(samsungColorspace)
|
||||
+ return HAL_DATASPACE_UNKNOWN;
|
||||
return HAL_DATASPACE_UNKNOWN;
|
||||
} else if (colorspace == EGL_GL_COLORSPACE_SRGB_KHR) {
|
||||
return HAL_DATASPACE_V0_SRGB;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From fd7365352954e1ab647fca2eefeaa2707d47f7fa Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 14 Aug 2019 23:37:10 +0200
|
||||
Subject: [PATCH 5/5] On Samsung, we need to send a hack-message to HAL to get
|
||||
all Sensors
|
||||
|
||||
Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376
|
||||
---
|
||||
services/sensorservice/SensorDevice.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
|
||||
index 717f31769..45d6c679b 100644
|
||||
--- a/services/sensorservice/SensorDevice.cpp
|
||||
+++ b/services/sensorservice/SensorDevice.cpp
|
||||
@@ -30,7 +30,9 @@
|
||||
#include <cinttypes>
|
||||
#include <thread>
|
||||
|
||||
+#include <android-base/properties.h>
|
||||
using namespace android::hardware::sensors;
|
||||
+
|
||||
using namespace android::hardware::sensors::V1_0;
|
||||
using namespace android::hardware::sensors::V1_0::implementation;
|
||||
using android::hardware::sensors::V2_0::ISensorsCallback;
|
||||
@@ -115,6 +117,8 @@ SensorDevice::SensorDevice()
|
||||
void SensorDevice::initializeSensorList() {
|
||||
float minPowerMa = 0.001; // 1 microAmp
|
||||
|
||||
+ if(::android::base::GetBoolProperty("persist.sys.phh.samsung_sensors", false))
|
||||
+ setMode(5555);
|
||||
checkReturn(mSensors->getSensorsList(
|
||||
[&](const auto &list) {
|
||||
const size_t count = list.size();
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,130 +0,0 @@
|
||||
From d5a9fce16e57c2dfbc090190b0ed99f833f9842b Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 16:59:12 +0200
|
||||
Subject: [PATCH 1/4] Revert "SupplicantManager: Remove
|
||||
|ensure_config_file_exists|"
|
||||
|
||||
This reverts commit f61dc8cd7dadda5741d6e4a1bb6b576ba89cc24b.
|
||||
---
|
||||
libwifi_system/supplicant_manager.cpp | 97 +++++++++++++++++++++++++++
|
||||
1 file changed, 97 insertions(+)
|
||||
|
||||
diff --git a/libwifi_system/supplicant_manager.cpp b/libwifi_system/supplicant_manager.cpp
|
||||
index 60720d40f..f22eea92e 100644
|
||||
--- a/libwifi_system/supplicant_manager.cpp
|
||||
+++ b/libwifi_system/supplicant_manager.cpp
|
||||
@@ -33,7 +33,89 @@ namespace wifi_system {
|
||||
namespace {
|
||||
|
||||
const char kSupplicantInitProperty[] = "init.svc.wpa_supplicant";
|
||||
+const char kSupplicantConfigTemplatePath[] =
|
||||
+ "/etc/wifi/wpa_supplicant.conf";
|
||||
+const char kSupplicantConfigFile[] = "/data/misc/wifi/wpa_supplicant.conf";
|
||||
+const char kP2pConfigFile[] = "/data/misc/wifi/p2p_supplicant.conf";
|
||||
const char kSupplicantServiceName[] = "wpa_supplicant";
|
||||
+constexpr mode_t kConfigFileMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
|
||||
+
|
||||
+int ensure_config_file_exists(const char* config_file) {
|
||||
+ char buf[2048];
|
||||
+ int srcfd, destfd;
|
||||
+ int nread;
|
||||
+ int ret;
|
||||
+ std::string templatePath;
|
||||
+
|
||||
+ ret = access(config_file, R_OK | W_OK);
|
||||
+ if ((ret == 0) || (errno == EACCES)) {
|
||||
+ if ((ret != 0) && (chmod(config_file, kConfigFileMode) != 0)) {
|
||||
+ LOG(ERROR) << "Cannot set RW to \"" << config_file << "\": "
|
||||
+ << strerror(errno);
|
||||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
+ } else if (errno != ENOENT) {
|
||||
+ LOG(ERROR) << "Cannot access \"" << config_file << "\": "
|
||||
+ << strerror(errno);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ std::string configPathSystem =
|
||||
+ std::string("/system") + std::string(kSupplicantConfigTemplatePath);
|
||||
+ std::string configPathVendor =
|
||||
+ std::string("/vendor") + std::string(kSupplicantConfigTemplatePath);
|
||||
+ srcfd = TEMP_FAILURE_RETRY(open(configPathSystem.c_str(), O_RDONLY));
|
||||
+ templatePath = configPathSystem;
|
||||
+ if (srcfd < 0) {
|
||||
+ int errnoSystem = errno;
|
||||
+ srcfd = TEMP_FAILURE_RETRY(open(configPathVendor.c_str(), O_RDONLY));
|
||||
+ templatePath = configPathVendor;
|
||||
+ if (srcfd < 0) {
|
||||
+ int errnoVendor = errno;
|
||||
+ LOG(ERROR) << "Cannot open \"" << configPathSystem << "\": "
|
||||
+ << strerror(errnoSystem);
|
||||
+ LOG(ERROR) << "Cannot open \"" << configPathVendor << "\": "
|
||||
+ << strerror(errnoVendor);
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ destfd = TEMP_FAILURE_RETRY(open(config_file,
|
||||
+ O_CREAT | O_RDWR,
|
||||
+ kConfigFileMode));
|
||||
+ if (destfd < 0) {
|
||||
+ close(srcfd);
|
||||
+ LOG(ERROR) << "Cannot create \"" << config_file << "\": "
|
||||
+ << strerror(errno);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ while ((nread = TEMP_FAILURE_RETRY(read(srcfd, buf, sizeof(buf)))) != 0) {
|
||||
+ if (nread < 0) {
|
||||
+ LOG(ERROR) << "Error reading \"" << templatePath
|
||||
+ << "\": " << strerror(errno);
|
||||
+ close(srcfd);
|
||||
+ close(destfd);
|
||||
+ unlink(config_file);
|
||||
+ return false;
|
||||
+ }
|
||||
+ TEMP_FAILURE_RETRY(write(destfd, buf, nread));
|
||||
+ }
|
||||
+
|
||||
+ close(destfd);
|
||||
+ close(srcfd);
|
||||
+
|
||||
+ /* chmod is needed because open() didn't set permisions properly */
|
||||
+ if (chmod(config_file, kConfigFileMode) < 0) {
|
||||
+ LOG(ERROR) << "Error changing permissions of " << config_file
|
||||
+ << " to 0660: " << strerror(errno);
|
||||
+ unlink(config_file);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -49,6 +131,21 @@ bool SupplicantManager::StartSupplicant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
+ /* Before starting the daemon, make sure its config file exists */
|
||||
+ if (ensure_config_file_exists(kSupplicantConfigFile) < 0) {
|
||||
+ LOG(ERROR) << "Wi-Fi will not be enabled";
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Some devices have another configuration file for the p2p interface.
|
||||
+ * However, not all devices have this, and we'll let it slide if it
|
||||
+ * is missing. For devices that do expect this file to exist,
|
||||
+ * supplicant will refuse to start and emit a good error message.
|
||||
+ * No need to check for it here.
|
||||
+ */
|
||||
+ (void)ensure_config_file_exists(kP2pConfigFile);
|
||||
+
|
||||
/*
|
||||
* Get a reference to the status property, so we can distinguish
|
||||
* the case where it goes stopped => running => stopped (i.e.,
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,94 +0,0 @@
|
||||
From 5e4a56c542339de718992bdfeeb0a72ec5cd4d98 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <pierre-hugues.husson@softathome.com>
|
||||
Date: Tue, 18 Sep 2018 17:05:07 +0200
|
||||
Subject: [PATCH 2/4] Support hostap on O/O-MR1 vendors
|
||||
|
||||
Two issues are fixed here:
|
||||
- some vendor HALs lied (because of Android behaviour) about ap interface name.
|
||||
O/O-MR1 behaviour meant hostap/sta had same interface. So "wlan0" sound
|
||||
quite a good guess
|
||||
- doing multiple configureChip in one IWifi session wasn't allowed.
|
||||
Now, it is a requirement to be supported, so most(all?) HALs don't
|
||||
support it. force stop/start for every reconfiguration
|
||||
---
|
||||
.../android/server/wifi/HalDeviceManager.java | 22 +++++++++++++++++--
|
||||
.../com/android/server/wifi/WifiNative.java | 15 ++++++++++++-
|
||||
2 files changed, 34 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/service/java/com/android/server/wifi/HalDeviceManager.java b/service/java/com/android/server/wifi/HalDeviceManager.java
|
||||
index bb53a6e88..612bd48b8 100644
|
||||
--- a/service/java/com/android/server/wifi/HalDeviceManager.java
|
||||
+++ b/service/java/com/android/server/wifi/HalDeviceManager.java
|
||||
@@ -63,8 +63,8 @@ import java.util.Set;
|
||||
*/
|
||||
public class HalDeviceManager {
|
||||
private static final String TAG = "HalDevMgr";
|
||||
- private static final boolean VDBG = false;
|
||||
- private boolean mDbg = false;
|
||||
+ private static final boolean VDBG = true;
|
||||
+ private boolean mDbg = true;
|
||||
|
||||
private static final int START_HAL_RETRY_INTERVAL_MS = 20;
|
||||
// Number of attempts a start() is re-tried. A value of 0 means no retries after a single
|
||||
@@ -226,6 +226,16 @@ public class HalDeviceManager {
|
||||
*/
|
||||
public IWifiStaIface createStaIface(boolean lowPrioritySta,
|
||||
@Nullable InterfaceDestroyedListener destroyedListener, @Nullable Handler handler) {
|
||||
+ //As of O and O-MR1, configureChip MUST BE after a startWifi
|
||||
+ //Pie changed this to allow dynamic configureChip
|
||||
+ //No O/O-MR1 HAL support that, so restart wifi HAL when we do that
|
||||
+ if(android.os.SystemProperties.getInt("persist.sys.vndk", 28) < 28) {
|
||||
+ Log.e(TAG, "createStaIface: Stopping wifi");
|
||||
+ stopWifi();
|
||||
+ Log.e(TAG, "createStaIface: Starting wifi");
|
||||
+ startWifi();
|
||||
+ Log.e(TAG, "createStaIface: Creating iface");
|
||||
+ }
|
||||
return (IWifiStaIface) createIface(IfaceType.STA, lowPrioritySta, destroyedListener,
|
||||
handler);
|
||||
}
|
||||
@@ -235,6 +245,14 @@ public class HalDeviceManager {
|
||||
*/
|
||||
public IWifiApIface createApIface(@Nullable InterfaceDestroyedListener destroyedListener,
|
||||
@Nullable Handler handler) {
|
||||
+ //cf createStaIface
|
||||
+ if(android.os.SystemProperties.getInt("persist.sys.vndk", 28) < 28) {
|
||||
+ Log.e(TAG, "createApIface: Stopping wifi");
|
||||
+ stopWifi();
|
||||
+ Log.e(TAG, "createApIface: Starting wifi");
|
||||
+ startWifi();
|
||||
+ Log.e(TAG, "createApIface: Creating iface");
|
||||
+ }
|
||||
return (IWifiApIface) createIface(IfaceType.AP, false, destroyedListener, handler);
|
||||
}
|
||||
|
||||
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
|
||||
index 3e5dc3c79..63907e67c 100644
|
||||
--- a/service/java/com/android/server/wifi/WifiNative.java
|
||||
+++ b/service/java/com/android/server/wifi/WifiNative.java
|
||||
@@ -769,8 +769,21 @@ public class WifiNative {
|
||||
private String createApIface(@NonNull Iface iface) {
|
||||
synchronized (mLock) {
|
||||
if (mWifiVendorHal.isVendorHalSupported()) {
|
||||
- return mWifiVendorHal.createApIface(
|
||||
+ String ret = mWifiVendorHal.createApIface(
|
||||
new InterfaceDestoyedListenerInternal(iface.id));
|
||||
+ //In O and O-MR1, there was only ONE wifi interface for everything (sta and ap)
|
||||
+ //Most vendors used "wlan0" for those interfaces, but there is no guarantee
|
||||
+ //This override exists here, because most OEMs return "ap0" when doing createApIface,
|
||||
+ //even when the iface is actually called "wlan0"
|
||||
+ //
|
||||
+ //To be perfectly clean, we should check what value createStaIface (would have) returned
|
||||
+ //and use the same one.
|
||||
+ //That's overly complicated, so let's assume this is wlan0 for the moment
|
||||
+ if(android.os.SystemProperties.getInt("persist.sys.vndk", 28) < 28) {
|
||||
+ ret = "wlan0";
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
} else {
|
||||
Log.i(TAG, "Vendor Hal not supported, ignoring createApIface.");
|
||||
return handleIfaceCreationWhenVendorHalNotSupported(iface);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,94 +0,0 @@
|
||||
From e9e35f0091a58a51c21aaa46e52764578c85a5b4 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 16 Sep 2019 17:42:37 +0200
|
||||
Subject: [PATCH 3/4] Restore O/O-MR1 behaviour of initing ifaces before supp.
|
||||
Still not perfect, because wifi can be turned on only once
|
||||
|
||||
Change-Id: I7a94b3c4a3fca140a50962e6787af3a7aa2c7d61
|
||||
---
|
||||
.../server/wifi/SupplicantStaIfaceHal.java | 4 ++--
|
||||
.../java/com/android/server/wifi/WifiNative.java | 16 ++++++++++++++--
|
||||
2 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
index bed66d926..fda64e977 100644
|
||||
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
@@ -717,7 +717,7 @@ public class SupplicantStaIfaceHal {
|
||||
* the device.
|
||||
* @return true if supported, false otherwise.
|
||||
*/
|
||||
- private boolean isV1_1() {
|
||||
+ /* package */ boolean isV1_1() {
|
||||
return checkHalVersionByInterfaceName(
|
||||
android.hardware.wifi.supplicant.V1_1.ISupplicant.kInterfaceName);
|
||||
}
|
||||
@@ -727,7 +727,7 @@ public class SupplicantStaIfaceHal {
|
||||
* the device.
|
||||
* @return true if supported, false otherwise.
|
||||
*/
|
||||
- private boolean isV1_2() {
|
||||
+ /* package */ boolean isV1_2() {
|
||||
return checkHalVersionByInterfaceName(
|
||||
android.hardware.wifi.supplicant.V1_2.ISupplicant.kInterfaceName);
|
||||
}
|
||||
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
|
||||
index 63907e67c..917494a10 100644
|
||||
--- a/service/java/com/android/server/wifi/WifiNative.java
|
||||
+++ b/service/java/com/android/server/wifi/WifiNative.java
|
||||
@@ -370,9 +370,11 @@ public class WifiNative {
|
||||
}
|
||||
|
||||
/** Helper method invoked to start supplicant if there were no STA ifaces */
|
||||
+ private boolean supplicantOn = false;
|
||||
private boolean startSupplicant() {
|
||||
synchronized (mLock) {
|
||||
- if (!mIfaceMgr.hasAnyStaIfaceForConnectivity()) {
|
||||
+ boolean prePieWifi = !mSupplicantStaIfaceHal.isV1_2();
|
||||
+ if (!mIfaceMgr.hasAnyStaIfaceForConnectivity() || (prePieWifi && !supplicantOn)) {
|
||||
if (!startAndWaitForSupplicantConnection()) {
|
||||
Log.e(TAG, "Failed to connect to supplicant");
|
||||
return false;
|
||||
@@ -382,6 +384,8 @@ public class WifiNative {
|
||||
Log.e(TAG, "Failed to register supplicant death handler");
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ supplicantOn = true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -395,6 +399,7 @@ public class WifiNative {
|
||||
Log.e(TAG, "Failed to deregister supplicant death handler");
|
||||
}
|
||||
mSupplicantStaIfaceHal.terminate();
|
||||
+ supplicantOn = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -941,7 +946,9 @@ public class WifiNative {
|
||||
mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToHal();
|
||||
return null;
|
||||
}
|
||||
- if (!startSupplicant()) {
|
||||
+ boolean prePieWifi = !mSupplicantStaIfaceHal.isV1_2();
|
||||
+
|
||||
+ if (!prePieWifi && !startSupplicant()) {
|
||||
Log.e(TAG, "Failed to start supplicant");
|
||||
mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant();
|
||||
return null;
|
||||
@@ -965,6 +972,11 @@ public class WifiNative {
|
||||
mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToWificond();
|
||||
return null;
|
||||
}
|
||||
+ if (prePieWifi && !startSupplicant()) {
|
||||
+ Log.e(TAG, "Failed to start supplicant");
|
||||
+ mWifiMetrics.incrementNumSetupClientInterfaceFailureDueToSupplicant();
|
||||
+ return null;
|
||||
+ }
|
||||
if (!mSupplicantStaIfaceHal.setupIface(iface.name)) {
|
||||
Log.e(TAG, "Failed to setup iface in supplicant on " + iface);
|
||||
teardownInterface(iface.name);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 77792728f07c8a1f9dbd9c2e2532138b2e06d8e3 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 16 Sep 2019 22:47:37 +0200
|
||||
Subject: [PATCH 4/4] Boot wifi supplicant both with lazy-hal style and init
|
||||
style
|
||||
|
||||
Change-Id: I7e23348d4d16d3787f2c80bce3f8d0178dd5c4c7
|
||||
---
|
||||
.../java/com/android/server/wifi/SupplicantStaIfaceHal.java | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
index fda64e977..2b98557e9 100644
|
||||
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
|
||||
@@ -616,12 +616,12 @@ public class SupplicantStaIfaceHal {
|
||||
*/
|
||||
public boolean startDaemon() {
|
||||
synchronized (mLock) {
|
||||
+ Log.i(TAG, "Starting supplicant using init");
|
||||
+ mPropertyService.set(INIT_START_PROPERTY, INIT_SERVICE_NAME);
|
||||
if (isV1_1()) {
|
||||
Log.i(TAG, "Starting supplicant using HIDL");
|
||||
return startDaemon_V1_1();
|
||||
} else {
|
||||
- Log.i(TAG, "Starting supplicant using init");
|
||||
- mPropertyService.set(INIT_START_PROPERTY, INIT_SERVICE_NAME);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,50 +0,0 @@
|
||||
From 60d9333099db6587acd48b896d37e9e949fa95dc Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 16 Aug 2018 22:12:46 +0200
|
||||
Subject: [PATCH 1/6] Add route to gateway on null netmask
|
||||
|
||||
Galaxy S9 returns empty prefix
|
||||
|
||||
Change-Id: I8133da8e8f5203666684100009ba658528a02e94
|
||||
---
|
||||
.../dataconnection/DataConnection.java | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
|
||||
index 20ccee8c9..f39d01809 100644
|
||||
--- a/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
|
||||
+++ b/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
|
||||
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
|
||||
import android.app.PendingIntent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.KeepalivePacketData;
|
||||
+import android.net.IpPrefix;
|
||||
import android.net.LinkAddress;
|
||||
import android.net.LinkProperties;
|
||||
import android.net.NetworkCapabilities;
|
||||
@@ -1393,6 +1394,22 @@ public class DataConnection extends StateMachine {
|
||||
}
|
||||
|
||||
for (InetAddress gateway : response.getGatewayAddresses()) {
|
||||
+ if(response.getAddresses().size()>0) {
|
||||
+ //TODO:
|
||||
+ // - IPv6
|
||||
+ // - Multiple addresses
|
||||
+ // - Check for non-trivial prefix length
|
||||
+ LinkAddress la = response.getAddresses().get(0);
|
||||
+ if(la.getNetworkPrefixLength() == 32 &&
|
||||
+ gateway instanceof java.net.Inet4Address) {
|
||||
+ if(!gateway.isAnyLocalAddress()) {
|
||||
+ linkProperties.addRoute(new RouteInfo(
|
||||
+ new IpPrefix(gateway, 32),
|
||||
+ InetAddress.getByName("0.0.0.0"),
|
||||
+ response.getInterfaceName()));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
// Allow 0.0.0.0 or :: as a gateway;
|
||||
// this indicates a point-to-point interface.
|
||||
linkProperties.addRoute(new RouteInfo(gateway));
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From e66ddf44169f3dda57d01a9dd5aded920bdc80a9 Mon Sep 17 00:00:00 2001
|
||||
From: Artem Borisov <dedsa2002@gmail.com>
|
||||
Date: Sat, 10 Nov 2018 17:19:17 +0000
|
||||
Subject: [PATCH 2/6] Telephony: Don not call onUssdRelease for Huawei RIL
|
||||
|
||||
Huawei RIL doesn't seem to work properly with USSD_MODE_NW_RELEASE,
|
||||
always releasing USSD when it should be finished instead.
|
||||
Let's explicitly call onUssdFinished in this case.
|
||||
|
||||
Change-Id: I69faed1c51d4582834879975d6ab13daf7f48ad4
|
||||
---
|
||||
src/java/com/android/internal/telephony/GsmCdmaPhone.java | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
index 6e539f0ae..14a322747 100644
|
||||
--- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
+++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
@@ -2313,7 +2313,11 @@ public class GsmCdmaPhone extends Phone {
|
||||
// Complete pending USSD
|
||||
|
||||
if (isUssdRelease) {
|
||||
- found.onUssdRelease();
|
||||
+ if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) {
|
||||
+ found.onUssdFinished(ussdMessage, isUssdRequest);
|
||||
+ } else {
|
||||
+ found.onUssdRelease();
|
||||
+ }
|
||||
} else if (isUssdError) {
|
||||
found.onUssdFinishedError();
|
||||
} else {
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From e67dac2c25d6a64230a866566fbc2636b2f73bc6 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 28 Dec 2018 13:06:32 +0100
|
||||
Subject: [PATCH 3/6] Make MAX_CONNECTIONS_GSM settable from property
|
||||
|
||||
cf https://github.com/phhusson/treble_experimentations/issues/110
|
||||
|
||||
Change-Id: I5df755535aa5ded704d4c33122d63ac2481bd5f6
|
||||
---
|
||||
src/java/com/android/internal/telephony/GsmCdmaCallTracker.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/GsmCdmaCallTracker.java b/src/java/com/android/internal/telephony/GsmCdmaCallTracker.java
|
||||
index 0a7acee57..aca129308 100755
|
||||
--- a/src/java/com/android/internal/telephony/GsmCdmaCallTracker.java
|
||||
+++ b/src/java/com/android/internal/telephony/GsmCdmaCallTracker.java
|
||||
@@ -64,7 +64,7 @@ public class GsmCdmaCallTracker extends CallTracker {
|
||||
|
||||
//***** Constants
|
||||
|
||||
- public static final int MAX_CONNECTIONS_GSM = 19; //7 allowed in GSM + 12 from IMS for SRVCC
|
||||
+ public static final int MAX_CONNECTIONS_GSM = android.os.SystemProperties.getInt("persist.sys.phh.radio.max_connections_gsm", 19); //7 allowed in GSM + 12 from IMS for SRVCC
|
||||
private static final int MAX_CONNECTIONS_PER_CALL_GSM = 5; //only 5 connections allowed per call
|
||||
|
||||
private static final int MAX_CONNECTIONS_CDMA = 8;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 21952419962b9a642a5312e8258039bbbb5f893b Mon Sep 17 00:00:00 2001
|
||||
From: Dil3mm4 <dil3mm4.dev@gmail.com>
|
||||
Date: Sat, 17 Nov 2018 18:18:42 +0000
|
||||
Subject: [PATCH 4/6] Choose a more generic prop.
|
||||
|
||||
Since USSD it's a problem over MTK too and not only on Kirin, let's be more generic.
|
||||
|
||||
Change-Id: Icf1700f55be40915f9c64059019287f300d81405
|
||||
---
|
||||
src/java/com/android/internal/telephony/GsmCdmaPhone.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
index 14a322747..8359a3858 100644
|
||||
--- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
+++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java
|
||||
@@ -2313,7 +2313,7 @@ public class GsmCdmaPhone extends Phone {
|
||||
// Complete pending USSD
|
||||
|
||||
if (isUssdRelease) {
|
||||
- if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) {
|
||||
+ if (SystemProperties.getBoolean("persist.sys.radio.ussd.fix", false)) {
|
||||
found.onUssdFinished(ussdMessage, isUssdRequest);
|
||||
} else {
|
||||
found.onUssdRelease();
|
||||
--
|
||||
2.17.1
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,45 +0,0 @@
|
||||
From 5c9753b0fe01bf6b5b025a3c2ad9405e92341fc4 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 13 Oct 2019 17:21:31 +0800
|
||||
Subject: [PATCH 7/7] telephony: forward-port support for forceCognitive
|
||||
|
||||
* This is needed on some MTK devices. Android 10 refactored some code,
|
||||
so now the "non-persistent/cognitive" filter is relocated to RIL and
|
||||
also in DcTracker.setupData().
|
||||
---
|
||||
src/java/com/android/internal/telephony/RIL.java | 3 ++-
|
||||
.../android/internal/telephony/dataconnection/DcTracker.java | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java
|
||||
index 586dd063a..cc8997ccc 100644
|
||||
--- a/src/java/com/android/internal/telephony/RIL.java
|
||||
+++ b/src/java/com/android/internal/telephony/RIL.java
|
||||
@@ -3963,7 +3963,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
|
||||
for (DataProfile dp : dps) {
|
||||
// For v1.0 to v1.2, we only send data profiles that has the persistent
|
||||
// (a.k.a modem cognitive) bit set to true.
|
||||
- if (dp.isPersistent()) {
|
||||
+ boolean forceCognitive = SystemProperties.getBoolean("persist.sys.phh.radio.force_cognitive", false);
|
||||
+ if (dp.isPersistent() || forceCognitive) {
|
||||
dpis.add(convertToHalDataProfile10(dp));
|
||||
}
|
||||
}
|
||||
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
|
||||
index 7a4bfd8d3..f5c54cc40 100644
|
||||
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
|
||||
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
|
||||
@@ -1890,8 +1890,9 @@ public class DcTracker extends Handler {
|
||||
}
|
||||
|
||||
// profile id is only meaningful when the profile is persistent on the modem.
|
||||
+ boolean forceCognitive = SystemProperties.getBoolean("persist.sys.phh.radio.force_cognitive", false);
|
||||
int profileId = DATA_PROFILE_INVALID;
|
||||
- if (apnSetting.isPersistent()) {
|
||||
+ if (apnSetting.isPersistent() || forceCognitive) {
|
||||
profileId = apnSetting.getProfileId();
|
||||
if (profileId == DATA_PROFILE_DEFAULT) {
|
||||
profileId = getApnProfileID(apnContext.getApnType());
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From b009ff6561e52e151adfc4aaa5b0b4a56a66cac3 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 21:48:19 +0200
|
||||
Subject: [PATCH] Act as usb device when there is no hal, but we believe we are
|
||||
a device
|
||||
|
||||
Change-Id: I036090738525fd8cc63534d52d02ab1852950a7d
|
||||
---
|
||||
.../usb/UsbConnectionBroadcastReceiver.java | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
|
||||
index 695a714528..1f2b751991 100644
|
||||
--- a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
|
||||
+++ b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
|
||||
@@ -76,6 +76,14 @@ public class UsbConnectionBroadcastReceiver extends BroadcastReceiver implements
|
||||
mFunctions = functions;
|
||||
mDataRole = mUsbBackend.getDataRole();
|
||||
mPowerRole = mUsbBackend.getPowerRole();
|
||||
+ //If we have no USB HAL, mDataRole is invalid
|
||||
+ //But we can't be connected AND have none data_role, so it's safe.
|
||||
+ //It would be better to fix UsbManager when no HAL is available, but that's more work
|
||||
+ if(mDataRole == UsbPortStatus.DATA_ROLE_NONE &&
|
||||
+ intent.getExtras().getBoolean(UsbManager.USB_CONNECTED) &&
|
||||
+ !intent.getExtras().getBoolean(UsbManager.USB_HOST_CONNECTED))
|
||||
+ mDataRole = UsbPortStatus.DATA_ROLE_DEVICE;
|
||||
+
|
||||
}
|
||||
} else if (UsbManager.ACTION_USB_PORT_CHANGED.equals(intent.getAction())) {
|
||||
UsbPortStatus portStatus = intent.getExtras()
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 1dd0b7fde40e2e451126dcdea035ee8f0f662c8f Mon Sep 17 00:00:00 2001
|
||||
From: Artem Borisov <dedsa2002@gmail.com>
|
||||
Date: Wed, 19 Sep 2018 17:02:06 +0300
|
||||
Subject: [PATCH] Telephony: Support muting by RIL command
|
||||
|
||||
While almost everyone already moved to AudioManager years ago,
|
||||
some OEMs (cough Huawei) still use RIL for muting and don't
|
||||
promote the necessary calls in their audio HAL.
|
||||
Let's handle these odd cases too when it's necessary.
|
||||
|
||||
Change-Id: Id916dec2574d6e57b6f809fbaf2b0959c0cc7256
|
||||
---
|
||||
src/com/android/services/telephony/TelephonyConnection.java | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
|
||||
index 06dce1626..be4b2c31c 100644
|
||||
--- a/src/com/android/services/telephony/TelephonyConnection.java
|
||||
+++ b/src/com/android/services/telephony/TelephonyConnection.java
|
||||
@@ -25,6 +25,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.PersistableBundle;
|
||||
+import android.os.SystemProperties;
|
||||
import android.telecom.CallAudioState;
|
||||
import android.telecom.ConferenceParticipant;
|
||||
import android.telecom.Connection;
|
||||
@@ -747,6 +748,9 @@ abstract class TelephonyConnection extends Connection implements Holdable {
|
||||
if (!mSendMicMuteToAudioManager) {
|
||||
getPhone().setMute(audioState.isMuted());
|
||||
}
|
||||
+ if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) {
|
||||
+ getPhone().setMute(audioState.isMuted());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,50 +0,0 @@
|
||||
From 7c9e1ac4204748173e182c353f2c5b5c45ac1cdb Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 6 May 2019 20:25:34 +0200
|
||||
Subject: [PATCH 2/3] Fixes crash when selecting network
|
||||
|
||||
Cf https://github.com/phhusson/treble_experimentations/issues/486
|
||||
---
|
||||
src/com/android/phone/NetworkQueryService.java | 14 +++++++++++---
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/com/android/phone/NetworkQueryService.java b/src/com/android/phone/NetworkQueryService.java
|
||||
index e67582fa3..c622713e8 100644
|
||||
--- a/src/com/android/phone/NetworkQueryService.java
|
||||
+++ b/src/com/android/phone/NetworkQueryService.java
|
||||
@@ -43,6 +43,8 @@ import com.android.settingslib.utils.ThreadUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
+import java.util.regex.Matcher;
|
||||
+import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Service code used to assist in querying the network for service
|
||||
@@ -377,14 +379,20 @@ public class NetworkQueryService extends Service {
|
||||
*/
|
||||
private List<CellInfo> getCellInfoList(List<OperatorInfo> operatorInfoList) {
|
||||
List<CellInfo> cellInfoList = new ArrayList<>();
|
||||
+ Pattern p = Pattern.compile("^([0-9]{5,6}).*");
|
||||
for (OperatorInfo oi: operatorInfoList) {
|
||||
String operatorNumeric = oi.getOperatorNumeric();
|
||||
String mcc = null;
|
||||
String mnc = null;
|
||||
log("operatorNumeric: " + operatorNumeric);
|
||||
- if (operatorNumeric != null && operatorNumeric.matches("^[0-9]{5,6}$")) {
|
||||
- mcc = operatorNumeric.substring(0, 3);
|
||||
- mnc = operatorNumeric.substring(3);
|
||||
+ if (operatorNumeric != null) {
|
||||
+ Matcher m = p.matcher(operatorNumeric);
|
||||
+ if (m.matches()) {
|
||||
+ mcc = m.group(1).substring(0, 3);
|
||||
+ mnc = m.group(1).substring(3);
|
||||
+ } else {
|
||||
+ Log.e(LOG_TAG, "Failed to parse operatorNumeric!");
|
||||
+ }
|
||||
}
|
||||
CellIdentityGsm cig = new CellIdentityGsm(
|
||||
Integer.MAX_VALUE /* lac */,
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 0c7e103fd7c8d50322057a1f0fe852de9df0a029 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 20 May 2019 23:45:56 +0200
|
||||
Subject: [PATCH 3/3] Fail gracefully in mobile settings
|
||||
|
||||
---
|
||||
src/com/android/phone/DataUsagePreference.java | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/com/android/phone/DataUsagePreference.java b/src/com/android/phone/DataUsagePreference.java
|
||||
index b6b26e2b8..ebd446dfa 100644
|
||||
--- a/src/com/android/phone/DataUsagePreference.java
|
||||
+++ b/src/com/android/phone/DataUsagePreference.java
|
||||
@@ -54,8 +54,12 @@ public class DataUsagePreference extends Preference {
|
||||
DataUsageController controller = new DataUsageController(activity);
|
||||
|
||||
DataUsageController.DataUsageInfo usageInfo = controller.getDataUsageInfo(mTemplate);
|
||||
- setSummary(activity.getString(R.string.data_usage_template,
|
||||
- Formatter.formatFileSize(activity, usageInfo.usageLevel), usageInfo.period));
|
||||
+ if(usageInfo != null) {
|
||||
+ setSummary(activity.getString(R.string.data_usage_template,
|
||||
+ Formatter.formatFileSize(activity, usageInfo.usageLevel), usageInfo.period));
|
||||
+ } else {
|
||||
+ setSummary(activity.getString(R.string.data_usage_title));
|
||||
+ }
|
||||
setIntent(getIntent());
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,24 +0,0 @@
|
||||
From 8d85aaa52cf7deabcda97053cfc59288dd969d63 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Thu, 12 Sep 2019 20:41:03 +0200
|
||||
Subject: [PATCH] Disable rlimit on bpfloader, because it will crash 8.0 init
|
||||
|
||||
Change-Id: Ic6d7c8fa702ed5d2df7d4fff4f1c0a848a91e86b
|
||||
---
|
||||
bpfloader/bpfloader.rc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bpfloader/bpfloader.rc b/bpfloader/bpfloader.rc
|
||||
index 31747fb..d95cdbd 100644
|
||||
--- a/bpfloader/bpfloader.rc
|
||||
+++ b/bpfloader/bpfloader.rc
|
||||
@@ -5,5 +5,5 @@ service bpfloader /system/bin/bpfloader
|
||||
# Actually only 8MB is needed, but since bpfloader runs as root, it shares
|
||||
# the global rlimit. Once bpfloader is running as its own user in the
|
||||
# future, it will have dedicated rlimit to itself and this can be 8MB.
|
||||
- rlimit memlock 67108864 67108864
|
||||
+ #rlimit memlock 67108864 67108864
|
||||
oneshot
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,105 +0,0 @@
|
||||
From fef557417bece64d452454b3263ce2a8d3661ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 20 Feb 2018 23:04:50 +0100
|
||||
Subject: [PATCH 1/2] Make BTM_BYPASS_EXTRA_ACL_SETUP dynamic
|
||||
|
||||
Change-Id: Icb0868566b29b053ed7e83c9fd32e225af3f2e46
|
||||
---
|
||||
hci/include/bt_hci_bdroid.h | 3 +++
|
||||
internal_include/bt_target.h | 3 +++
|
||||
stack/btm/btm_acl.cc | 20 ++++++++++----------
|
||||
stack/btm/btm_sec.cc | 18 +++++++++---------
|
||||
4 files changed, 25 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/hci/include/bt_hci_bdroid.h b/hci/include/bt_hci_bdroid.h
|
||||
index cf2c1136f..e2844db82 100644
|
||||
--- a/hci/include/bt_hci_bdroid.h
|
||||
+++ b/hci/include/bt_hci_bdroid.h
|
||||
@@ -32,6 +32,9 @@
|
||||
#ifdef HAS_BDROID_BUILDCFG
|
||||
#include "bdroid_buildcfg.h"
|
||||
#endif
|
||||
+#ifndef BTM_BYPASS_EXTRA_ACL_SETUP
|
||||
+#define BTM_BYPASS_EXTRA_ACL_SETUP TRUE
|
||||
+#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Constants & Macros
|
||||
diff --git a/internal_include/bt_target.h b/internal_include/bt_target.h
|
||||
index 67a67c56d..3021ca37b 100644
|
||||
--- a/internal_include/bt_target.h
|
||||
+++ b/internal_include/bt_target.h
|
||||
@@ -32,6 +32,9 @@
|
||||
#ifdef HAS_BDROID_BUILDCFG
|
||||
#include "bdroid_buildcfg.h"
|
||||
#endif
|
||||
+#ifndef BTM_BYPASS_EXTRA_ACL_SETUP
|
||||
+#define BTM_BYPASS_EXTRA_ACL_SETUP TRUE
|
||||
+#endif
|
||||
|
||||
#include "bt_types.h" /* This must be defined AFTER buildcfg.h */
|
||||
|
||||
diff --git a/stack/btm/btm_acl.cc b/stack/btm/btm_acl.cc
|
||||
index dcb2fb4d9..5a6c3631e 100644
|
||||
--- a/stack/btm/btm_acl.cc
|
||||
+++ b/stack/btm/btm_acl.cc
|
||||
@@ -1186,17 +1186,17 @@ void btm_read_remote_ext_features_failed(uint8_t status, uint16_t handle) {
|
||||
void btm_establish_continue(tACL_CONN* p_acl_cb) {
|
||||
tBTM_BL_EVENT_DATA evt_data;
|
||||
BTM_TRACE_DEBUG("btm_establish_continue");
|
||||
-#if (BTM_BYPASS_EXTRA_ACL_SETUP == FALSE)
|
||||
- if (p_acl_cb->transport == BT_TRANSPORT_BR_EDR) {
|
||||
- /* For now there are a some devices that do not like sending */
|
||||
- /* commands events and data at the same time. */
|
||||
- /* Set the packet types to the default allowed by the device */
|
||||
- btm_set_packet_types(p_acl_cb, btm_cb.btm_acl_pkt_types_supported);
|
||||
-
|
||||
- if (btm_cb.btm_def_link_policy)
|
||||
- BTM_SetLinkPolicy(p_acl_cb->remote_addr, &btm_cb.btm_def_link_policy);
|
||||
+ if (!BTM_BYPASS_EXTRA_ACL_SETUP) {
|
||||
+ if (p_acl_cb->transport == BT_TRANSPORT_BR_EDR) {
|
||||
+ /* For now there are a some devices that do not like sending */
|
||||
+ /* commands events and data at the same time. */
|
||||
+ /* Set the packet types to the default allowed by the device */
|
||||
+ btm_set_packet_types(p_acl_cb, btm_cb.btm_acl_pkt_types_supported);
|
||||
+
|
||||
+ if (btm_cb.btm_def_link_policy)
|
||||
+ BTM_SetLinkPolicy(p_acl_cb->remote_addr, &btm_cb.btm_def_link_policy);
|
||||
+ }
|
||||
}
|
||||
-#endif
|
||||
if (p_acl_cb->link_up_issued) {
|
||||
BTM_TRACE_ERROR("%s: Already link is up ", __func__);
|
||||
return;
|
||||
diff --git a/stack/btm/btm_sec.cc b/stack/btm/btm_sec.cc
|
||||
index 4df0974dd..eb28b0a97 100644
|
||||
--- a/stack/btm/btm_sec.cc
|
||||
+++ b/stack/btm/btm_sec.cc
|
||||
@@ -4366,15 +4366,15 @@ void btm_sec_connected(const RawAddress& bda, uint16_t handle, uint8_t status,
|
||||
if (p_acl_cb) {
|
||||
/* whatever is in btm_establish_continue() without reporting the BTM_BL_CONN_EVT
|
||||
* event */
|
||||
-#if (BTM_BYPASS_EXTRA_ACL_SETUP == FALSE)
|
||||
- /* For now there are a some devices that do not like sending */
|
||||
- /* commands events and data at the same time. */
|
||||
- /* Set the packet types to the default allowed by the device */
|
||||
- btm_set_packet_types(p_acl_cb, btm_cb.btm_acl_pkt_types_supported);
|
||||
-
|
||||
- if (btm_cb.btm_def_link_policy)
|
||||
- BTM_SetLinkPolicy(p_acl_cb->remote_addr, &btm_cb.btm_def_link_policy);
|
||||
-#endif
|
||||
+ if(!BTM_BYPASS_EXTRA_ACL_SETUP) {
|
||||
+ /* For now there are a some devices that do not like sending */
|
||||
+ /* commands events and data at the same time. */
|
||||
+ /* Set the packet types to the default allowed by the device */
|
||||
+ btm_set_packet_types(p_acl_cb, btm_cb.btm_acl_pkt_types_supported);
|
||||
+
|
||||
+ if (btm_cb.btm_def_link_policy)
|
||||
+ BTM_SetLinkPolicy(p_acl_cb->remote_addr, &btm_cb.btm_def_link_policy);
|
||||
+ }
|
||||
}
|
||||
btm_acl_created(bda, p_dev_rec->dev_class, p_dev_rec->sec_bd_name, handle,
|
||||
HCI_ROLE_SLAVE, BT_TRANSPORT_BR_EDR);
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,153 +0,0 @@
|
||||
From 9bc6c5d104edf78b5f795e17560ee4f8bb39a122 Mon Sep 17 00:00:00 2001
|
||||
From: penn5 <penn5@users.noreply.github.com>
|
||||
Date: Mon, 4 Mar 2019 22:21:07 +0000
|
||||
Subject: [PATCH 2/2] Add props to control supported features and states (#1)
|
||||
|
||||
* Add bitmask for supported fields
|
||||
Use persist.sys.bt.unsupport.states, defaults to 0, left-aligned.
|
||||
Huawei suggest to use 000000000000000000000011111
|
||||
|
||||
* Add bitmask to LOCAL_SUPPORTED_FEATURES
|
||||
For Huawei, suggest to use 00000001
|
||||
|
||||
Documentation:
|
||||
- persist.sys.bt.unsupport.features matches the values:
|
||||
HCI_3_SLOT_PACKETS..HCI_LMP_EXTENDED_SUPPORTED (max 8bits * 8 bytes =
|
||||
64 bits)
|
||||
- persist.sys.bt.unsupport.states matches the values:
|
||||
BTM_BLE_STATE_INVALID..BTM_BLE_STATE_SCAN_ADV (max = 0x3ff, 11 bits)
|
||||
- persist.sys.bt.unsupport.stdfeatures ( max: 16 bits)
|
||||
HCI_LE_ENCRYPTION..HCI_LE_PERIODIC_ADVERTISING
|
||||
---
|
||||
hci/src/hci_packet_parser.cc | 77 ++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 77 insertions(+)
|
||||
|
||||
diff --git a/hci/src/hci_packet_parser.cc b/hci/src/hci_packet_parser.cc
|
||||
index b1efd444d..88dc4c6cd 100644
|
||||
--- a/hci/src/hci_packet_parser.cc
|
||||
+++ b/hci/src/hci_packet_parser.cc
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "hcimsgs.h"
|
||||
#include "osi/include/log.h"
|
||||
|
||||
+#include <cutils/properties.h>
|
||||
+
|
||||
static const command_opcode_t NO_OPCODE_CHECKING = 0;
|
||||
|
||||
static const allocator_t* buffer_allocator;
|
||||
@@ -108,6 +110,31 @@ static void parse_read_local_supported_commands_response(
|
||||
buffer_allocator->free(response);
|
||||
}
|
||||
|
||||
+static void setup_bitmask(uint8_t *v, const char* property) {
|
||||
+ char str[PROPERTY_VALUE_MAX];
|
||||
+ int len = property_get(property, str, "");
|
||||
+ memset(v, 255, 8);
|
||||
+ for(int i = 0; i<len; i++) {
|
||||
+ if(str[i] == '1') {
|
||||
+ v[i/8] &= ~(1 << (i%8));
|
||||
+ } else if(str[i] != '0') {
|
||||
+ LOG_ERROR(LOG_TAG, "invalid characters in bitmask; skipping %c", str[i]);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void filter_supported_feature(uint8_t *v) {
|
||||
+ static int setup = 0;
|
||||
+ static uint8_t unsupport_bitmask[8];
|
||||
+ if(!setup) {
|
||||
+ setup = 1;
|
||||
+ setup_bitmask(unsupport_bitmask, "persist.sys.bt.unsupport.features");
|
||||
+ }
|
||||
+
|
||||
+ for(unsigned i=0; i<sizeof(bt_device_features_t); i++)
|
||||
+ v[i] &= unsupport_bitmask[i];
|
||||
+}
|
||||
+
|
||||
static void parse_read_local_extended_features_response(
|
||||
BT_HDR* response, uint8_t* page_number_ptr, uint8_t* max_page_number_ptr,
|
||||
bt_device_features_t* feature_pages, size_t feature_pages_count) {
|
||||
@@ -123,6 +150,16 @@ static void parse_read_local_extended_features_response(
|
||||
STREAM_TO_ARRAY(feature_pages[*page_number_ptr].as_array, stream,
|
||||
(int)sizeof(bt_device_features_t));
|
||||
|
||||
+ for (int i = 0; i < ((int)sizeof(bt_device_features_t)); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "supported feature 0x%x is 0x%x", i, feature_pages[*page_number_ptr].as_array[i]);
|
||||
+
|
||||
+ filter_supported_feature(feature_pages[*page_number_ptr].as_array);
|
||||
+
|
||||
+ for (int i = 0; i < ((int)sizeof(bt_device_features_t)); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "post-filtering supported feature 0x%x is 0x%x", i, feature_pages[*page_number_ptr].as_array[i]);
|
||||
+
|
||||
+ LOG_DEBUG(LOG_TAG, "supported_features array done");
|
||||
+
|
||||
buffer_allocator->free(response);
|
||||
}
|
||||
|
||||
@@ -148,6 +185,19 @@ static void parse_ble_read_buffer_size_response(BT_HDR* response,
|
||||
buffer_allocator->free(response);
|
||||
}
|
||||
|
||||
+
|
||||
+static void filter_supported_states(uint8_t *v, int size) {
|
||||
+ static int setup = 0;
|
||||
+ static uint8_t unsupport_bitmask[8];
|
||||
+ if(!setup) {
|
||||
+ setup = 1;
|
||||
+ setup_bitmask(unsupport_bitmask, "persist.sys.bt.unsupport.states");
|
||||
+ }
|
||||
+
|
||||
+ for(int i=0; i<size && i<8; i++)
|
||||
+ v[i] &= unsupport_bitmask[i];
|
||||
+}
|
||||
+
|
||||
static void parse_ble_read_supported_states_response(
|
||||
BT_HDR* response, uint8_t* supported_states, size_t supported_states_size) {
|
||||
uint8_t* stream =
|
||||
@@ -156,9 +206,30 @@ static void parse_ble_read_supported_states_response(
|
||||
CHECK(stream != NULL);
|
||||
STREAM_TO_ARRAY(supported_states, stream, (int)supported_states_size);
|
||||
|
||||
+ for (int i = 0; i < ((int)supported_states_size); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "supported state 0x%x is 0x%x", i, supported_states[i]);
|
||||
+
|
||||
+ filter_supported_states(supported_states, supported_states_size);
|
||||
+
|
||||
+ for (int i = 0; i < ((int)supported_states_size); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "supported.2 state 0x%x is 0x%x", i, supported_states[i]);
|
||||
+
|
||||
+ LOG_DEBUG(LOG_TAG, "supported_states array done");
|
||||
buffer_allocator->free(response);
|
||||
}
|
||||
|
||||
+static void filter_supported_stdfeatures(uint8_t *v) {
|
||||
+ static int setup = 0;
|
||||
+ static uint8_t unsupport_bitmask[8];
|
||||
+ if(!setup) {
|
||||
+ setup = 1;
|
||||
+ setup_bitmask(unsupport_bitmask, "persist.sys.bt.unsupport.stdfeatures");
|
||||
+ }
|
||||
+
|
||||
+ for(unsigned i=0; i<sizeof(bt_device_features_t); i++)
|
||||
+ v[i] &= unsupport_bitmask[i];
|
||||
+}
|
||||
+
|
||||
static void parse_ble_read_local_supported_features_response(
|
||||
BT_HDR* response, bt_device_features_t* supported_features) {
|
||||
uint8_t* stream = read_command_complete_header(
|
||||
@@ -168,6 +239,12 @@ static void parse_ble_read_local_supported_features_response(
|
||||
STREAM_TO_ARRAY(supported_features->as_array, stream,
|
||||
(int)sizeof(bt_device_features_t));
|
||||
|
||||
+ for (int i = 0; i < ((int)sizeof(bt_device_features_t)); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "supported state 0x%x is 0x%x", i, supported_features->as_array[i]);
|
||||
+ filter_supported_stdfeatures(supported_features->as_array);
|
||||
+ for (int i = 0; i < ((int)sizeof(bt_device_features_t)); i++)
|
||||
+ LOG_DEBUG(LOG_TAG, "supported.2 state 0x%x is 0x%x", i, supported_features->as_array[i]);
|
||||
+
|
||||
buffer_allocator->free(response);
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 452c6e9529d5c66857853de368d1770b743d7678 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 10 Dec 2017 00:26:21 +0100
|
||||
Subject: [PATCH 01/12] Revert "logd: add "+passcred" for logdw socket"
|
||||
|
||||
This reverts commit 54d8ff1121440d0ef4565ce0ab3751f82fdb393c.
|
||||
|
||||
Android 8.0 init doesn't understand this new syntax
|
||||
---
|
||||
logd/LogListener.cpp | 10 +++++-----
|
||||
logd/logd.rc | 2 +-
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
|
||||
index 2f227788c..240127e2d 100644
|
||||
--- a/logd/LogListener.cpp
|
||||
+++ b/logd/LogListener.cpp
|
||||
@@ -149,14 +149,14 @@ int LogListener::getLogSocket() {
|
||||
static const char socketName[] = "logdw";
|
||||
int sock = android_get_control_socket(socketName);
|
||||
|
||||
- if (sock < 0) { // logd started up in init.sh
|
||||
+ if (sock < 0) {
|
||||
sock = socket_local_server(
|
||||
socketName, ANDROID_SOCKET_NAMESPACE_RESERVED, SOCK_DGRAM);
|
||||
+ }
|
||||
|
||||
- int on = 1;
|
||||
- if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on))) {
|
||||
- return -1;
|
||||
- }
|
||||
+ int on = 1;
|
||||
+ if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
|
||||
+ return -1;
|
||||
}
|
||||
return sock;
|
||||
}
|
||||
diff --git a/logd/logd.rc b/logd/logd.rc
|
||||
index 438419ad6..5514e9456 100644
|
||||
--- a/logd/logd.rc
|
||||
+++ b/logd/logd.rc
|
||||
@@ -1,7 +1,7 @@
|
||||
service logd /system/bin/logd
|
||||
socket logd stream 0666 logd logd
|
||||
socket logdr seqpacket 0666 logd logd
|
||||
- socket logdw dgram+passcred 0222 logd logd
|
||||
+ socket logdw dgram 0222 logd logd
|
||||
file /proc/kmsg r
|
||||
file /dev/kmsg w
|
||||
user logd
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 84efb8f43e2be2b7ab3c5a04956199b7f8683556 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 19:33:03 +0200
|
||||
Subject: [PATCH 02/12] Some kernel crashes when using too recent sdcardfs
|
||||
options. Force everyone to old options
|
||||
|
||||
Change-Id: Ia5cf1aa8dc07a0f4a78b4d8f760ca0944dabaa89
|
||||
---
|
||||
sdcard/sdcard.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp
|
||||
index 2b358197a..4420ebbd2 100644
|
||||
--- a/sdcard/sdcard.cpp
|
||||
+++ b/sdcard/sdcard.cpp
|
||||
@@ -110,7 +110,8 @@ static bool sdcardfs_setup(const std::string& source_path, const std::string& de
|
||||
if (unshared_obb) new_opts_list.push_back("unshared_obb,");
|
||||
// Try several attempts, each time with one less option, to gracefully
|
||||
// handle older kernels that aren't updated yet.
|
||||
- for (int i = 0; i <= new_opts_list.size(); ++i) {
|
||||
+ int first_option_to_try = property_get_bool("persist.sys.phh.modern_sdcard", false) ? 0 : 2;
|
||||
+ for (int i = first_option_to_try; i <= new_opts_list.size(); ++i) {
|
||||
std::string new_opts;
|
||||
for (int j = 0; j < new_opts_list.size() - i; ++j) {
|
||||
new_opts += new_opts_list[j];
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 51f63fdc8fa7144cb2bee8e5a8f8fef6db7a0447 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Tue, 14 Aug 2018 19:33:23 +0200
|
||||
Subject: [PATCH 03/12] First drop_privs (which may fail) and only run thread
|
||||
that might be scheduled before us
|
||||
|
||||
Change-Id: I118fb2d4beedbeecf5d3a8d255929d3be480b923
|
||||
---
|
||||
logd/main.cpp | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/logd/main.cpp b/logd/main.cpp
|
||||
index fd3cdf877..4057347b8 100644
|
||||
--- a/logd/main.cpp
|
||||
+++ b/logd/main.cpp
|
||||
@@ -440,6 +440,12 @@ int main(int argc, char* argv[]) {
|
||||
if (fdPmesg < 0) android::prdebug("Failed to open %s\n", proc_kmsg);
|
||||
}
|
||||
|
||||
+ bool auditd =
|
||||
+ __android_logger_property_get_bool("ro.logd.auditd", BOOL_DEFAULT_TRUE);
|
||||
+ if (drop_privs(klogd, auditd) != 0) {
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
// Reinit Thread
|
||||
sem_init(&reinit, 0, 0);
|
||||
sem_init(&uidName, 0, 0);
|
||||
@@ -461,12 +467,6 @@ int main(int argc, char* argv[]) {
|
||||
pthread_attr_destroy(&attr);
|
||||
}
|
||||
|
||||
- bool auditd =
|
||||
- __android_logger_property_get_bool("ro.logd.auditd", BOOL_DEFAULT_TRUE);
|
||||
- if (drop_privs(klogd, auditd) != 0) {
|
||||
- return EXIT_FAILURE;
|
||||
- }
|
||||
-
|
||||
// Serves the purpose of managing the last logs times read on a
|
||||
// socket connection, and as a reader lock on a range of log
|
||||
// entries.
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 9d1ea37580d14cc71170595ec0c73fc04a99243a Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 2 Jan 2019 17:17:20 +0100
|
||||
Subject: [PATCH 04/12] Ignore /proc/kmsg if reading from it faults
|
||||
|
||||
On some devices, (The only known one is Y6 2018), reading from
|
||||
/proc/kmsg fails, with a status EFAULT
|
||||
This isn't just from logd, a simple cat /proc/kmsg does that as well.
|
||||
|
||||
Simply stop reading logs from kernel in that case
|
||||
|
||||
Change-Id: I4b902b7ec36107c722e2f5cc5dbb7964734bb71d
|
||||
---
|
||||
logd/LogKlog.cpp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/logd/LogKlog.cpp b/logd/LogKlog.cpp
|
||||
index edd326aec..8ff719f6e 100644
|
||||
--- a/logd/LogKlog.cpp
|
||||
+++ b/logd/LogKlog.cpp
|
||||
@@ -238,6 +238,9 @@ bool LogKlog::onDataAvailable(SocketClient* cli) {
|
||||
break;
|
||||
}
|
||||
if (retval < 0) {
|
||||
+ if(errno == EFAULT) {
|
||||
+ stopListener();
|
||||
+ }
|
||||
return false;
|
||||
}
|
||||
len += retval;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 6892df4432eb01985e64368643708d68a6c8ac50 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Wed, 4 Sep 2019 21:11:48 +0200
|
||||
Subject: [PATCH 05/12] Panic into recovery rather than bootloader
|
||||
|
||||
Getting last_kmsg/pstore from bootloader isn't possible for other people
|
||||
than the OEM, but we have TWRP to access last_kmsg/pstore
|
||||
|
||||
Change-Id: If04bb6572dc66677d7b44f7d302b2d69ce526200
|
||||
---
|
||||
init/reboot_utils.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp
|
||||
index d1a712f2e..e79b634e8 100644
|
||||
--- a/init/reboot_utils.cpp
|
||||
+++ b/init/reboot_utils.cpp
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace android {
|
||||
namespace init {
|
||||
|
||||
-static std::string init_fatal_reboot_target = "bootloader";
|
||||
+static std::string init_fatal_reboot_target = "recovery";
|
||||
|
||||
void SetFatalRebootTarget() {
|
||||
std::string cmdline;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 51a0a2ece994b4a5feddf1f080c51ff57028b2c9 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Fri, 6 Sep 2019 15:09:45 +0200
|
||||
Subject: [PATCH 06/12] HACK XXX Never check adb key
|
||||
|
||||
Change-Id: Ic933023724c80f4a30725bb23de03fba9c5fbd12
|
||||
---
|
||||
adb/daemon/main.cpp | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
|
||||
index e5a49171b..90fefc901 100644
|
||||
--- a/adb/daemon/main.cpp
|
||||
+++ b/adb/daemon/main.cpp
|
||||
@@ -205,6 +205,7 @@ int adbd_main(int server_port) {
|
||||
// descriptor will always be open.
|
||||
adbd_cloexec_auth_socket();
|
||||
|
||||
+#if 0
|
||||
#if defined(ALLOW_ADBD_NO_AUTH)
|
||||
// If ro.adb.secure is unset, default to no authentication required.
|
||||
auth_required = android::base::GetBoolProperty("ro.adb.secure", false);
|
||||
@@ -213,6 +214,8 @@ int adbd_main(int server_port) {
|
||||
auth_required = android::base::GetBoolProperty("ro.adb.secure", false);
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
+ auth_required = false;
|
||||
|
||||
adbd_auth_init();
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user