Sync up to v300.m

This commit is contained in:
Andy CrossGate Yan
2021-02-14 10:42:34 +00:00
parent 7d0836656a
commit 73446c001b
3 changed files with 55 additions and 847 deletions

View File

@@ -0,0 +1,27 @@
From a54f02964ce04634fcf6178c8127800dfb1cfba6 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Mon, 18 Jan 2021 09:23:57 +0000
Subject: [PATCH] KeyStore: Block key attestation for Google Play Services
Change-Id: Ia2cd58ea1abfdb1a2c0eb358442c36b5c6809c6b
---
keystore/java/android/security/KeyStore.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 88b614dc7ee..de4e9ade191 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -1124,6 +1124,9 @@ public class KeyStore {
public int attestKey(
String alias, KeymasterArguments params, KeymasterCertificateChain outChain) {
+ if (mContext.getPackageName().equals("com.google.android.gms")) {
+ return KeymasterDefs.KM_ERROR_UNIMPLEMENTED; // Prevent Google Play Services from using key attestation for SafetyNet
+ }
CertificateChainPromise promise = new CertificateChainPromise();
try {
mBinder.asBinder().linkToDeath(promise, 0);
--
2.25.1

View File

@@ -0,0 +1,28 @@
From d47fac84706c80d14989b6348808d2d6602a250d Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Tue, 2 Feb 2021 10:20:51 +0000
Subject: [PATCH 37/37] Fix Wakelock issue
Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released
---
.../src/com/android/systemui/util/wakelock/WakeLock.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
index 08cd6e38389..c54dca88dcf 100644
--- a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
+++ b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
@@ -109,7 +109,9 @@ public interface WakeLock {
} else {
mActiveClients.put(why, count - 1);
}
- inner.release();
+ if (inner.isHeld()) {
+ inner.release();
+ }
}
/** @see PowerManager.WakeLock#wrap(Runnable) */
--
2.25.1