Initial commit, syncing up to v115
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
From e3f08c02ab7d0bc5d0efcc9eb3ad98d9a3a98e32 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/31] Fix backlight control on Galaxy S9(+)
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/lights/LightsService.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
|
||||
index a94ed608b9c..762b0ae4037 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.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
+import android.os.SystemProperties;
|
||||
import android.os.Trace;
|
||||
import android.provider.Settings;
|
||||
import android.util.Slog;
|
||||
@@ -52,6 +53,12 @@ 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;
|
||||
+ }
|
||||
+
|
||||
int color = brightness & 0x000000ff;
|
||||
color = 0xff000000 | (color << 16) | (color << 8) | color;
|
||||
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 02189ad3927cb5a76cfc61e1a1ddcc254f649efe 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/31] 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 fa9f44557d3..1d3bf73eebb 100644
|
||||
--- a/core/jni/android_util_AssetManager.cpp
|
||||
+++ b/core/jni/android_util_AssetManager.cpp
|
||||
@@ -149,7 +149,7 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) {
|
||||
}
|
||||
|
||||
// Generic idmap parameters
|
||||
- const char* argv[8];
|
||||
+ const char* argv[9];
|
||||
int argc = 0;
|
||||
struct stat st;
|
||||
|
||||
@@ -179,6 +179,10 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) {
|
||||
argv[argc++] = AssetManager::PRODUCT_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 c5904e0e9e5..6548215772a 100644
|
||||
--- a/core/jni/fd_utils.cpp
|
||||
+++ b/core/jni/fd_utils.cpp
|
||||
@@ -93,7 +93,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
|
||||
|| android::base::StartsWith(path, kOverlaySubdir)
|
||||
|| android::base::StartsWith(path, kVendorOverlayDir)
|
||||
|| android::base::StartsWith(path, kSystemProductOverlayDir)
|
||||
- || android::base::StartsWith(path, kProductOverlayDir))
|
||||
+ || android::base::StartsWith(path, kProductOverlayDir)
|
||||
+ || android::base::StartsWith(path, "/system/overlay"))
|
||||
&& android::base::EndsWith(path, kApkSuffix)
|
||||
&& path.find("/../") == std::string::npos) {
|
||||
return true;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 3add0283fffb44feaee5251f76f985895f67adfe 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] 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 53b9e913959..fcfb45659e5 100644
|
||||
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
||||
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
@@ -52,8 +52,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!");
|
||||
}
|
||||
mParameter = AudioSystem.getParameters("audio_capability#irda_support");
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
28
patches/platform_frameworks_base/0005-Fix-62.patch
Normal file
28
patches/platform_frameworks_base/0005-Fix-62.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 103cb5d951a8f0bddf37d195aae16ed6761628c6 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/31] 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 8b48130297e..c704269c351 100644
|
||||
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
||||
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
||||
@@ -899,7 +899,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
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 28861679c6a9a4e89ea82e6b27c6092b5c49ce5c 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/31] S9 brightness override only for screen
|
||||
|
||||
---
|
||||
.../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 762b0ae4037..eb25943fa6b 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -53,11 +53,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
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From b5722e3a8dcf58269bf681c991839d3a710dc8c2 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/31] [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 eb25943fa6b..a77af445ba6 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -59,6 +59,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
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 93cce81e547a60374bceae91731f6e00f963f914 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/31] 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 a77af445ba6..4dc44de37cd 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -62,9 +62,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
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 10426a980185c4e9a73130c08ecfe22a9d83b0b6 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/31] 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
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 2965fa2adb9cbd2ae3688097d9cf12aa73164379 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/31] 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
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 9e13de340e0d3a2a755f382ea3410ac488461236 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/31] 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 4dc44de37cd..2886f2900d9 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -55,7 +55,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
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 362f97b36ce15e8196caeff6c3e12f2e66e72c66 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/31] [Galaxy S9] "remaining" of HAL onEnroll is actually a
|
||||
percent of progress
|
||||
|
||||
---
|
||||
.../com/android/server/fingerprint/FingerprintService.java | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
index 06329e571b4..6f09433c002 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
@@ -1046,7 +1046,11 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
- handleEnrollResult(deviceId, fingerId, groupId, 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;
|
||||
+ handleEnrollResult(deviceId, fingerId, groupId, remaining2);
|
||||
}
|
||||
});
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
From 0327a2f5a82818ed894ccd35720e0dfc60b586a3 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/31] 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 8487cb3e15d..83ab7776e12 100644
|
||||
--- a/telephony/java/android/telephony/CarrierConfigManager.java
|
||||
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
|
||||
@@ -2146,7 +2146,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_SHOW_ONSCREEN_DIAL_BUTTON_BOOL, true);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
From 6fbb0fb1f4215e15531924b36e217710a7cb39e2 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 6 Aug 2018 20:01:44 +0200
|
||||
Subject: [PATCH 14/31] Change SignalStrentgh to change behaviour based on
|
||||
property
|
||||
|
||||
Change-Id: I940ed724047567ec5195ac93ea04574c3d92f70b
|
||||
---
|
||||
.../android/telephony/SignalStrength.java | 39 +++++++++++++------
|
||||
1 file changed, 27 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
|
||||
index 4e5639683a7..ff906d330d4 100644
|
||||
--- a/telephony/java/android/telephony/SignalStrength.java
|
||||
+++ b/telephony/java/android/telephony/SignalStrength.java
|
||||
@@ -854,6 +854,7 @@ public class SignalStrength implements Parcelable {
|
||||
* RSRQ = quality of signal dB = Number of Resource blocks*RSRP/RSSI
|
||||
* SNR = gain = signal/noise ratio = -10log P1/P2 dB
|
||||
*/
|
||||
+ String method = android.os.SystemProperties.get("persist.sys.signal.level", "default");
|
||||
int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1;
|
||||
|
||||
if (mLteRsrp > MAX_LTE_RSRP || mLteRsrp < MIN_LTE_RSRP) {
|
||||
@@ -897,6 +898,32 @@ public class SignalStrength implements Parcelable {
|
||||
+ rsrpIconLevel + " snrIconLevel:" + snrIconLevel
|
||||
+ " lteRsrpBoost:" + mLteRsrpBoost);
|
||||
|
||||
+ /* Valid values are (0-63, 99) as defined in TS 36.331 */
|
||||
+ // TODO the range here is probably supposed to be (0..31, 99). It's unclear if anyone relies
|
||||
+ // on the current incorrect range check, so this will be fixed in a future release with more
|
||||
+ // soak time
|
||||
+ if (mLteSignalStrength > 63) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
+ else if (mLteSignalStrength >= 12) rssiIconLevel = SIGNAL_STRENGTH_GREAT;
|
||||
+ else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD;
|
||||
+ else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE;
|
||||
+ else if (mLteSignalStrength >= 0) rssiIconLevel = SIGNAL_STRENGTH_POOR;
|
||||
+
|
||||
+ if (DBG) log("getLTELevel - rssi:" + mLteSignalStrength + " rssiIconLevel:"
|
||||
+ + rssiIconLevel);
|
||||
+
|
||||
+ if("rsrp".equals(method)) {
|
||||
+ if(rsrpIconLevel == -1) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
+ return rsrpIconLevel;
|
||||
+ }
|
||||
+ if("rssnr".equals(method)) {
|
||||
+ if(snrIconLevel == -1) snrIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
+ return snrIconLevel;
|
||||
+ }
|
||||
+ if("rssi".equals(method)) {
|
||||
+ if(rssiIconLevel == -1) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
+ return rssiIconLevel;
|
||||
+ }
|
||||
+
|
||||
/* Choose a measurement type to use for notification */
|
||||
if (snrIconLevel != -1 && rsrpIconLevel != -1) {
|
||||
/*
|
||||
@@ -911,18 +938,6 @@ public class SignalStrength implements Parcelable {
|
||||
|
||||
if (rsrpIconLevel != -1) return rsrpIconLevel;
|
||||
|
||||
- /* Valid values are (0-63, 99) as defined in TS 36.331 */
|
||||
- // TODO the range here is probably supposed to be (0..31, 99). It's unclear if anyone relies
|
||||
- // on the current incorrect range check, so this will be fixed in a future release with more
|
||||
- // soak time
|
||||
- if (mLteSignalStrength > 63) rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
- else if (mLteSignalStrength >= 12) rssiIconLevel = SIGNAL_STRENGTH_GREAT;
|
||||
- else if (mLteSignalStrength >= 8) rssiIconLevel = SIGNAL_STRENGTH_GOOD;
|
||||
- else if (mLteSignalStrength >= 5) rssiIconLevel = SIGNAL_STRENGTH_MODERATE;
|
||||
- else if (mLteSignalStrength >= 0) rssiIconLevel = SIGNAL_STRENGTH_POOR;
|
||||
-
|
||||
- if (DBG) log("getLteLevel - rssi:" + mLteSignalStrength + " rssiIconLevel:"
|
||||
- + rssiIconLevel);
|
||||
return rssiIconLevel;
|
||||
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From fd9fd2e3c375308730c9de9319b01aa00383df2c 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 15/31] 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
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 49e0279b8336c231788a44d97dc598224f87ead8 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 19 Aug 2018 10:57:21 +0200
|
||||
Subject: [PATCH 16/31] Move SysuiDarkThemeOverlay to /system
|
||||
|
||||
Change-Id: I31b3edc5d1abcc1163a13e63c909fee9d27ff432
|
||||
---
|
||||
packages/overlays/SysuiDarkThemeOverlay/Android.mk | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/packages/overlays/SysuiDarkThemeOverlay/Android.mk b/packages/overlays/SysuiDarkThemeOverlay/Android.mk
|
||||
index 7b277bcf035..89cfcf819c2 100644
|
||||
--- a/packages/overlays/SysuiDarkThemeOverlay/Android.mk
|
||||
+++ b/packages/overlays/SysuiDarkThemeOverlay/Android.mk
|
||||
@@ -11,4 +11,5 @@ LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
|
||||
LOCAL_PACKAGE_NAME := SysuiDarkThemeOverlay
|
||||
LOCAL_SDK_VERSION := current
|
||||
|
||||
-include $(BUILD_RRO_PACKAGE)
|
||||
+LOCAL_IS_RUNTIME_RESOURCE_OVERLAY := true
|
||||
+include $(BUILD_PACKAGE)
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 3ddb2daf5dc7ea8f6c14407b29db9b8ac3785d43 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kondik <steve@cyngn.com>
|
||||
Date: Sat, 3 Jan 2015 05:13:26 -0800
|
||||
Subject: [PATCH 18/31] 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 9b8584e055f..0620f2ecec0 100644
|
||||
--- a/services/core/java/com/android/server/power/PowerManagerService.java
|
||||
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
|
||||
@@ -1965,7 +1965,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
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From 6b4e5ef1cf72810d37a4fd649355be31d4ec86f9 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
|
||||
|
||||
---
|
||||
services/core/java/com/android/server/ConsumerIrService.java | 5 -----
|
||||
services/core/jni/com_android_server_ConsumerIrService.cpp | 2 +-
|
||||
2 files changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
index fcfb45659e5..3a6a8cba509 100644
|
||||
--- a/services/core/java/com/android/server/ConsumerIrService.java
|
||||
+++ b/services/core/java/com/android/server/ConsumerIrService.java
|
||||
@@ -48,11 +48,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!");
|
||||
- }
|
||||
- }
|
||||
mParameter = AudioSystem.getParameters("audio_capability#irda_support");
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From c4e45f5f94e47109a6f65b4ea07b25626efbba34 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 21/31] 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 2886f2900d9..2ad38774b9d 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -55,9 +55,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
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From aac8a05b691bff6cb9081ea76d8e5c6f1e4fe70d 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 22/31] 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 2ad38774b9d..89008ea3134 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -56,7 +56,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
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 491b9ace3db2e132949d7579ef5819f0f789a971 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 23/31] Add a property to override pre-o max aspect ratio
|
||||
|
||||
---
|
||||
.../core/java/com/android/server/am/ActivityRecord.java | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
|
||||
index 97ae3772ca3..5718c5ee8d0 100644
|
||||
--- a/services/core/java/com/android/server/am/ActivityRecord.java
|
||||
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
|
||||
@@ -161,6 +161,7 @@ import android.os.PersistableBundle;
|
||||
import android.os.Process;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
+import android.os.SystemProperties;
|
||||
import android.os.UserHandle;
|
||||
import android.os.storage.StorageManager;
|
||||
import android.service.voice.IVoiceInteractionSession;
|
||||
@@ -2354,7 +2355,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
|
||||
// TODO(b/36505427): Consider moving this method and similar ones to ConfigurationContainer.
|
||||
private void computeBounds(Rect outBounds) {
|
||||
outBounds.setEmpty();
|
||||
- final float maxAspectRatio = info.maxAspectRatio;
|
||||
+ float maxAspectRatio = info.maxAspectRatio;
|
||||
final ActivityStack stack = getStack();
|
||||
if (task == null || stack == null || task.inMultiWindowMode() || maxAspectRatio == 0
|
||||
|| isInVrUiMode(getConfiguration())) {
|
||||
@@ -2365,6 +2366,12 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
|
||||
return;
|
||||
}
|
||||
|
||||
+ 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);
|
||||
+ }
|
||||
// We must base this on the parent configuration, because we set our override
|
||||
// configuration's appBounds based on the result of this method. If we used our own
|
||||
// configuration, it would be influenced by past invocations.
|
||||
--
|
||||
2.17.1
|
||||
|
||||
26
patches/platform_frameworks_base/0024-Add-japanese-S9.patch
Normal file
26
patches/platform_frameworks_base/0024-Add-japanese-S9.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From 8d199eba0c2e55725d0677ff4c949e48737af7e9 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 24/31] 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 89008ea3134..47c1d9297fe 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -55,7 +55,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
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 0da5d5d1b6ced13bc25953f46db15ffd4ed839d3 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 25/31] 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 ab482bb2da9..c4a655d8447 100644
|
||||
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
||||
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
|
||||
@@ -708,6 +708,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()) {
|
||||
@@ -715,9 +718,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
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From e17a61b9abe4c8df29379b01f841c1be482bc9e7 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Sun, 9 Dec 2018 16:31:44 +0100
|
||||
Subject: [PATCH 26/31] Use Samsung fingerprint percent thingy on all Samsung
|
||||
devices
|
||||
|
||||
---
|
||||
.../java/com/android/server/fingerprint/FingerprintService.java | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
index 6f09433c002..8c2990b1999 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
@@ -1048,7 +1048,7 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
|
||||
public void run() {
|
||||
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")))
|
||||
+ if(fp != null && (fp.startsWith("samsung/")))
|
||||
remaining2 = 100 - remaining2;
|
||||
handleEnrollResult(deviceId, fingerId, groupId, remaining2);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 92d27ce6dc2a0b7c25ba154ed839a506cb7bbfa0 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 27/31] 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 47c1d9297fe..e5299e456f5 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -55,6 +55,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
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
From 97bb347025b15447834a6ada3779f9795098efbe 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] Initial support of in-display fingerprint sensor
|
||||
|
||||
Tested on Mi 9.
|
||||
Here are the list of things that are device-specific:
|
||||
- touchscreen control (possibly not needed for all devices)
|
||||
- how to get position and size of green circle?
|
||||
- fingerprint control (tell the fingerprint sensor the green circle is
|
||||
ready, and what is its brightness)
|
||||
---
|
||||
services/core/Android.bp | 1 +
|
||||
.../fingerprint/AuthenticationClient.java | 6 +
|
||||
.../server/fingerprint/EnrollClient.java | 9 +
|
||||
.../server/fingerprint/FacolaView.java | 192 ++++++++++++++++++
|
||||
4 files changed, 208 insertions(+)
|
||||
create mode 100644 services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
|
||||
diff --git a/services/core/Android.bp b/services/core/Android.bp
|
||||
index 48be3c4921c..ab3d941bd26 100644
|
||||
--- a/services/core/Android.bp
|
||||
+++ b/services/core/Android.bp
|
||||
@@ -45,6 +45,7 @@ java_library_static {
|
||||
"android.hardware.configstore-V1.0-java",
|
||||
"android.hardware.contexthub-V1.0-java",
|
||||
"vendor.lineage.trust-V1.0-java",
|
||||
+ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java",
|
||||
],
|
||||
}
|
||||
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/AuthenticationClient.java b/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
|
||||
index afd1a94bf50..f36ed9b38c6 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/AuthenticationClient.java
|
||||
@@ -54,6 +54,8 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
private final FingerprintManager mFingerprintManager;
|
||||
protected boolean mDialogDismissed;
|
||||
|
||||
+ private FacolaView mFacola;
|
||||
+
|
||||
// Receives events from SystemUI and handles them before forwarding them to FingerprintDialog
|
||||
protected IBiometricPromptReceiver mDialogReceiver = new IBiometricPromptReceiver.Stub() {
|
||||
@Override // binder call
|
||||
@@ -96,6 +98,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
mStatusBarService = statusBarService;
|
||||
mFingerprintManager = (FingerprintManager) getContext()
|
||||
.getSystemService(Context.FINGERPRINT_SERVICE);
|
||||
+ mFacola = new FacolaView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -233,6 +236,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
resetFailedAttempts();
|
||||
onStop();
|
||||
}
|
||||
+ if(result == true) mFacola.hide();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -246,6 +250,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
Slog.w(TAG, "start authentication: no fingerprint HAL!");
|
||||
return ERROR_ESRCH;
|
||||
}
|
||||
+ mFacola.show();
|
||||
onStart();
|
||||
try {
|
||||
final int result = daemon.authenticate(mOpId, getGroupId());
|
||||
@@ -279,6 +284,7 @@ public abstract class AuthenticationClient extends ClientMonitor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ mFacola.hide();
|
||||
onStop();
|
||||
IBiometricsFingerprint daemon = getFingerprintDaemon();
|
||||
if (daemon == null) {
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/EnrollClient.java b/services/core/java/com/android/server/fingerprint/EnrollClient.java
|
||||
index c9efcf2fd68..4ce4ba0cfc8 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/EnrollClient.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/EnrollClient.java
|
||||
@@ -29,10 +29,12 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
+
|
||||
/**
|
||||
* A class to keep track of the enrollment state for a given client.
|
||||
*/
|
||||
public abstract class EnrollClient extends ClientMonitor {
|
||||
+ private final FacolaView mFacola;
|
||||
private static final long MS_PER_SEC = 1000;
|
||||
private static final int ENROLLMENT_TIMEOUT_MS = 60 * 1000; // 1 minute
|
||||
private byte[] mCryptoToken;
|
||||
@@ -42,6 +44,7 @@ public abstract class EnrollClient extends ClientMonitor {
|
||||
boolean restricted, String owner) {
|
||||
super(context, halDeviceId, token, receiver, userId, groupId, restricted, owner);
|
||||
mCryptoToken = Arrays.copyOf(cryptoToken, cryptoToken.length);
|
||||
+ mFacola = new FacolaView(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,6 +72,7 @@ public abstract class EnrollClient extends ClientMonitor {
|
||||
MetricsLogger.action(getContext(), MetricsEvent.ACTION_FINGERPRINT_ENROLL);
|
||||
try {
|
||||
receiver.onEnrollResult(getHalDeviceId(), fpId, groupId, remaining);
|
||||
+ if(remaining == 0) mFacola.hide();
|
||||
return remaining == 0;
|
||||
} catch (RemoteException e) {
|
||||
Slog.w(TAG, "Failed to notify EnrollResult:", e);
|
||||
@@ -83,6 +87,10 @@ public abstract class EnrollClient extends ClientMonitor {
|
||||
Slog.w(TAG, "enroll: no fingerprint HAL!");
|
||||
return ERROR_ESRCH;
|
||||
}
|
||||
+ Slog.w(TAG, "Starting enroll");
|
||||
+
|
||||
+ mFacola.show();
|
||||
+
|
||||
final int timeout = (int) (ENROLLMENT_TIMEOUT_MS / MS_PER_SEC);
|
||||
try {
|
||||
final int result = daemon.enroll(mCryptoToken, getGroupId(), timeout);
|
||||
@@ -104,6 +112,7 @@ public abstract class EnrollClient extends ClientMonitor {
|
||||
Slog.w(TAG, "stopEnroll: already cancelled!");
|
||||
return 0;
|
||||
}
|
||||
+ mFacola.hide();
|
||||
IBiometricsFingerprint daemon = getFingerprintDaemon();
|
||||
if (daemon == null) {
|
||||
Slog.w(TAG, "stopEnrollment: no fingerprint HAL!");
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/FacolaView.java b/services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
new file mode 100644
|
||||
index 00000000000..ec336fe337c
|
||||
--- /dev/null
|
||||
+++ b/services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
@@ -0,0 +1,192 @@
|
||||
+/**
|
||||
+ * 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.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.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 WindowManager mWM;
|
||||
+ FacolaView(Context context) {
|
||||
+ super(context);
|
||||
+
|
||||
+ 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(",");
|
||||
+ if(size.length == 2 && location.length == 2) {
|
||||
+ 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() {
|
||||
+ 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;
|
||||
+ mWM.addView(this, mParams);
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ public void hide() {
|
||||
+ 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");
|
||||
+ mWM.removeView(this);
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
From 1f08e24e33895eb7f56ff5540e07fc0759872c23 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
|
||||
|
||||
---
|
||||
services/core/jni/Android.bp | 1 +
|
||||
...om_android_server_lights_LightsService.cpp | 27 +++++++++++++++++++
|
||||
2 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
|
||||
index 5fd9496a5f8..ba6bccc2806 100644
|
||||
--- a/services/core/jni/Android.bp
|
||||
+++ b/services/core/jni/Android.bp
|
||||
@@ -131,6 +131,7 @@ cc_defaults {
|
||||
"android.frameworks.schedulerservice@1.0",
|
||||
"android.frameworks.sensorservice@1.0",
|
||||
"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 01ddecaeff5..f42c49afaa6 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,9 +42,13 @@ 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;
|
||||
+
|
||||
class LightHal {
|
||||
private:
|
||||
static sp<ILight> sLight;
|
||||
+ static sp<ISecLight> sSecLight;
|
||||
static bool sLightInit;
|
||||
|
||||
LightHal() {}
|
||||
@@ -58,6 +64,7 @@ public:
|
||||
(sLight != nullptr && !sLight->ping().isOk())) {
|
||||
// will return the hal if it exists the first time.
|
||||
sLight = ILight::getService();
|
||||
+ sSecLight = ISecLight::getService();
|
||||
sLightInit = true;
|
||||
|
||||
if (sLight == nullptr) {
|
||||
@@ -67,9 +74,14 @@ public:
|
||||
|
||||
return sLight;
|
||||
}
|
||||
+
|
||||
+ static sp<ISecLight> getSecLight() {
|
||||
+ return sSecLight;
|
||||
+ }
|
||||
};
|
||||
|
||||
sp<ILight> LightHal::sLight = nullptr;
|
||||
+sp<ISecLight> LightHal::sSecLight = nullptr;
|
||||
bool LightHal::sLightInit = false;
|
||||
|
||||
static bool validate(jint light, jint flash, jint brightness) {
|
||||
@@ -183,6 +195,21 @@ static void setLight_native(
|
||||
}
|
||||
colorAlpha = (colorAlpha * brightnessLevel) / 0xFF;
|
||||
colorARGB = (colorAlpha << 24) + (colorARGB & 0x00FFFFFF);
|
||||
+ }
|
||||
+
|
||||
+ sp<ISecLight> secHal = LightHal::getSecLight();
|
||||
+
|
||||
+ 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);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From ab2af70136a6846a00cd6dab2a0fec3633921517 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 30/31] 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 e5299e456f5..cd709880e11 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -64,7 +64,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
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
From d5ce6564e36fe4291e42f091b322f23c346d1215 Mon Sep 17 00:00:00 2001
|
||||
From: Pierre-Hugues Husson <phh@phh.me>
|
||||
Date: Mon, 6 May 2019 23:16:43 +0200
|
||||
Subject: [PATCH 31/31] Delay brightness changes, so that dim adjusted
|
||||
|
||||
---
|
||||
.../server/fingerprint/FacolaView.java | 28 +++++++++++++++++--
|
||||
1 file changed, 25 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/FacolaView.java b/services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
index ec336fe337c..86f03360ad0 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/FacolaView.java
|
||||
@@ -29,6 +29,8 @@ import android.util.Slog;
|
||||
import android.view.WindowManager;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.view.Gravity;
|
||||
+import android.os.Handler;
|
||||
+import android.os.Looper;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
@@ -47,10 +49,15 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
private final static float UNTOUCHED_DIM = .1f;
|
||||
private final static float TOUCHED_DIM = .9f;
|
||||
|
||||
+ private final Handler mMainHandler;
|
||||
+ private boolean visible = false;
|
||||
+
|
||||
private final WindowManager mWM;
|
||||
FacolaView(Context context) {
|
||||
super(context);
|
||||
|
||||
+ mMainHandler = new Handler(Looper.getMainLooper());
|
||||
+
|
||||
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(",");
|
||||
if(size.length == 2 && location.length == 2) {
|
||||
@@ -89,8 +96,13 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
if(mInsideCircle) {
|
||||
try {
|
||||
int nitValue = 3;
|
||||
- if(mXiaomiFingerprint != null)
|
||||
- mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
+ if(mXiaomiFingerprint != null) {
|
||||
+ mMainHandler.postDelayed(() -> {
|
||||
+ try {
|
||||
+ mXiaomiFingerprint.extCmd(0xa, nitValue);
|
||||
+ } catch(Exception e) {}
|
||||
+ }, 60);
|
||||
+ }
|
||||
} catch(Exception e) {
|
||||
Slog.d("PHH-Enroll", "Failed calling xiaomi fp extcmd");
|
||||
}
|
||||
@@ -123,8 +135,15 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
invalidate();
|
||||
|
||||
if(!mInsideCircle) {
|
||||
- mParams.screenBrightness = .0f;
|
||||
mParams.dimAmount = UNTOUCHED_DIM;
|
||||
+ //Changing Dim is instant, changing brightness isn't.
|
||||
+ //Have a little pity of users' eyes and wait a bit
|
||||
+ mMainHandler.postDelayed(() -> {
|
||||
+ if(visible) {
|
||||
+ mParams.screenBrightness = .0f;
|
||||
+ mWM.updateViewLayout(this, mParams);
|
||||
+ }
|
||||
+ }, 100);
|
||||
mWM.updateViewLayout(this, mParams);
|
||||
return false;
|
||||
}
|
||||
@@ -133,6 +152,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
mParams.screenBrightness = 1.0f;
|
||||
mWM.updateViewLayout(this, mParams);
|
||||
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -166,6 +186,7 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
|
||||
mParams.gravity = Gravity.TOP | Gravity.LEFT;
|
||||
mWM.addView(this, mParams);
|
||||
+ visible = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -188,5 +209,6 @@ public class FacolaView extends ImageView implements OnTouchListener {
|
||||
|
||||
Slog.d("PHH-Enroll", "Removed facola");
|
||||
mWM.removeView(this);
|
||||
+ visible = false;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 7fed750fff5a65329a32b851c46d3aaa856b2bed Mon Sep 17 00:00:00 2001
|
||||
From: Jerry Zhang <zhangjerry@google.com>
|
||||
Date: Wed, 6 Jun 2018 11:04:46 -0700
|
||||
Subject: [PATCH 32/32] Check for null path in getInternalPathForUser
|
||||
|
||||
In some situations, path could be null resulting
|
||||
in a crash.
|
||||
|
||||
Test: no crash
|
||||
Bug: 109730998
|
||||
Change-Id: I2ce0410162d1327905d690331f461f9187e20906
|
||||
Merged-In: I2ce0410162d1327905d690331f461f9187e20906
|
||||
(cherry picked from commit 6f6154bf0493cf66628c8f2418827fe54679b1eb)
|
||||
(cherry picked from commit 30f63cf1f958cf5e8ee77875ac38c579a4a783d1)
|
||||
---
|
||||
core/java/android/os/storage/VolumeInfo.java | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/core/java/android/os/storage/VolumeInfo.java b/core/java/android/os/storage/VolumeInfo.java
|
||||
index 8d4c3c3d3e6..8c7750242ef 100644
|
||||
--- a/core/java/android/os/storage/VolumeInfo.java
|
||||
+++ b/core/java/android/os/storage/VolumeInfo.java
|
||||
@@ -312,7 +312,9 @@ public class VolumeInfo implements Parcelable {
|
||||
* {@link android.Manifest.permission#WRITE_MEDIA_STORAGE}.
|
||||
*/
|
||||
public File getInternalPathForUser(int userId) {
|
||||
- if (type == TYPE_PUBLIC) {
|
||||
+ if (path == null) {
|
||||
+ return null;
|
||||
+ } else if (type == TYPE_PUBLIC) {
|
||||
// TODO: plumb through cleaner path from vold
|
||||
return new File(path.replace("/storage/", "/mnt/media_rw/"));
|
||||
} else {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 820e3cf51eaa918cee5c3c7bfe2fb240492eb7f8 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 33/34] 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 cd709880e11..ef1f3c17b1c 100644
|
||||
--- a/services/core/java/com/android/server/lights/LightsService.java
|
||||
+++ b/services/core/java/com/android/server/lights/LightsService.java
|
||||
@@ -64,16 +64,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
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 91ea029c2c9686490d6c011708c4a298d236fa2b 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 34/34] Make Samsung fingerprint broken HAL overridable
|
||||
|
||||
---
|
||||
.../com/android/server/fingerprint/FingerprintService.java | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
index 8c2990b1999..461fac50975 100644
|
||||
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
|
||||
@@ -1047,8 +1047,9 @@ public class FingerprintService extends SystemService implements IHwBinder.Death
|
||||
@Override
|
||||
public void run() {
|
||||
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.startsWith("samsung/")))
|
||||
+ if(overrideSamsung == 1 || (overrideSamsung != 0 && fp != null && fp.startsWith("samsung/")))
|
||||
remaining2 = 100 - remaining2;
|
||||
handleEnrollResult(deviceId, fingerId, groupId, remaining2);
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user