Face valid during checkin check out time
This commit is contained in:
parent
fe677f72a2
commit
07e1fc350f
@ -67,11 +67,12 @@ public class VerifyApiImplLunaLocal implements VerifyApiInterface {
|
|||||||
|
|
||||||
SearchResult searchResult = new SearchResult();
|
SearchResult searchResult = new SearchResult();
|
||||||
searchResult.setPersons(personsSearchList);
|
searchResult.setPersons(personsSearchList);
|
||||||
|
System.out.println("personsSearchList : " + personsSearchList);
|
||||||
onSuccess(searchResult);
|
onSuccess(searchResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onFail(Throwable throwable) {
|
private void onFail(Throwable throwable) {
|
||||||
|
System.out.println("On Fail Face : " + throwable);
|
||||||
listener.onVerificationFail(throwable);
|
listener.onVerificationFail(throwable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ public class NetworkModule {
|
|||||||
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
|
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||||
// Create an ssl socket factory with our all-trusting manager
|
// Create an ssl socket factory with our all-trusting manager
|
||||||
final SSLSocketFactory m_sslSocketFactory = sslContext.getSocketFactory();
|
final SSLSocketFactory m_sslSocketFactory = sslContext.getSocketFactory();
|
||||||
return new OkHttpClient.Builder()
|
return new OkHttpClient().newBuilder()
|
||||||
.addInterceptor(logger)
|
|
||||||
.sslSocketFactory(m_sslSocketFactory)
|
.sslSocketFactory(m_sslSocketFactory)
|
||||||
.build();
|
.build();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -119,7 +119,7 @@ public class RegisterActivity extends ToolbarActivity implements RegisterFragmen
|
|||||||
|
|
||||||
String valueFromApiCheckIn;
|
String valueFromApiCheckIn;
|
||||||
SharedPreferences shared;
|
SharedPreferences shared;
|
||||||
|
String RegisterUser;
|
||||||
|
|
||||||
@SuppressLint("MissingInflatedId")
|
@SuppressLint("MissingInflatedId")
|
||||||
@Override
|
@Override
|
||||||
@ -132,7 +132,8 @@ public class RegisterActivity extends ToolbarActivity implements RegisterFragmen
|
|||||||
setToolbar();
|
setToolbar();
|
||||||
|
|
||||||
shared = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
|
shared = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
|
||||||
String login = shared.getString("login","");
|
login = shared.getString("login","");
|
||||||
|
RegisterUser = shared.getString("RegisterUser","");
|
||||||
String Descriptor = shared.getString("Descriptor","");
|
String Descriptor = shared.getString("Descriptor","");
|
||||||
|
|
||||||
System.out.println("Value of login and Descriptor " + preferences.getUsername()+" ");
|
System.out.println("Value of login and Descriptor " + preferences.getUsername()+" ");
|
||||||
@ -354,7 +355,7 @@ public class RegisterActivity extends ToolbarActivity implements RegisterFragmen
|
|||||||
private void verifyPhoto(Bitmap bitmap){
|
private void verifyPhoto(Bitmap bitmap){
|
||||||
Log.i("Route", "verifyPhoto fromLoginPage");
|
Log.i("Route", "verifyPhoto fromLoginPage");
|
||||||
fragment.showWaitState();
|
fragment.showWaitState();
|
||||||
login=preferences.getUsername();
|
login = RegisterUser;
|
||||||
System.out.println("Value of login while verification " + login);
|
System.out.println("Value of login while verification " + login);
|
||||||
try {
|
try {
|
||||||
if (thread != null)
|
if (thread != null)
|
||||||
@ -562,9 +563,11 @@ public class RegisterActivity extends ToolbarActivity implements RegisterFragmen
|
|||||||
if (person.similarity > Config.MIN_SIMILARITY) {
|
if (person.similarity > Config.MIN_SIMILARITY) {
|
||||||
onFaceAuthSuccess();
|
onFaceAuthSuccess();
|
||||||
} else {
|
} else {
|
||||||
|
System.out.println("on Face AuthFail1 "+ login);
|
||||||
onFaceAuthFail(AuthenticationActivity.AuthFailReason.SIMILARITY);
|
onFaceAuthFail(AuthenticationActivity.AuthFailReason.SIMILARITY);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
System.out.println("on Face AuthFail2 "+ login);
|
||||||
onFaceAuthFail(AuthenticationActivity.AuthFailReason.SIMILARITY);
|
onFaceAuthFail(AuthenticationActivity.AuthFailReason.SIMILARITY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -641,16 +644,25 @@ public class RegisterActivity extends ToolbarActivity implements RegisterFragmen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onFaceAuthFail(AuthenticationActivity.AuthFailReason reason) {
|
private void onFaceAuthFail(AuthenticationActivity.AuthFailReason reason) {
|
||||||
System.out.println("Root fail");
|
System.out.println("Root fail : " + faceFailCount);
|
||||||
if (faceFailCount < 4) {
|
if (faceFailCount < 4) {
|
||||||
final FaceNotRecognizedFragment fragment = FaceNotRecognizedFragment.newInstance();
|
|
||||||
fragment.setListener(this);
|
new SweetAlertDialog(RegisterActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||||
if (reason == AuthenticationActivity.AuthFailReason.SIMILARITY && BuildConfig.IS_OFFLINE_VERSION)
|
.setTitleText("User is not correct face")
|
||||||
{
|
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||||
fragment.setVerificationTime((int)((double)(verifEndTime - verifStartTime) / 1e6));
|
@Override
|
||||||
}
|
public void onClick(SweetAlertDialog sDialog) {
|
||||||
fragment.setFailReason(reason);
|
finish();
|
||||||
showFragment(fragment);
|
}
|
||||||
|
}).show();
|
||||||
|
// final FaceNotRecognizedFragment fragment = FaceNotRecognizedFragment.newInstance();
|
||||||
|
// fragment.setListener(this);
|
||||||
|
// if (reason == AuthenticationActivity.AuthFailReason.SIMILARITY && BuildConfig.IS_OFFLINE_VERSION)
|
||||||
|
// {
|
||||||
|
// fragment.setVerificationTime((int)((double)(verifEndTime - verifStartTime) / 1e6));
|
||||||
|
// }
|
||||||
|
// fragment.setFailReason(reason);
|
||||||
|
// showFragment(fragment);
|
||||||
} else {
|
} else {
|
||||||
showFail();
|
showFail();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user