Sync up to v212

This commit is contained in:
Andy CrossGate Yan
2020-02-27 14:07:15 +00:00
parent 5a4c7737ee
commit 9fe4d8ccf3
9 changed files with 767 additions and 6 deletions

View File

@@ -0,0 +1,63 @@
From 1f986fdcdbf2788cc1df26c032a08bce89b1427d Mon Sep 17 00:00:00 2001
From: "Chris.CC Lee" <chriscclee@google.com>
Date: Mon, 3 Feb 2020 17:33:19 +0800
Subject: [PATCH 47/49] Fix AoD front scrim being opaque at DOZE_PULSING.
When doze state changed from DOZE to DOZE_PULSING on devices not
supporting doze_brightness_sensor_type sensor, there would be no
sensor events to update the AoD front scrim. And due to the scrim was
set to opaque at DOZE state, most views on the statusbar will be
invisible. This patch change the scrim to transparent again at leaving
DOZE state.
Bug: 148129743
Test: atest DozeScreenBrightnessTest
Change-Id: I2c079d081b04f00a929ae5c4475639685f9f7e69
---
.../systemui/doze/DozeScreenBrightness.java | 4 ++++
.../systemui/doze/DozeScreenBrightnessTest.java | 14 ++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
index bd6882c01bb..c27e633f2a9 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenBrightness.java
@@ -161,6 +161,10 @@ public class DozeScreenBrightness extends BroadcastReceiver implements DozeMachi
// again, it will only show after the brightness sensor has stabilized,
// avoiding a potential flicker.
scrimOpacity = 255;
+ } else if (!mScreenOff && mLightSensor == null) {
+ // No light sensor but previous state turned the screen black. Make the scrim
+ // transparent and below views visible.
+ scrimOpacity = 0;
} else if (brightnessReady) {
// Only unblank scrim once brightness is ready.
scrimOpacity = computeScrimOpacity(sensorValue);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
index 392c677b982..1347175c7d3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeScreenBrightnessTest.java
@@ -170,6 +170,20 @@ public class DozeScreenBrightnessTest extends SysuiTestCase {
assertEquals(DEFAULT_BRIGHTNESS, mServiceFake.screenBrightness);
}
+ @Test
+ public void testPulsing_withoutLightSensor_setsAoDDimmingScrimTransparent() throws Exception {
+ mScreen = new DozeScreenBrightness(mContext, mServiceFake, mSensorManager,
+ null /* sensor */, mHostFake, null /* handler */,
+ DEFAULT_BRIGHTNESS, SENSOR_TO_BRIGHTNESS, SENSOR_TO_OPACITY,
+ true /* debuggable */);
+ mScreen.transitionTo(UNINITIALIZED, INITIALIZED);
+ mScreen.transitionTo(INITIALIZED, DOZE);
+
+ mScreen.transitionTo(DOZE, DOZE_REQUEST_PULSE);
+
+ assertEquals(0f, mHostFake.aodDimmingScrimOpacity, 0.001f /* delta */);
+ }
+
@Test
public void testNullSensor() throws Exception {
mScreen = new DozeScreenBrightness(mContext, mServiceFake, mSensorManager,
--
2.17.1

View File

@@ -0,0 +1,96 @@
From b13732f6a801d85390feb025d678e2b14effc915 Mon Sep 17 00:00:00 2001
From: Stan Iliev <stani@google.com>
Date: Thu, 1 Aug 2019 14:41:52 -0400
Subject: [PATCH 48/49] TextureVuew rebind GL texture, if AHB content has
changed
Bug: 138674291
Test: Ran apps with TextureView and CTS
Change-Id: Ieecf7daf160761de719356644ddaeda8f9c068e1
---
libs/hwui/surfacetexture/ImageConsumer.cpp | 18 +++++++++++++++---
libs/hwui/surfacetexture/ImageConsumer.h | 5 -----
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/libs/hwui/surfacetexture/ImageConsumer.cpp b/libs/hwui/surfacetexture/ImageConsumer.cpp
index bae616bbc63..17ee17d5cd1 100644
--- a/libs/hwui/surfacetexture/ImageConsumer.cpp
+++ b/libs/hwui/surfacetexture/ImageConsumer.cpp
@@ -71,13 +71,16 @@ public:
void makeImage(sp<GraphicBuffer>& graphicBuffer, android_dataspace dataspace,
GrContext* context);
+ void newBufferContent(GrContext* context);
+
private:
// The only way to invoke dtor is with unref, when mUsageCount is 0.
~AutoBackendTextureRelease() {}
GrBackendTexture mBackendTexture;
GrAHardwareBufferUtils::DeleteImageProc mDeleteProc;
- GrAHardwareBufferUtils::DeleteImageCtx mDeleteCtx;
+ GrAHardwareBufferUtils::UpdateImageProc mUpdateProc;
+ GrAHardwareBufferUtils::TexImageCtx mImageCtx;
// Starting with refcount 1, because the first ref is held by SurfaceTexture. Additional refs
// are held by SkImages.
@@ -101,7 +104,8 @@ AutoBackendTextureRelease::AutoBackendTextureRelease(GrContext* context, Graphic
buffer->getWidth(),
buffer->getHeight(),
&mDeleteProc,
- &mDeleteCtx,
+ &mUpdateProc,
+ &mImageCtx,
createProtectedImage,
backendFormat,
false);
@@ -123,7 +127,7 @@ void AutoBackendTextureRelease::unref(bool releaseImage) {
mUsageCount--;
if (mUsageCount <= 0) {
if (mBackendTexture.isValid()) {
- mDeleteProc(mDeleteCtx);
+ mDeleteProc(mImageCtx);
mBackendTexture = {};
}
delete this;
@@ -154,6 +158,12 @@ void AutoBackendTextureRelease::makeImage(sp<GraphicBuffer>& graphicBuffer,
}
}
+void AutoBackendTextureRelease::newBufferContent(GrContext* context) {
+ if (mBackendTexture.isValid()) {
+ mUpdateProc(mImageCtx, context);
+ }
+}
+
void ImageConsumer::ImageSlot::createIfNeeded(sp<GraphicBuffer> graphicBuffer,
android_dataspace dataspace, bool forceCreate,
GrContext* context) {
@@ -166,6 +176,8 @@ void ImageConsumer::ImageSlot::createIfNeeded(sp<GraphicBuffer> graphicBuffer,
if (!mTextureRelease) {
mTextureRelease = new AutoBackendTextureRelease(context, graphicBuffer.get());
+ } else {
+ mTextureRelease->newBufferContent(context);
}
mDataspace = dataspace;
diff --git a/libs/hwui/surfacetexture/ImageConsumer.h b/libs/hwui/surfacetexture/ImageConsumer.h
index 2fdece98987..3e2a91a251f 100644
--- a/libs/hwui/surfacetexture/ImageConsumer.h
+++ b/libs/hwui/surfacetexture/ImageConsumer.h
@@ -26,11 +26,6 @@
#include <gui/BufferItem.h>
#include <system/graphics.h>
-namespace GrAHardwareBufferUtils {
-typedef void* DeleteImageCtx;
-typedef void (*DeleteImageProc)(DeleteImageCtx);
-}
-
namespace android {
namespace uirenderer {
--
2.17.1

View File

@@ -0,0 +1,29 @@
From 47af2ea4d5e850fc900a8f76682979325460a0e0 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 22 Feb 2020 23:25:51 +0100
Subject: [PATCH 49/49] FacolaView] Allow system-side properties (vendor-side
works only with proper selinux)
---
.../com/android/server/biometrics/fingerprint/FacolaView.java | 4 ++++
1 file changed, 4 insertions(+)
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 b8ca25a48d2..f77e8282689 100644
--- a/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
+++ b/services/core/java/com/android/server/biometrics/fingerprint/FacolaView.java
@@ -73,7 +73,11 @@ public class FacolaView extends ImageView implements OnTouchListener {
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(",");
+ if(location.length == 0)
+ location = android.os.SystemProperties.get("persist.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 == 0)
+ size = android.os.SystemProperties.get("persist.sys.fp.fod.size.width_height", "").split(",");
Slog.d("PHH-Enroll", "FacolaView hello");
if(size.length == 2 && location.length == 2) {
Slog.d("PHH-Enroll", "Got real values");
--
2.17.1