fingerprint: Add fps extension script

Bug: 208400345
Test: build Pass
Change-Id: If9334ac3a837c9bf85709335075f3a666eeef06d
This commit is contained in:
eddielan 2022-01-18 21:01:31 +08:00
parent 676247423b
commit f424463311
4 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,6 @@
sh_binary {
name: "fingerprint.extension.sh",
init_rc: ["init.fingerprint.extension.rc"],
src: "fingerprint.extension.sh",
system_ext_specific: true,
}

View file

@ -0,0 +1,11 @@
# Fingerprint extension feature
ifneq (,$(filter userdebug, $(TARGET_BUILD_VARIANT)))
SOONG_CONFIG_fp_hal_feature += report_bug_support
SOONG_CONFIG_fp_hal_feature_report_bug_support := true
BOARD_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/vendor/
SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/public/
SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += hardware/google/pixel-sepolicy/fingerprint-extension/system_ext/private/
PRODUCT_PACKAGES += \
fps_ext_bug_lib \
fingerprint.extension.sh
endif

View file

@ -0,0 +1,63 @@
#!/system/bin/sh
# BetterBug required fields
am='am start -a com.google.android.apps.betterbug.intent.FILE_BUG_DEEPLINK --ez EXTRA_DEEPLINK true '
issueTitle=' --es EXTRA_ISSUE_TITLE '
additionalComment=' --es EXTRA_ADDITIONAL_COMMENT '
componentId=' --el EXTRA_COMPONENT_ID '
requireBugReport=' --ez EXTRA_REQUIRE_BUGREPORT '
bugAssign=' --es EXTRA_BUG_ASSIGNEE '
ccGroup=' --es EXTRA_CC '
# BetterBug title
kAuthTitle="UDFPS Fingerprint authentication has high failed rate"
kLockoutTitle="UDFPS Fingerprint has too many lockout counts"
kLatencyTitle="UDFPS Fingerprint took long to unlock device"
# BetterBug context comment
kAuthComment="This bug is auto created by fingerprint HAL to track fingerprint authentication"
kLockoutComment="This bug is auto created by fingerprint HAL to track fingerprint lockout"
kLatencyComment="This bug is auto created by fingerprint HAL to track fingerprint latency"
# BetterBug assign & CC owner
kBugAssign='fps-triage@google.com'
kCcGroup='eddielan@google.com'
kComponentId='817555'
# Command to send intent to BetterBug
commonCommand="$componentId ${kComponentId//\ /\\ }
$requireBugReport true
$bugAssign ${kBugAssign//\ /\\ }
$ccGroup ${kCcGroup//\ /\\ }"
authCommand="$am $issueTitle ${kAuthTitle//\ /\\ }
$additionalComment ${kAuthComment//\ /\\ }"
lockoutCommand="$am $issueTitle ${kLockoutTitle//\ /\\ }
$additionalComment ${kLockoutComment//\ /\\ }"
latencyCommand="$am $issueTitle ${kLatencyTitle//\ /\\ }
$additionalComment ${kLatencyComment//\ /\\ }"
# Type of bug being triggered
# 1. Latency
# 2. Lockout
# 3. Finerprint authentication(FRR)
bug_type="$1"
send=1
if [ "$bug_type" == "latency" ]; then
intentCommand="$latencyCommand $commonCommand"
elif [ "$bug_type" == "lockout" ]; then
intentCommand="$lockoutCommand $commonCommand"
elif [ "$bug_type" == "auth" ]; then
intentCommand="$authCommand $commonCommand"
else
send=0
echo "Unknown bug_type $bug_type"
fi
if [ $send -eq 1 ]
then
eval $intentCommand
fi
# Exit
exit 0

View file

@ -0,0 +1,19 @@
# init-fingerprint-extension-sh is to send intent command to app
# for tracking fingerprint issue.
service fingerprint-extension-bug-latency /system_ext/bin/fingerprint.extension.sh latency
group shell
user shell
disabled
oneshot
service fingerprint-extension-bug-lockout /system_ext/bin/fingerprint.extension.sh lockout
group shell
user shell
disabled
oneshot
service fingerprint-extension-bug-auth /system_ext/bin/fingerprint.extension.sh auth
group shell
user shell
disabled
oneshot