sm7125: fod: add surfaceflinger extension lib

Change-Id: I51fb56c0a20e3cac83afb46ed6a6e2f967159d18
fourteen-wip
TheScarastic 4 years ago committed by Simon1511
parent ac52dd13db
commit 8542cf6773
  1. 3
      BoardConfigCommon.mk
  2. 7
      fod/Android.bp
  3. 13
      fod/FingerprintInscreen.cpp
  4. 29
      fod/FodExtension.cpp

@ -147,6 +147,9 @@ AUDIOSERVER_MULTILIB := 32
# Keymaster
TARGET_KEYMASTER_VARIANT := samsung
# FOD
TARGET_SURFACEFLINGER_FOD_LIB := //$(COMMON_PATH):libfod_extension.sm7125
# HIDL manifests
DEVICE_MANIFEST_FILE := $(COMMON_PATH)/configs/manifest.xml
DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(COMMON_PATH)/configs/framework_compatibility_matrix.xml

@ -0,0 +1,7 @@
cc_library_static {
name: "libfod_extension.sm7125",
srcs: ["FodExtension.cpp"],
include_dirs: [
"frameworks/native/services/surfaceflinger/CompositionEngine/include"
],
}

@ -24,8 +24,8 @@
#define FINGERPRINT_ACQUIRED_VENDOR 6
#define BRIGHTNESS_PATH "/sys/class/backlight/panel0-backlight/brightness"
#define TSP_CMD_PATH "/sys/class/sec/tsp/cmd"
#define MASK_BRIGHTNESS_PATH "/sys/class/lcd/panel/mask_brightness"
#define SEM_FINGER_STATE 22
#define SEM_PARAM_PRESSED 2
@ -70,6 +70,7 @@ static hidl_vec<int8_t> stringToVec(const std::string& str) {
FingerprintInscreen::FingerprintInscreen() {
mSehBiometricsFingerprintService = ISehBiometricsFingerprint::getService();
set(MASK_BRIGHTNESS_PATH, "319");
}
void FingerprintInscreen::requestResult(int, const hidl_vec<int8_t>&) {
@ -85,8 +86,6 @@ Return<void> FingerprintInscreen::onFinishEnroll() {
}
Return<void> FingerprintInscreen::onPress() {
mPreviousBrightness = get<std::string>(BRIGHTNESS_PATH, "");
set(BRIGHTNESS_PATH, "425");
set(TSP_CMD_PATH, "fod_enable,1,1,0");
mSehBiometricsFingerprintService->sehRequest(SEM_FINGER_STATE,
SEM_PARAM_PRESSED, stringToVec(SEM_AOSP_FQNAME), FingerprintInscreen::requestResult);
@ -97,10 +96,6 @@ Return<void> FingerprintInscreen::onRelease() {
mSehBiometricsFingerprintService->sehRequest(SEM_FINGER_STATE,
SEM_PARAM_RELEASED, stringToVec(SEM_AOSP_FQNAME), FingerprintInscreen::requestResult);
set(TSP_CMD_PATH, "fod_enable,0");
if (!mPreviousBrightness.empty()) {
set(BRIGHTNESS_PATH, mPreviousBrightness);
mPreviousBrightness = "";
}
return Void();
}
@ -110,10 +105,6 @@ Return<void> FingerprintInscreen::onShowFODView() {
Return<void> FingerprintInscreen::onHideFODView() {
set(TSP_CMD_PATH, "fod_enable,0");
if (!mPreviousBrightness.empty()) {
set(BRIGHTNESS_PATH, mPreviousBrightness);
mPreviousBrightness = "";
}
return Void();
}

@ -0,0 +1,29 @@
/*
* Copyright (C) 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.
*/
#include <compositionengine/FodExtension.h>
uint32_t getFodZOrder(uint32_t z, bool touched) {
(void) touched;
return z;
}
uint32_t getFodUsageBits(uint32_t usageBits, bool touched) {
if (touched) {
usageBits |= 0x400000000LL;
}
return usageBits;
}
Loading…
Cancel
Save