@ -28,6 +28,7 @@
# include <inttypes.h>
# include <unistd.h>
# include <cutils/properties.h>
# include <string.h>
# ifdef HAS_FINGERPRINT_GESTURES
# include <fcntl.h>
@ -35,6 +36,7 @@
# define TSP_CMD_PATH " / sys / class / sec / tsp / cmd"
# define HBM_PATH " / sys / class / lcd / panel / mask_brightness"
# define MASK_BRIGHTNESS_PATH " / sys / class / lcd / panel / actual_mask_brightness"
namespace android {
namespace hardware {
@ -53,6 +55,14 @@ static void set(const std::string& path, const T& value) {
file < < value ;
}
template < typename T >
static T get ( const std : : string & path , const T & def ) {
std : : ifstream file ( path ) ;
T result ;
file > > result ;
return file . fail ( ) ? def : result ;
}
std : : string getBootloader ( ) {
return android : : base : : GetProperty ( " ro.boot.bootloader " , " " ) ;
}
@ -139,9 +149,11 @@ Return<void> BiometricsFingerprint::onFingerDown(uint32_t, uint32_t, float, floa
}
Return < void > BiometricsFingerprint : : onFingerUp ( ) {
if ( strcmp ( get < std : : string > ( MASK_BRIGHTNESS_PATH , " 0 " ) . c_str ( ) , " 0 " ) ! = 0 ) {
request ( SEM_REQUEST_TOUCH_EVENT , FINGERPRINT_REQUEST_RESUME ) ;
set ( HBM_PATH , " 0 " ) ;
}
return Void ( ) ;
}