Commit 9119a633 authored by Bernhard Thoben's avatar Bernhard Thoben
Browse files

Back-port a couple changes and fixes to 17.1 from joel16

Change-Id: Iaed56ee798b80d5d220867e41c0351c284070795
parent 1b505758
...@@ -71,7 +71,7 @@ AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true ...@@ -71,7 +71,7 @@ AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
AUDIO_FEATURE_ENABLED_FLUENCE := true AUDIO_FEATURE_ENABLED_FLUENCE := true
AUDIO_FEATURE_ENABLED_HFP := true AUDIO_FEATURE_ENABLED_HFP := true
AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false AUDIO_FEATURE_ENABLED_INCALL_MUSIC := false
AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := false
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
cc_binary { cc_binary {
name: "android.hardware.biometrics.fingerprint@2.0-service.kitakami", name: "android.hardware.biometrics.fingerprint@2.1-service.kitakami",
defaults: ["hidl_defaults"], defaults: ["hidl_defaults"],
relative_install_path: "hw", relative_install_path: "hw",
init_rc: ["android.hardware.biometrics.fingerprint@2.0-service.kitakami.rc"], init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.kitakami.rc"],
srcs: ["service.cpp", "BiometricsFingerprint.cpp"], srcs: ["service.cpp", "BiometricsFingerprint.cpp"],
shared_libs: [ shared_libs: [
"libutils", "libutils",
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#define LOG_TAG "android.hardware.biometrics.fingerprint@2.0-service.kitakami" #define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.kitakami"
#define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.0-service.kitakami" #define LOG_VERBOSE "android.hardware.biometrics.fingerprint@2.1-service.kitakami"
#include <hardware/hw_auth_token.h> #include <hardware/hw_auth_token.h>
...@@ -184,30 +184,8 @@ Return<RequestStatus> BiometricsFingerprint::cancel() { ...@@ -184,30 +184,8 @@ Return<RequestStatus> BiometricsFingerprint::cancel() {
return ErrorFilter(ret); return ErrorFilter(ret);
} }
#define MAX_FINGERPRINTS 100
typedef int (*enumerate_2_0)(struct fingerprint_device *dev, fingerprint_finger_id_t *results,
uint32_t *max_size);
Return<RequestStatus> BiometricsFingerprint::enumerate() { Return<RequestStatus> BiometricsFingerprint::enumerate() {
fingerprint_finger_id_t results[MAX_FINGERPRINTS]; return ErrorFilter(mDevice->enumerate(mDevice));
uint32_t n = MAX_FINGERPRINTS;
enumerate_2_0 enumerate = (enumerate_2_0) mDevice->enumerate;
int ret = enumerate(mDevice, results, &n);
if (ret == 0 && mClientCallback != nullptr) {
ALOGD("Got %d enumerated templates", n);
for (uint32_t i = 0; i < n; i++) {
const uint64_t devId = reinterpret_cast<uint64_t>(mDevice);
const auto& fp = results[i];
ALOGD("onEnumerate(fid=%d, gid=%d)", fp.fid, fp.gid);
if (!mClientCallback->onEnumerate(devId, fp.fid, fp.gid, n - i - 1).isOk()) {
ALOGE("failed to invoke fingerprint onEnumerate callback");
}
}
}
return ErrorFilter(ret);
} }
Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) { Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
...@@ -365,7 +343,16 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t *msg) { ...@@ -365,7 +343,16 @@ void BiometricsFingerprint::notify(const fingerprint_msg_t *msg) {
} }
break; break;
case FINGERPRINT_TEMPLATE_ENUMERATING: case FINGERPRINT_TEMPLATE_ENUMERATING:
// ignored, won't happen for 2.0 HALs ALOGD("onEnumerate(fid=%d, gid=%d, rem=%d)",
msg->data.enumerated.finger.fid,
msg->data.enumerated.finger.gid,
msg->data.enumerated.remaining_templates);
if (!thisPtr->mClientCallback->onEnumerate(devId,
msg->data.enumerated.finger.fid,
msg->data.enumerated.finger.gid,
msg->data.enumerated.remaining_templates).isOk()) {
ALOGE("failed to invoke fingerprint onEnumerate callback");
}
break; break;
} }
} }
......
service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.0-service.kitakami service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.kitakami
# "class hal" causes a race condition on some devices due to files created # "class hal" causes a race condition on some devices due to files created
# in /data. As a workaround, postpone startup until later in boot once # in /data. As a workaround, postpone startup until later in boot once
# /data is mounted. # /data is mounted.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment