|
|
@ -10,6 +10,7 @@ import android.graphics.drawable.AnimationDrawable; |
|
|
|
import android.graphics.drawable.ColorDrawable; |
|
|
|
import android.graphics.drawable.ColorDrawable; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Handler; |
|
|
|
|
|
|
|
import android.os.Looper; |
|
|
|
import android.view.LayoutInflater; |
|
|
|
import android.view.LayoutInflater; |
|
|
|
import android.view.View; |
|
|
|
import android.view.View; |
|
|
|
import android.widget.ImageView; |
|
|
|
import android.widget.ImageView; |
|
|
@ -113,6 +114,8 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
protected void onResume() { |
|
|
|
protected void onResume() { |
|
|
|
super.onResume(); |
|
|
|
super.onResume(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainApplication.currentActivity = this; |
|
|
|
|
|
|
|
|
|
|
|
Intent incomingIntent = getIntent(); |
|
|
|
Intent incomingIntent = getIntent(); |
|
|
|
String action = incomingIntent.getAction(); |
|
|
|
String action = incomingIntent.getAction(); |
|
|
|
if (Constants.INTENT_REFRESH.equalsIgnoreCase(action)) { |
|
|
|
if (Constants.INTENT_REFRESH.equalsIgnoreCase(action)) { |
|
|
@ -316,7 +319,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
PaymentService service = new PaymentService(this); |
|
|
|
service.getEventLog(MainApplication.incomingCode); |
|
|
|
service.getEventLog(MainApplication.incomingCode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void receiveMessageIC(Object... args) { |
|
|
|
private void receiveMessageIC(Object... args) { |
|
|
@ -331,16 +333,6 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// todo adapt for cancel on kiosk / polling
|
|
|
|
|
|
|
|
if (MainApplication.working) { |
|
|
|
|
|
|
|
Logger.logE("Received IC Verification Message but IM30 is currently working!"); |
|
|
|
|
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
|
|
|
|
service.verifyReject(MainApplication.incomingCode); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
startWork(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MainApplication.incomingCode != null && !MainApplication.incomingCode.isEmpty()) { |
|
|
|
if (MainApplication.incomingCode != null && !MainApplication.incomingCode.isEmpty()) { |
|
|
|
initViews(); |
|
|
|
initViews(); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
@ -354,10 +346,26 @@ public class MainActivity extends AppCompatActivity implements CallableInterface |
|
|
|
|
|
|
|
|
|
|
|
// NRIC
|
|
|
|
// NRIC
|
|
|
|
if (source.equalsIgnoreCase(IDVerificationService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
if (source.equalsIgnoreCase(IDVerificationService.SUCCESS_GET_EVENT_LOG)) { |
|
|
|
|
|
|
|
EventLogDetailed incomingEventLogDetailed = (EventLogDetailed) object; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean cancelAction = incomingEventLogDetailed.getAction().equalsIgnoreCase(Constants.IC_FUNCTION_CANCEL); |
|
|
|
|
|
|
|
if (cancelAction) { |
|
|
|
|
|
|
|
if (MainApplication.working && MainApplication.currentActivity instanceof ICCActivity) { |
|
|
|
|
|
|
|
((ICCActivity) MainApplication.currentActivity).cancel(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (MainApplication.working) { |
|
|
|
|
|
|
|
Logger.logE("Received IC Verification Message but IM30 is currently working!"); |
|
|
|
|
|
|
|
IDVerificationService service = new IDVerificationService(this); |
|
|
|
|
|
|
|
service.verifyReject(MainApplication.incomingCode); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
startWork(); |
|
|
|
MainApplication.currentCode = MainApplication.incomingCode; |
|
|
|
MainApplication.currentCode = MainApplication.incomingCode; |
|
|
|
MainApplication.currentEventLogDetailed = (EventLogDetailed) object; |
|
|
|
MainApplication.currentEventLogDetailed = incomingEventLogDetailed; |
|
|
|
Intent i = new Intent(MainActivity.this, ICCActivity.class); |
|
|
|
Intent i = new Intent(MainActivity.this, ICCActivity.class); |
|
|
|
icVerificationLauncher.launch(i); |
|
|
|
icVerificationLauncher.launch(i); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (source.equalsIgnoreCase(IDVerificationService.FAIL_GET_EVENT_LOG)) { |
|
|
|
} else if (source.equalsIgnoreCase(IDVerificationService.FAIL_GET_EVENT_LOG)) { |
|
|
|
resetView(); //todo try again? fail?
|
|
|
|
resetView(); //todo try again? fail?
|
|
|
|
} |
|
|
|
} |
|
|
|