Initial unified commit for Android 14, with TrebleDroid GSI target, syncing up to 20240208

This commit is contained in:
Andy CrossGate Yan
2024-02-17 16:46:38 +08:00
commit e9902a4450
281 changed files with 169698 additions and 0 deletions

View File

@@ -0,0 +1,503 @@
From d68dec915906c30f41828fda7d501d1e476d646c Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 31 Jan 2024 08:39:53 +0800
Subject: [PATCH 1/2] Squashed revert of LOS UDFPS changes
Way less than FOD, but reverting them nonetheless to keep in line with PHH AOSP
- Revert "SystemUI: Only set dim behind UDFPS if it is actually enabled"
- Revert "SystemUI: Add UDFPS framework dimming support"
- Revert "udfps: Make pressed udfp view configurable"
- Revert "udfps: Restore illumination dot for global hbm"
---
.../res/drawable-nodpi/udfps_icon_pressed.png | Bin 108 -> 0 bytes
packages/SystemUI/res/layout/udfps_view.xml | 6 -
.../SystemUI/res/values/lineage_config.xml | 39 -----
.../systemui/biometrics/UdfpsController.java | 82 ---------
.../biometrics/UdfpsControllerOverlay.kt | 13 --
.../systemui/biometrics/UdfpsSurfaceView.java | 159 ------------------
.../android/systemui/biometrics/UdfpsView.kt | 31 +---
7 files changed, 1 insertion(+), 329 deletions(-)
delete mode 100644 packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
delete mode 100644 packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
diff --git a/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png b/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
deleted file mode 100644
index 4102e28c1300b49323b50625d8cfaa73b006561f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 108
zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}bl$r9IylHmNblJdl&R0hYC{G?O`
z&)mfH)S%SFl*+=BsWw1Ge4Z|jAr-fh5*U~o7?>FtSQ!{^cTT<plwt66^>bP0l+XkK
D@OB!I
diff --git a/packages/SystemUI/res/layout/udfps_view.xml b/packages/SystemUI/res/layout/udfps_view.xml
index 0fcbfa161ddf..257d238f5c54 100644
--- a/packages/SystemUI/res/layout/udfps_view.xml
+++ b/packages/SystemUI/res/layout/udfps_view.xml
@@ -28,10 +28,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
- <com.android.systemui.biometrics.UdfpsSurfaceView
- android:id="@+id/hbm_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="invisible"/>
-
</com.android.systemui.biometrics.UdfpsView>
diff --git a/packages/SystemUI/res/values/lineage_config.xml b/packages/SystemUI/res/values/lineage_config.xml
index 0454ba1205d9..31a7012accc4 100644
--- a/packages/SystemUI/res/values/lineage_config.xml
+++ b/packages/SystemUI/res/values/lineage_config.xml
@@ -15,45 +15,6 @@
limitations under the License.
-->
<resources>
- <!-- Color of the UDFPS pressed view -->
- <color name="config_udfpsColor">#ffffffff</color>
-
- <!-- Whether to enable framework dimming for UDFPS -->
- <bool name="config_udfpsFrameworkDimming">false</bool>
-
- <!-- Array of brightness-alpha LUT for framework dimming -->
- <string-array name="config_udfpsDimmingBrightnessAlphaArray" translatable="false">
- <!-- Example:
- <item>0,255</item>
- <item>1,234</item>
- <item>3,227</item>
- <item>8,208</item>
- <item>16,192</item>
- <item>27,176</item>
- <item>41,160</item>
- <item>61,144</item>
- <item>80,128</item>
- <item>104,112</item>
- <item>130,96</item>
- <item>158,80</item>
- <item>188,64</item>
- <item>221,48</item>
- <item>250,36</item>
- <item>255,33</item>
- -->
- </string-array>
-
- <!-- Brightness range min for UDFPS dimming -->
- <integer name="config_udfpsDimmingBrightnessMin">0</integer>
-
- <!-- Brightness range max for UDFPS dimming -->
- <integer name="config_udfpsDimmingBrightnessMax">0</integer>
-
- <!-- The amount of delay to add when disabling the dimming.
- This is used to prevent flickers due to the dimming being disabled
- before the screen has had chance to switch out of HBM mode -->
- <integer name="config_udfpsDimmingDisableDelay">0</integer>
-
<!-- Doze: does the double tap sensor need a proximity check? -->
<bool name="doze_double_tap_proximity_check">false</bool>
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 7ccd2881a0ea..3472a859ac82 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -50,7 +50,6 @@ import android.os.Process;
import android.os.Trace;
import android.os.VibrationAttributes;
import android.os.VibrationEffect;
-import android.provider.Settings;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
@@ -221,9 +220,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
private boolean mAttemptedToDismissKeyguard;
private final Set<Callback> mCallbacks = new HashSet<>();
- private boolean mUseFrameworkDimming;
- private int[][] mBrightnessAlphaArray;
-
@VisibleForTesting
public static final VibrationAttributes UDFPS_VIBRATION_ATTRIBUTES =
new VibrationAttributes.Builder()
@@ -928,8 +924,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
final UdfpsOverlayController mUdfpsOverlayController = new UdfpsOverlayController();
mFingerprintManager.setUdfpsOverlayController(mUdfpsOverlayController);
- initUdfpsFrameworkDimming();
-
final IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
context.registerReceiver(mBroadcastReceiver, filter,
@@ -1146,64 +1140,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
return mSensorProps.sensorType == FingerprintSensorProperties.TYPE_UDFPS_OPTICAL;
}
- private void initUdfpsFrameworkDimming() {
- mUseFrameworkDimming = mContext.getResources().getBoolean(
- com.android.systemui.R.bool.config_udfpsFrameworkDimming);
-
- if (mUseFrameworkDimming) {
- String[] array = mContext.getResources().getStringArray(
- com.android.systemui.R.array.config_udfpsDimmingBrightnessAlphaArray);
- mBrightnessAlphaArray = new int[array.length][2];
- for (int i = 0; i < array.length; i++) {
- String[] s = array[i].split(",");
- mBrightnessAlphaArray[i][0] = Integer.parseInt(s[0]);
- mBrightnessAlphaArray[i][1] = Integer.parseInt(s[1]);
- }
- }
- }
-
- private static int interpolate(int x, int xa, int xb, int ya, int yb) {
- return ya - (ya - yb) * (x - xa) / (xb - xa);
- }
-
- private int getBrightness() {
- int brightness = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.SCREEN_BRIGHTNESS, 100);
- // Since the brightness is taken from the system settings, we need to interpolate it
- final int brightnessMin = mContext.getResources().getInteger(
- com.android.systemui.R.integer.config_udfpsDimmingBrightnessMin);
- final int brightnessMax = mContext.getResources().getInteger(
- com.android.systemui.R.integer.config_udfpsDimmingBrightnessMax);
- if (brightnessMax > 0) {
- brightness = interpolate(brightness, 0, 255, brightnessMin, brightnessMax);
- }
- return brightness;
- }
-
- private void updateViewDimAmount() {
- if (mOverlay == null || !mUseFrameworkDimming) {
- return;
- } else if (isFingerDown()) {
- int curBrightness = getBrightness();
- int i, dimAmount;
- for (i = 0; i < mBrightnessAlphaArray.length; i++) {
- if (mBrightnessAlphaArray[i][0] >= curBrightness) break;
- }
- if (i == 0) {
- dimAmount = mBrightnessAlphaArray[i][1];
- } else if (i == mBrightnessAlphaArray.length) {
- dimAmount = mBrightnessAlphaArray[i-1][1];
- } else {
- dimAmount = interpolate(curBrightness,
- mBrightnessAlphaArray[i][0], mBrightnessAlphaArray[i-1][0],
- mBrightnessAlphaArray[i][1], mBrightnessAlphaArray[i-1][1]);
- }
- mOverlay.setDimAmount(dimAmount / 255.0f);
- } else {
- mOverlay.setDimAmount(0.0f);
- }
- }
-
public boolean isFingerDown() {
return mOnFingerDown;
}
@@ -1219,7 +1155,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
mSensorProps.sensorId);
mLatencyTracker.onActionEnd(LatencyTracker.ACTION_UDFPS_ILLUMINATE);
}
- updateViewDimAmount();
}
private void onFingerDown(
@@ -1369,23 +1304,6 @@ public class UdfpsController implements DozeReceiver, Dumpable {
unconfigureDisplay(view);
}
cancelAodSendFingerUpAction();
-
- // Add a delay to ensure that the dim amount is updated after the display has had chance
- // to switch out of HBM mode. The delay, in ms is stored in config_udfpsDimmingDisableDelay.
- // If the delay is 0, the dim amount will be updated immediately.
- final int delay = mContext.getResources().getInteger(
- com.android.systemui.R.integer.config_udfpsDimmingDisableDelay);
- if (delay > 0) {
- mFgExecutor.executeDelayed(() -> {
- // A race condition exists where the overlay is destroyed before the dim amount
- // is updated. This check ensures that the overlay is still valid.
- if (mOverlay != null && mOverlay.matchesRequestId(requestId)) {
- updateViewDimAmount();
- }
- }, delay);
- } else {
- updateViewDimAmount();
- }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
index 1edcf86650d6..d6ef94d18e71 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
@@ -123,8 +123,6 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
private var overlayTouchListener: TouchExplorationStateChangeListener? = null
- private val frameworkDimming = context.getResources().getBoolean(
- R.bool.config_udfpsFrameworkDimming)
private val coreLayoutParams = WindowManager.LayoutParams(
WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
0 /* flags set in computeLayoutParams() */,
@@ -136,11 +134,7 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
flags = (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or
WindowManager.LayoutParams.FLAG_SPLIT_TOUCH)
- if (frameworkDimming) {
- flags = flags or WindowManager.LayoutParams.FLAG_DIM_BEHIND
- }
privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
- dimAmount = 0.0f
// Avoid announcing window title.
accessibilityTitle = " "
@@ -149,13 +143,6 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
}
}
- var dimAmount
- get() = coreLayoutParams.dimAmount
- set(value) {
- coreLayoutParams.dimAmount = value
- windowManager.updateViewLayout(overlayView, coreLayoutParams)
- }
-
/** If the overlay is currently showing. */
val isShowing: Boolean
get() = overlayView != null
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
deleted file mode 100644
index 2488132b508b..000000000000
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsSurfaceView.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2021 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.systemui.biometrics;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.PixelFormat;
-import android.graphics.RectF;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.view.Surface;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-
-import com.android.systemui.R;
-
-/**
- * Surface View for providing the Global High-Brightness Mode (GHBM) illumination for UDFPS.
- */
-public class UdfpsSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
- private static final String TAG = "UdfpsSurfaceView";
-
- /**
- * Notifies {@link UdfpsView} when to enable GHBM illumination.
- */
- interface GhbmIlluminationListener {
- /**
- * @param surface the surface for which GHBM should be enabled.
- * @param onDisplayConfigured a runnable that should be run after GHBM is enabled.
- */
- void enableGhbm(@NonNull Surface surface, @Nullable Runnable onDisplayConfigured);
- }
-
- @NonNull private final SurfaceHolder mHolder;
- @NonNull private final Paint mSensorPaint;
-
- @Nullable private GhbmIlluminationListener mGhbmIlluminationListener;
- @Nullable private Runnable mOnDisplayConfigured;
- boolean mAwaitingSurfaceToStartIllumination;
- boolean mHasValidSurface;
-
- private Drawable mUdfpsIconPressed;
-
- public UdfpsSurfaceView(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- // Make this SurfaceView draw on top of everything else in this window. This allows us to
- // 1) Always show the HBM circle on top of everything else, and
- // 2) Properly composite this view with any other animations in the same window no matter
- // what contents are added in which order to this view hierarchy.
- setZOrderOnTop(true);
-
- mHolder = getHolder();
- mHolder.addCallback(this);
- mHolder.setFormat(PixelFormat.RGBA_8888);
-
- mSensorPaint = new Paint(0 /* flags */);
- mSensorPaint.setAntiAlias(true);
- mSensorPaint.setColor(context.getColor(R.color.config_udfpsColor));
- mSensorPaint.setStyle(Paint.Style.FILL);
-
- mUdfpsIconPressed = context.getDrawable(R.drawable.udfps_icon_pressed);
- }
-
- @Override public void surfaceCreated(SurfaceHolder holder) {
- mHasValidSurface = true;
- if (mAwaitingSurfaceToStartIllumination) {
- doIlluminate(mOnDisplayConfigured);
- mOnDisplayConfigured = null;
- mAwaitingSurfaceToStartIllumination = false;
- }
- }
-
- @Override
- public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
- // Unused.
- }
-
- @Override public void surfaceDestroyed(SurfaceHolder holder) {
- mHasValidSurface = false;
- }
-
- void setGhbmIlluminationListener(@Nullable GhbmIlluminationListener listener) {
- mGhbmIlluminationListener = listener;
- }
-
- /**
- * Note: there is no corresponding method to stop GHBM illumination. It is expected that
- * {@link UdfpsView} will hide this view, which would destroy the surface and remove the
- * illumination dot.
- */
- void startGhbmIllumination(@Nullable Runnable onDisplayConfigured) {
- if (mGhbmIlluminationListener == null) {
- Log.e(TAG, "startIllumination | mGhbmIlluminationListener is null");
- return;
- }
-
- if (mHasValidSurface) {
- doIlluminate(onDisplayConfigured);
- } else {
- mAwaitingSurfaceToStartIllumination = true;
- mOnDisplayConfigured = onDisplayConfigured;
- }
- }
-
- private void doIlluminate(@Nullable Runnable onDisplayConfigured) {
- if (mGhbmIlluminationListener == null) {
- Log.e(TAG, "doIlluminate | mGhbmIlluminationListener is null");
- return;
- }
-
- mGhbmIlluminationListener.enableGhbm(mHolder.getSurface(), onDisplayConfigured);
- }
-
- /**
- * Immediately draws the illumination dot on this SurfaceView's surface.
- */
- void drawIlluminationDot(@NonNull RectF sensorRect) {
- if (!mHasValidSurface) {
- Log.e(TAG, "drawIlluminationDot | the surface is destroyed or was never created.");
- return;
- }
- Canvas canvas = null;
- try {
- canvas = mHolder.lockCanvas();
- mUdfpsIconPressed.setBounds(
- Math.round(sensorRect.left),
- Math.round(sensorRect.top),
- Math.round(sensorRect.right),
- Math.round(sensorRect.bottom)
- );
- mUdfpsIconPressed.draw(canvas);
- canvas.drawOval(sensorRect, mSensorPaint);
- } finally {
- // Make sure the surface is never left in a bad state.
- if (canvas != null) {
- mHolder.unlockCanvasAndPost(canvas);
- }
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index ef7fcc954590..06dee7a2b9f6 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -25,7 +25,6 @@ import android.graphics.RectF
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
-import android.view.Surface
import android.widget.FrameLayout
import com.android.settingslib.udfps.UdfpsOverlayParams
import com.android.systemui.R
@@ -62,8 +61,6 @@ class UdfpsView(
a.getFloat(R.styleable.UdfpsView_sensorTouchAreaCoefficient, 0f)
}
- private var ghbmView: UdfpsSurfaceView? = null
-
/** View controller (can be different for enrollment, BiometricPrompt, Keyguard, etc.). */
var animationViewController: UdfpsAnimationViewController<*>? = null
@@ -90,10 +87,6 @@ class UdfpsView(
return (animationViewController == null || !animationViewController!!.shouldPauseAuth())
}
- override fun onFinishInflate() {
- ghbmView = findViewById(R.id.hbm_view)
- }
-
override fun dozeTimeTick() {
animationViewController?.dozeTimeTick()
}
@@ -157,34 +150,12 @@ class UdfpsView(
fun configureDisplay(onDisplayConfigured: Runnable) {
isDisplayConfigured = true
animationViewController?.onDisplayConfiguring()
- val gView = ghbmView
- if (gView != null) {
- gView.setGhbmIlluminationListener(this::doIlluminate)
- gView.visibility = VISIBLE
- gView.startGhbmIllumination(onDisplayConfigured)
- } else {
- doIlluminate(null /* surface */, onDisplayConfigured)
- }
- }
-
- private fun doIlluminate(surface: Surface?, onDisplayConfigured: Runnable?) {
- if (ghbmView != null && surface == null) {
- Log.e(TAG, "doIlluminate | surface must be non-null for GHBM")
- }
-
- mUdfpsDisplayMode?.enable {
- onDisplayConfigured?.run()
- ghbmView?.drawIlluminationDot(RectF(sensorRect))
- }
+ mUdfpsDisplayMode?.enable(onDisplayConfigured)
}
fun unconfigureDisplay() {
isDisplayConfigured = false
animationViewController?.onDisplayUnconfigured()
- ghbmView?.let { view ->
- view.setGhbmIlluminationListener(null)
- view.visibility = INVISIBLE
- }
mUdfpsDisplayMode?.disable(null /* onDisabled */)
}
}
--
2.34.1

View File

@@ -0,0 +1,47 @@
From c99885957f2f301d69d6e4f142856f1ea44f2703 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 21 Jan 2024 23:21:02 +0800
Subject: [PATCH 2/2] Revert "Biometrics: Allow disabling of fingerprint
cleanups"
This reverts commit add9f4dc93bba9d414ad67a0770b82c06747d09f.
---
.../sensors/fingerprint/hidl/Fingerprint21.java | 8 --------
1 file changed, 8 deletions(-)
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
index 8ba20b66122c..d0b71fcf2dbb 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
@@ -133,8 +133,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
private final int mSensorId;
private final boolean mIsPowerbuttonFps;
- private boolean mCleanup;
-
private final class BiometricTaskStackListener extends TaskStackListener {
@Override
public void onTaskStackChanged() {
@@ -359,9 +357,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
BiometricsProtoEnums.MODALITY_FINGERPRINT, new BiometricNotificationImpl());
- mCleanup = context.getResources().getBoolean(
- org.lineageos.platform.internal.R.bool.config_cleanupUnusedFingerprints);
-
try {
ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
} catch (RemoteException e) {
@@ -751,9 +746,6 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider
private void scheduleInternalCleanup(int userId,
@Nullable ClientMonitorCallback callback) {
- if (!mCleanup) {
- return;
- }
mHandler.post(() -> {
scheduleUpdateActiveUserWithoutHandler(userId);
--
2.34.1

View File

@@ -0,0 +1,55 @@
From 09fac47349b2e39d2e53b2b638b98d17d3bd18a4 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 22:00:14 +0800
Subject: [PATCH 1/2] Revert "CompositionEngine: Request device composition for
the Udfps touched layer"
This reverts commit 69fad8aa4098b007fe17472902159705fdcd957f.
---
.../CompositionEngine/src/Output.cpp | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 2eb1a5c399..793959cea6 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -22,7 +22,6 @@
#include <compositionengine/LayerFE.h>
#include <compositionengine/LayerFECompositionState.h>
#include <compositionengine/RenderSurface.h>
-#include <compositionengine/UdfpsExtension.h>
#include <compositionengine/impl/HwcAsyncWorker.h>
#include <compositionengine/impl/Output.h>
#include <compositionengine/impl/OutputCompositionState.h>
@@ -901,10 +900,7 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
- for (size_t i = 0; i < getOutputLayerCount(); i++) {
- compositionengine::OutputLayer* layer = getOutputLayerOrderedByZByIndex(i);
- compositionengine::OutputLayer* nextLayer = getOutputLayerOrderedByZByIndex(i + 1);
-
+ for (auto* layer : getOutputLayersOrderedByZ()) {
auto* compState = layer->getLayerFE().getCompositionState();
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
@@ -918,16 +914,6 @@ compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition
if (compState->backgroundBlurRadius > 0 || compState->blurRegions.size() > 0) {
layerRequestingBgComposition = layer;
}
-
- // If the next layer is the Udfps touched layer, enable client composition for it
- // because that somehow leads to the Udfps touched layer getting device composition
- // consistently.
- if ((nextLayer != nullptr && layerRequestingBgComposition == nullptr) &&
- (strncmp(nextLayer->getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0)) {
- layerRequestingBgComposition = layer;
- break;
- }
}
return layerRequestingBgComposition;
}
--
2.34.1

View File

@@ -0,0 +1,157 @@
From 9428b1b39a473592423f2d2f7812cf3815a68b86 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 22:00:23 +0800
Subject: [PATCH 2/2] Revert "surfaceflinger: Add support for Udfps extension
lib"
This reverts commit 8655d06e960235c0f9ad079be3541fee2a0359f7.
---
.../CompositionEngine/Android.bp | 14 +--------
.../compositionengine/UdfpsExtension.h | 29 -------------------
.../CompositionEngine/src/OutputLayer.cpp | 13 +--------
.../CompositionEngine/src/UdfpsExtension.cpp | 27 -----------------
4 files changed, 2 insertions(+), 81 deletions(-)
delete mode 100644 services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
delete mode 100644 services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
diff --git a/services/surfaceflinger/CompositionEngine/Android.bp b/services/surfaceflinger/CompositionEngine/Android.bp
index cdec4abdba..f3a0186e3e 100644
--- a/services/surfaceflinger/CompositionEngine/Android.bp
+++ b/services/surfaceflinger/CompositionEngine/Android.bp
@@ -61,10 +61,7 @@ cc_defaults {
cc_library {
name: "libcompositionengine",
- defaults: [
- "libcompositionengine_defaults",
- "surfaceflinger_udfps_lib_defaults",
- ],
+ defaults: ["libcompositionengine_defaults"],
srcs: [
"src/planner/CachedSet.cpp",
"src/planner/Flattener.cpp",
@@ -86,7 +83,6 @@ cc_library {
"src/OutputLayer.cpp",
"src/OutputLayerCompositionState.cpp",
"src/RenderSurface.cpp",
- "src/UdfpsExtension.cpp",
],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
@@ -115,14 +111,6 @@ cc_library {
export_include_dirs: ["include"],
}
-cc_library_static {
- name: "surfaceflinger_udfps_lib",
- srcs: [
- "src/UdfpsExtension.cpp",
- ],
- export_include_dirs: ["include"],
-}
-
cc_test {
name: "libcompositionengine_test",
test_suites: ["device-tests"],
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
deleted file mode 100644
index 4306cb4a02..0000000000
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/UdfpsExtension.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2021-2022 The LineageOS 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.
- */
-
-#include <stdint.h>
-
-#ifndef __UDFPS_EXTENSION__H__
-#define __UDFPS_EXTENSION__H__
-
-#define UDFPS_BIOMETRIC_PROMPT_LAYER_NAME "BiometricPrompt"
-#define UDFPS_LAYER_NAME "UdfpsControllerOverlay"
-#define UDFPS_TOUCHED_LAYER_NAME "SurfaceView[UdfpsControllerOverlay](BLAST)"
-
-extern uint32_t getUdfpsZOrder(uint32_t z, bool touched);
-extern uint64_t getUdfpsUsageBits(uint64_t usageBits, bool touched);
-
-#endif /* __UDFPS_EXTENSION__H__ */
diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
index a314553dd2..0ac0ecb727 100644
--- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp
@@ -19,7 +19,6 @@
#include <compositionengine/DisplayColorProfile.h>
#include <compositionengine/LayerFECompositionState.h>
#include <compositionengine/Output.h>
-#include <compositionengine/UdfpsExtension.h>
#include <compositionengine/impl/HwcBufferCache.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <compositionengine/impl/OutputLayer.h>
@@ -449,17 +448,7 @@ void OutputLayer::writeOutputDependentGeometryStateToHWC(HWC2::Layer* hwcLayer,
sourceCrop.bottom, to_string(error).c_str(), static_cast<int32_t>(error));
}
- uint32_t z_udfps = z;
- if ((strncmp(getLayerFE().getDebugName(), UDFPS_LAYER_NAME, strlen(UDFPS_LAYER_NAME)) == 0) ||
- (strncmp(getLayerFE().getDebugName(), UDFPS_BIOMETRIC_PROMPT_LAYER_NAME,
- strlen(UDFPS_BIOMETRIC_PROMPT_LAYER_NAME)) == 0)) {
- z_udfps = getUdfpsZOrder(z, false);
- } else if (strncmp(getLayerFE().getDebugName(), UDFPS_TOUCHED_LAYER_NAME,
- strlen(UDFPS_TOUCHED_LAYER_NAME)) == 0) {
- z_udfps = getUdfpsZOrder(z, true);
- }
-
- if (auto error = hwcLayer->setZOrder(z_udfps); error != hal::Error::NONE) {
+ if (auto error = hwcLayer->setZOrder(z); error != hal::Error::NONE) {
ALOGE("[%s] Failed to set Z %u: %s (%d)", getLayerFE().getDebugName(), z,
to_string(error).c_str(), static_cast<int32_t>(error));
}
diff --git a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp b/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
deleted file mode 100644
index 2d9d086dd2..0000000000
--- a/services/surfaceflinger/CompositionEngine/src/UdfpsExtension.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2020 The LineageOS 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.
- */
-
-#ifndef TARGET_PROVIDES_UDFPS_LIB
-#include <compositionengine/UdfpsExtension.h>
-
-uint32_t getUdfpsZOrder(uint32_t z, __unused bool touched) {
- return z;
-}
-
-uint64_t getUdfpsUsageBits(uint64_t usageBits, __unused bool touched) {
- return usageBits;
-}
-#endif
--
2.34.1

View File

@@ -0,0 +1,100 @@
From f9ca27932587c1c3f3ae9b26908eb35540e30f33 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 22:48:28 +0800
Subject: [PATCH] Revert "compat: Provide libprotobuf-cpp vendorcompat
prebuilts from v29 VNDK"
This reverts commit 770258c025fcd689895cac9d172a18609bf96d09.
---
Android.bp | 38 --------------------------
vndk/v29/arm/libprotobuf-cpp-full.so | 1 -
vndk/v29/arm/libprotobuf-cpp-lite.so | 1 -
vndk/v29/arm64/libprotobuf-cpp-full.so | 1 -
vndk/v29/arm64/libprotobuf-cpp-lite.so | 1 -
5 files changed, 42 deletions(-)
delete mode 120000 vndk/v29/arm/libprotobuf-cpp-full.so
delete mode 120000 vndk/v29/arm/libprotobuf-cpp-lite.so
delete mode 120000 vndk/v29/arm64/libprotobuf-cpp-full.so
delete mode 120000 vndk/v29/arm64/libprotobuf-cpp-lite.so
diff --git a/Android.bp b/Android.bp
index f1fd0de..374fd33 100644
--- a/Android.bp
+++ b/Android.bp
@@ -429,41 +429,3 @@ cc_library_shared {
compile_multilib: "64",
vendor: true,
}
-
-cc_prebuilt_library_shared {
- name: "libprotobuf-cpp-full-vendorcompat",
- stem: "libprotobuf-cpp-full",
- vendor: true,
- strip: {
- none: true,
- },
- target: {
- android_arm: {
- srcs: ["vndk/v29/arm/libprotobuf-cpp-full.so"],
- },
- android_arm64: {
- srcs: ["vndk/v29/arm64/libprotobuf-cpp-full.so"],
- },
- },
- compile_multilib: "both",
- check_elf_files: false,
-}
-
-cc_prebuilt_library_shared {
- name: "libprotobuf-cpp-lite-vendorcompat",
- stem: "libprotobuf-cpp-lite",
- vendor: true,
- strip: {
- none: true,
- },
- target: {
- android_arm: {
- srcs: ["vndk/v29/arm/libprotobuf-cpp-lite.so"],
- },
- android_arm64: {
- srcs: ["vndk/v29/arm64/libprotobuf-cpp-lite.so"],
- },
- },
- compile_multilib: "both",
- check_elf_files: false,
-}
diff --git a/vndk/v29/arm/libprotobuf-cpp-full.so b/vndk/v29/arm/libprotobuf-cpp-full.so
deleted file mode 120000
index 2c8c152..0000000
--- a/vndk/v29/arm/libprotobuf-cpp-full.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm-armv8-a/shared/vndk-core/libprotobuf-cpp-full.so
\ No newline at end of file
diff --git a/vndk/v29/arm/libprotobuf-cpp-lite.so b/vndk/v29/arm/libprotobuf-cpp-lite.so
deleted file mode 120000
index 4b3896e..0000000
--- a/vndk/v29/arm/libprotobuf-cpp-lite.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm-armv8-a/shared/vndk-core/libprotobuf-cpp-lite.so
\ No newline at end of file
diff --git a/vndk/v29/arm64/libprotobuf-cpp-full.so b/vndk/v29/arm64/libprotobuf-cpp-full.so
deleted file mode 120000
index caba7cb..0000000
--- a/vndk/v29/arm64/libprotobuf-cpp-full.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-core/libprotobuf-cpp-full.so
\ No newline at end of file
diff --git a/vndk/v29/arm64/libprotobuf-cpp-lite.so b/vndk/v29/arm64/libprotobuf-cpp-lite.so
deleted file mode 120000
index a4bac2e..0000000
--- a/vndk/v29/arm64/libprotobuf-cpp-lite.so
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../prebuilts/vndk/v29/arm64/arch-arm64-armv8-a/shared/vndk-core/libprotobuf-cpp-lite.so
\ No newline at end of file
--
2.34.1

View File

@@ -0,0 +1,50 @@
From cd3589bfec212ae631772e0fdc984f21fc2bafe7 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 20 Nov 2023 21:59:29 +0800
Subject: [PATCH] Revert "gd: hci: Allow disabling selected local commands"
This reverts commit 543afb3dd2e2b5aa4f1931a973eb7c7df634aa69.
---
system/gd/hci/controller.cc | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc
index 5576293017..c08ecab9d5 100644
--- a/system/gd/hci/controller.cc
+++ b/system/gd/hci/controller.cc
@@ -16,7 +16,6 @@
#include "hci/controller.h"
-#include <android-base/strings.h>
#include <future>
#include <memory>
#include <string>
@@ -37,8 +36,6 @@ constexpr uint8_t kMinEncryptionKeySize = 7; // #define MIN_ENCRYPTION_KEY_SIZE
constexpr bool kDefaultVendorCapabilitiesEnabled = true;
static const std::string kPropertyVendorCapabilitiesEnabled =
"bluetooth.core.le.vendor_capabilities.enabled";
-static const char kPropertyDisabledCommands[] =
- "bluetooth.hci.disabled_commands";
using os::Handler;
@@ -301,15 +298,6 @@ struct Controller::impl {
ErrorCode status = complete_view.GetStatus();
ASSERT_LOG(status == ErrorCode::SUCCESS, "Status 0x%02hhx, %s", status, ErrorCodeText(status).c_str());
local_supported_commands_ = complete_view.GetSupportedCommands();
-
- if (auto disabledCommands = os::GetSystemProperty(kPropertyDisabledCommands)) {
- for (const auto& command : android::base::Split(*disabledCommands, ",")) {
- uint16_t index = std::stoi(command);
- uint16_t byte_index = index / 10;
- uint16_t bit_index = index % 10;
- local_supported_commands_[byte_index] &= ~(1 << bit_index);
- }
- }
}
void read_local_extended_features_complete_handler(std::promise<void> promise, CommandCompleteView view) {
--
2.34.1