Sync up to v208

This commit is contained in:
Andy CrossGate Yan 2019-12-24 16:11:20 +00:00
parent 41747f8022
commit 4af677c28b
13 changed files with 912 additions and 68 deletions

View File

@ -1,4 +1,4 @@
From 5529a224373874a11d77fd31e25428cc10fbc1a4 Mon Sep 17 00:00:00 2001
From effea609cca3fbf28c4d58b32008053ffc69971a 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
@ -10,13 +10,13 @@ Change-Id: If1ccbedde92955bb86f4c6db6d68502784de1d8d
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 7e2e56c4c..daa23ddbd 100644
index 610301841..45266c5f1 100644
--- a/core/tasks/check_boot_jars/package_whitelist.txt
+++ b/core/tasks/check_boot_jars/package_whitelist.txt
@@ -247,3 +247,6 @@ org\.chromium\.arc\..*
# LineageOS
lineageos\.platform
org\.lineageos\.platform\.internal
@@ -258,3 +258,6 @@ org\.codeaurora\.internal.*
###################################################
# IFAA Manager used for Alipay and/or WeChat payment
org\.ifaa\.android\.manager.*
+
+vendor\.samsung\.hardware\.radio\.V1_2
+vendor\.mediatek\.hardware\.radio\.V2_0

View File

@ -1,8 +1,8 @@
From 92aac43c368e3123ac419ad2c293de3abf0f0b3b Mon Sep 17 00:00:00 2001
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 11/11] Add (partial, cam id is hardcoded) support for Asus ZF6
motor camera
Subject: [PATCH] Add (partial, cam id is hardcoded) support for Asus ZF6 motor
camera
Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
---
@ -11,7 +11,7 @@ Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe
2 files changed, 29 insertions(+)
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index d208a36a9..37752becd 100644
index 62cbc7ddb..ddddfda97 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -25,6 +25,7 @@
@ -22,7 +22,7 @@ index d208a36a9..37752becd 100644
#include <inttypes.h>
#include <pthread.h>
@@ -128,6 +129,7 @@ Mutex CameraService::sProxyMutex;
@@ -131,6 +132,7 @@ Mutex CameraService::sProxyMutex;
sp<hardware::ICameraServiceProxy> CameraService::sCameraServiceProxy;
CameraService::CameraService() :
@ -30,15 +30,15 @@ index d208a36a9..37752becd 100644
mEventLog(DEFAULT_EVENT_LOG_LENGTH),
mNumberOfCameras(0),
mSoundRef(0), mInitialized(false) {
@@ -1538,6 +1540,7 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
@@ -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);
}
} // lock is destroyed, allow further connect calls
@@ -1548,6 +1551,27 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
sp<ICameraMotor> cameraMotor = ICameraMotor::getService();
@@ -1564,6 +1567,27 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8&
return ret;
}
@ -66,9 +66,9 @@ index d208a36a9..37752becd 100644
Status CameraService::setTorchMode(const String16& cameraId, bool enabled,
const sp<IBinder>& clientBinder) {
Mutex::Autolock lock(mServiceLock);
@@ -2405,6 +2429,8 @@ binder::Status CameraService::BasicClient::disconnect() {
@@ -2427,6 +2451,8 @@ binder::Status CameraService::BasicClient::disconnect() {
cameraMotor->onDisconnect(mCameraIdStr.string());
}
mDisconnected = true;
+ sCameraService->physicalFrontCam(false);
+

View File

@ -0,0 +1,38 @@
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

View File

@ -0,0 +1,475 @@
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

View File

@ -0,0 +1,46 @@
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

View File

@ -0,0 +1,90 @@
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

View File

@ -0,0 +1,117 @@
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

View File

@ -0,0 +1,59 @@
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

View File

@ -1,7 +1,7 @@
From 60d9333099db6587acd48b896d37e9e949fa95dc Mon Sep 17 00:00:00 2001
From 23e23d28af5ef1029c223fb617f19cc6b3a3ce08 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
Subject: [PATCH] Add route to gateway on null netmask
Galaxy S9 returns empty prefix
@ -11,18 +11,18 @@ Change-Id: I8133da8e8f5203666684100009ba658528a02e94
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
index 1202ce875..dcb72d4d7 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;
@@ -25,6 +25,7 @@ import android.app.PendingIntent;
import android.content.Context;
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 {
@@ -1403,6 +1404,22 @@ public class DataConnection extends StateMachine {
}
for (InetAddress gateway : response.getGatewayAddresses()) {

View File

@ -1,7 +1,7 @@
From 014a893a2872fb067c83a866d39ef1c4da70aaff Mon Sep 17 00:00:00 2001
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 1/3] Telephony: Support muting by RIL command
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
@ -10,11 +10,11 @@ Let's handle these odd cases too when it's necessary.
Change-Id: Id916dec2574d6e57b6f809fbaf2b0959c0cc7256
---
src/com/android/services/telephony/TelephonyConnection.java | 5 +++++
1 file changed, 5 insertions(+)
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 7bb6b7d55..18e078fe3 100644
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;
@ -25,12 +25,11 @@ index 7bb6b7d55..18e078fe3 100644
import android.telecom.CallAudioState;
import android.telecom.ConferenceParticipant;
import android.telecom.Connection;
@@ -736,6 +737,10 @@ abstract class TelephonyConnection extends Connection implements Holdable {
// TODO: update TTY mode.
if (getPhone() != null) {
getPhone().setEchoSuppressionEnabled();
+
+ if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) {
@@ -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());
+ }
}

View File

@ -1,29 +1,28 @@
From e109f7d80980e4a24a57c0ffcacfece96b8b9b9e Mon Sep 17 00:00:00 2001
From b99650956dc7943e965a0413bfb3b5f01d182e40 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 14 Sep 2019 22:49:31 +0200
Subject: [PATCH 11/12] Use a vndk-lite friendly ld config
Subject: [PATCH] Use a vndk-lite friendly ld config
Change-Id: I5b1e49fc534e6625ebdb6e183466e73b5c49e175
---
rootdir/etc/ld.config.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
rootdir/etc/ld.config.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt
index 84b308d0e..f59a01520 100644
index c95f60fb0..50c153f4a 100644
--- a/rootdir/etc/ld.config.txt
+++ b/rootdir/etc/ld.config.txt
@@ -423,11 +423,11 @@ namespace.default.asan.permitted.paths += /odm
namespace.default.asan.permitted.paths += /data/asan/vendor
namespace.default.asan.permitted.paths += /vendor
@@ -428,11 +428,11 @@ namespace.default.asan.permitted.paths += /vendor
-namespace.default.links = system,vndk%VNDK_IN_SYSTEM_NS%
+namespace.default.links = system,vndk%VNDK_IN_SYSTEM_NS%,runtime
namespace.default.link.system.shared_libs = %LLNDK_LIBRARIES%
namespace.default.links = system,vndk%VNDK_IN_SYSTEM_NS%,runtime
namespace.default.link.runtime.shared_libs = %SANITIZER_RUNTIME_LIBRARIES%
+namespace.default.link.runtime.shared_libs += libnativeloader.so
namespace.default.link.system.shared_libs = %LLNDK_LIBRARIES%
namespace.default.link.system.shared_libs += %SANITIZER_RUNTIME_LIBRARIES%
namespace.default.link.vndk_in_system.shared_libs = %VNDK_USING_CORE_VARIANT_LIBRARIES%
-namespace.default.link.vndk.shared_libs = %VNDK_SAMEPROCESS_LIBRARIES%
-namespace.default.link.vndk.shared_libs += %VNDK_CORE_LIBRARIES%
+namespace.default.link.vndk.allow_all_shared_libs = true
+namespace.default.link.runtime.shared_libs = libnativeloader.so
###############################################################################
# "runtime" APEX namespace

View File

@ -1,37 +1,24 @@
From 23af49628e60990b02ed9e45fabede1804b6e44b Mon Sep 17 00:00:00 2001
From 2f556132ce533719576348932dbabc20d377c194 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 11 Nov 2019 00:21:36 +0100
Subject: [PATCH] Allow our vndk to access libnativeloader
Subject: [PATCH 15/16] Allow our vndk to access libnativeloader
Also link the "runtime" namespace so this fix actually applies
Reference: https://github.com/phhusson/platform_system_core/commit/3bdd3cfab66b7b2553d00309797786b65489b852#diff-a7ab9e7752aa70dc82b8788445b8cab1R484
Change-Id: Ibe5c8e9d58287d7796dfd3343c05a1a7a0819ad6
---
rootdir/etc/ld.config.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
rootdir/etc/ld.config.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt
index 84b308d0e..c33d35962 100644
index 50c153f4a..b03d52e99 100644
--- a/rootdir/etc/ld.config.txt
+++ b/rootdir/etc/ld.config.txt
@@ -477,13 +477,15 @@ namespace.vndk.asan.search.paths += /system/${LIB}/vndk%VNDK_VER%
# Android releases. The links here should be identical to that of the
# 'vndk_in_system' namespace, except for the link between 'vndk' and
# 'vndk_in_system'.
-namespace.vndk.links = system,default%VNDK_IN_SYSTEM_NS%
+namespace.vndk.links = system,default%VNDK_IN_SYSTEM_NS%,runtime
namespace.vndk.link.system.shared_libs = %LLNDK_LIBRARIES%
namespace.vndk.link.system.shared_libs += %SANITIZER_RUNTIME_LIBRARIES%
@@ -490,6 +490,7 @@ namespace.vndk.link.system.shared_libs += %SANITIZER_RUNTIME_LIBRARIES%
namespace.vndk.link.default.allow_all_shared_libs = true
+namespace.vndk.link.runtime.shared_libs = libnativeloader.so
+
namespace.vndk.link.runtime.shared_libs = %SANITIZER_RUNTIME_LIBRARIES%
+namespace.vndk.link.runtime.shared_libs += libnativeloader.so
namespace.vndk.link.vndk_in_system.shared_libs = %VNDK_USING_CORE_VARIANT_LIBRARIES%
###############################################################################
--
2.17.1

View File

@ -0,0 +1,34 @@
From 1d7724b6731f8f430b993fd92f34924597c7fed6 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 5 Dec 2019 16:01:26 +0100
Subject: [PATCH 16/16] Revert "HACK XXX Never check adb key"
This reverts commit 52e211961f89e2b83bad61a4c017697214e80f01.
---
adb/daemon/main.cpp | 3 ---
1 file changed, 3 deletions(-)
diff --git a/adb/daemon/main.cpp b/adb/daemon/main.cpp
index 90fefc901..e5a49171b 100644
--- a/adb/daemon/main.cpp
+++ b/adb/daemon/main.cpp
@@ -205,7 +205,6 @@ 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);
@@ -214,8 +213,6 @@ 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