|
@ -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); |
|
|
|
|
|
if (reason == AuthenticationActivity.AuthFailReason.SIMILARITY && BuildConfig.IS_OFFLINE_VERSION) |
|
|
|
|
|
{ |
|
|
|
|
|
fragment.setVerificationTime((int)((double)(verifEndTime - verifStartTime) / 1e6)); |
|
|
|
|
|
} |
|
|
|
|
|
fragment.setFailReason(reason); |
|
|
|
|
|
showFragment(fragment); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new SweetAlertDialog(RegisterActivity.this, SweetAlertDialog.WARNING_TYPE) |
|
|
|
|
|
.setTitleText("User is not correct face") |
|
|
|
|
|
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void onClick(SweetAlertDialog sDialog) { |
|
|
|
|
|
finish(); |
|
|
|
|
|
} |
|
|
|
|
|
}).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(); |
|
|
} |
|
|
} |
|
|