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 SingleNonPaymentEmulatorActivity 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);
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, null).show();
29     }
30 
buildReaderIntent(Context context)31     public static Intent buildReaderIntent(Context context) {
32         Intent readerIntent = new Intent(context, SimpleReaderActivity.class);
33         readerIntent.putExtra(SimpleReaderActivity.EXTRA_APDUS,
34                 TransportService1.APDU_COMMAND_SEQUENCE);
35         readerIntent.putExtra(SimpleReaderActivity.EXTRA_RESPONSES,
36                 TransportService1.APDU_RESPOND_SEQUENCE);
37         readerIntent.putExtra(SimpleReaderActivity.EXTRA_LABEL,
38                 context.getString(R.string.nfc_hce_single_non_payment_reader));
39         return readerIntent;
40     }
41 
42     @Override
onApduSequenceComplete(ComponentName component, long duration)43     void onApduSequenceComplete(ComponentName component, long duration) {
44         if (component.equals(TransportService1.COMPONENT)) {
45             getPassButton().setEnabled(true);
46         }
47     }
48 }
49