精简了称sdk调用

This commit is contained in:
zxj
2025-08-06 14:45:07 +08:00
parent bbf2e605b5
commit 08611349aa
15 changed files with 545 additions and 101 deletions
@@ -129,7 +129,8 @@ public class DualCameraHelper implements Camera.PreviewCallback {
//相机数量为2则打开1,1则打开0,相机ID 1为前置,0为后置
mCameraId = Camera.getNumberOfCameras() - 1;
//若指定了相机ID且该相机存在,则打开指定的相机
if (specificCameraId != null && specificCameraId <= mCameraId) {
// if (specificCameraId != null && specificCameraId <= mCameraId) {
if (specificCameraId != null) {
mCameraId = specificCameraId;
}
@@ -158,7 +158,7 @@ public class RecognizeViewModel extends ViewModel implements RecognizeCallback {
private MutableLiveData<String> drawRectInfoText = new MutableLiveData<>();
private MutableLiveData<String> recognizeUserId = new MutableLiveData<>();
private MutableLiveData<CompareResult> recognizeUserId = new MutableLiveData<>();
/**
* 检测ir活体前,是否需要更新faceData
@@ -475,7 +475,7 @@ public class RecognizeViewModel extends ViewModel implements RecognizeCallback {
Disposable disposable = Observable.just(true).observeOn(AndroidSchedulers.mainThread()).subscribe(aBoolean -> {
if (similarPass) {
if (recognizeUserId != null) {
recognizeUserId.postValue(compareResult.getFaceEntity().getUserName());
recognizeUserId.postValue(compareResult);
}
boolean isAdded = false;
List<CompareResult> compareResults = compareResultList.getValue();
@@ -541,7 +541,7 @@ public class RecognizeViewModel extends ViewModel implements RecognizeCallback {
return recognizeNotice;
}
public MutableLiveData<String> getRecognizeUserId() {
public MutableLiveData<CompareResult> getRecognizeUserId() {
return recognizeUserId;
}