1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.cts.verifier.nfc.hce; 18 19 import com.android.cts.verifier.ArrayTestListAdapter; 20 import com.android.cts.verifier.PassFailButtons; 21 import com.android.cts.verifier.R; 22 import com.android.cts.verifier.TestListAdapter.TestListItem; 23 24 import android.content.Intent; 25 import android.content.pm.PackageManager; 26 import android.os.Bundle; 27 28 /** Activity that lists all the NFC HCE reader tests. */ 29 public class HceReaderTestActivity extends PassFailButtons.TestListActivity { 30 @Override onCreate(Bundle savedInstanceState)31 protected void onCreate(Bundle savedInstanceState) { 32 super.onCreate(savedInstanceState); 33 setContentView(R.layout.pass_fail_list); 34 setInfoResources(R.string.nfc_test, R.string.nfc_hce_reader_test_info, 0); 35 setPassFailButtonClickListeners(); 36 37 ArrayTestListAdapter adapter = new ArrayTestListAdapter(this); 38 39 if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) { 40 adapter.add(TestListItem.newCategory(this, R.string.nfc_hce_reader_tests)); 41 /* 42 * Only add this test when supported in platform 43 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_default_route_reader, 44 SimpleReaderActivity.class.getName(), 45 DefaultRouteEmulatorActivity.buildReaderIntent(this), null)); 46 */ 47 48 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_protocol_params_reader, 49 ProtocolParamsReaderActivity.class.getName(), 50 new Intent(this, ProtocolParamsReaderActivity.class), null)); 51 52 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_payment_reader, 53 SimpleReaderActivity.class.getName(), 54 SinglePaymentEmulatorActivity.buildReaderIntent(this), null)); 55 56 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_dual_payment_reader, 57 SimpleReaderActivity.class.getName(), 58 DualPaymentEmulatorActivity.buildReaderIntent(this), null)); 59 60 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_change_default_reader, 61 SimpleReaderActivity.class.getName(), 62 ChangeDefaultEmulatorActivity.buildReaderIntent(this), null)); 63 64 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_payment_reader, 65 SimpleReaderActivity.class.getName(), 66 ForegroundPaymentEmulatorActivity.buildReaderIntent(this), null)); 67 68 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_non_payment_reader, 69 SimpleReaderActivity.class.getName(), 70 SingleNonPaymentEmulatorActivity.buildReaderIntent(this), null)); 71 72 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_dual_non_payment_reader, 73 SimpleReaderActivity.class.getName(), 74 DualNonPaymentEmulatorActivity.buildReaderIntent(this), null)); 75 76 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_conflicting_non_payment_reader, 77 SimpleReaderActivity.class.getName(), 78 ConflictingNonPaymentEmulatorActivity.buildReaderIntent(this), null)); 79 80 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_foreground_non_payment_reader, 81 SimpleReaderActivity.class.getName(), 82 ForegroundNonPaymentEmulatorActivity.buildReaderIntent(this), null)); 83 84 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_throughput_reader, 85 SimpleReaderActivity.class.getName(), 86 ThroughputEmulatorActivity.buildReaderIntent(this), null)); 87 88 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_tap_test_reader, 89 SimpleReaderActivity.class.getName(), 90 TapTestEmulatorActivity.buildReaderIntent(this), null)); 91 92 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_offhost_service_reader, 93 SimpleReaderActivity.class.getName(), 94 OffHostEmulatorActivity.buildReaderIntent(this), null)); 95 96 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_on_and_offhost_service_reader, 97 SimpleReaderActivity.class.getName(), 98 OnAndOffHostEmulatorActivity.buildReaderIntent(this), null)); 99 100 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_dynamic_aids_reader, 101 SimpleReaderActivity.class.getName(), 102 DynamicAidEmulatorActivity.buildReaderIntent(this), null)); 103 104 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_reader, 105 SimpleReaderActivity.class.getName(), 106 PrefixPaymentEmulatorActivity.buildReaderIntent(this), null)); 107 108 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_payment_prefix_aids_reader_2, 109 SimpleReaderActivity.class.getName(), 110 PrefixPaymentEmulator2Activity.buildReaderIntent(this), null)); 111 112 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_prefix_aids_reader, 113 SimpleReaderActivity.class.getName(), 114 DualNonPaymentPrefixEmulatorActivity.buildReaderIntent(this), null)); 115 116 adapter.add(TestListItem.newTest(this, R.string.nfc_hce_other_conflicting_prefix_aids_reader, 117 SimpleReaderActivity.class.getName(), 118 ConflictingNonPaymentPrefixEmulatorActivity.buildReaderIntent(this), null)); 119 } 120 121 setTestListAdapter(adapter); 122 } 123 } 124