1 package com.android.cts.verifier.nfc.hce; 2 3 import android.content.ComponentName; 4 import android.content.Context; 5 import android.content.Intent; 6 import android.os.Bundle; 7 8 import com.android.cts.verifier.R; 9 import com.android.cts.verifier.nfc.NfcDialogs; 10 11 public class ConflictingNonPaymentEmulatorActivity extends BaseEmulatorActivity { 12 @Override onCreate(Bundle savedInstanceState)13 protected void onCreate(Bundle savedInstanceState) { 14 super.onCreate(savedInstanceState); 15 setContentView(R.layout.pass_fail_text); 16 setPassFailButtonClickListeners(); 17 getPassButton().setEnabled(false); 18 setupServices(this, TransportService1.COMPONENT, TransportService2.COMPONENT); 19 } 20 21 @Override onResume()22 protected void onResume() { 23 super.onResume(); 24 } 25 26 @Override onServicesSetup(boolean result)27 void onServicesSetup(boolean result) { 28 NfcDialogs.createHceTapReaderDialog(this, 29 getString(R.string.nfc_hce_conflicting_non_payment_help)).show(); 30 } 31 buildReaderIntent(Context context)32 public static Intent buildReaderIntent(Context context) { 33 Intent readerIntent = new Intent(context, SimpleReaderActivity.class); 34 readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS, 35 TransportService2.APDU_COMMAND_SEQUENCE); 36 readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES, 37 TransportService2.APDU_RESPOND_SEQUENCE); 38 readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL, 39 context.getString(R.string.nfc_hce_conflicting_non_payment_reader)); 40 return readerIntent; 41 } 42 43 @Override onApduSequenceComplete(ComponentName component, long duration)44 void onApduSequenceComplete(ComponentName component, long duration) { 45 if (component.equals(TransportService2.COMPONENT)) { 46 getPassButton().setEnabled(true); 47 } 48 } 49 } 50