Home | History | Annotate | Download | only in hce
      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 emulator tests. */
     29 public class HceEmulatorTestActivity extends PassFailButtons.TestListActivity {
     30 
     31     @Override
     32     protected void onCreate(Bundle savedInstanceState) {
     33         super.onCreate(savedInstanceState);
     34         setContentView(R.layout.pass_fail_list);
     35         setInfoResources(R.string.nfc_test, R.string.nfc_hce_emulator_test_info, 0);
     36         setPassFailButtonClickListeners();
     37 
     38         ArrayTestListAdapter adapter = new ArrayTestListAdapter(this);
     39 
     40         if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) {
     41             adapter.add(TestListItem.newCategory(this, R.string.nfc_hce_emulator_tests));
     42 
     43             /*
     44              * Only add this test when supported in platform
     45             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_default_route_emulator,
     46                     DefaultRouteEmulatorActivity.class.getName(),
     47                     new Intent(this, DefaultRouteEmulatorActivity.class), null));
     48             */
     49             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_protocol_params_emulator,
     50                     ProtocolParamsEmulatorActivity.class.getName(),
     51                     new Intent(this, ProtocolParamsEmulatorActivity.class), null));
     52 
     53             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_payment_emulator,
     54                     SinglePaymentEmulatorActivity.class.getName(),
     55                     new Intent(this, SinglePaymentEmulatorActivity.class), null));
     56 
     57             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_dual_payment_emulator,
     58                     DualPaymentEmulatorActivity.class.getName(),
     59                     new Intent(this, DualPaymentEmulatorActivity.class), null));
     60 
     61             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_change_default_emulator,
     62                     ChangeDefaultEmulatorActivity.class.getName(),
     63                     new Intent(this, ChangeDefaultEmulatorActivity.class), null));
     64 
     65 
     66             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_single_non_payment_emulator,
     67                     SingleNonPaymentEmulatorActivity.class.getName(),
     68                     new Intent(this, SingleNonPaymentEmulatorActivity.class), null));
     69 
     70             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_dual_non_payment_emulator,
     71                     DualNonPaymentEmulatorActivity.class.getName(),
     72                     new Intent(this, DualNonPaymentEmulatorActivity.class), null));
     73 
     74             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_conflicting_non_payment_emulator,
     75                     ConflictingNonPaymentEmulatorActivity.class.getName(),
     76                     new Intent(this, ConflictingNonPaymentEmulatorActivity.class), null));
     77 
     78             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_throughput_emulator,
     79                     ThroughputEmulatorActivity.class.getName(),
     80                     new Intent(this, ThroughputEmulatorActivity.class), null));
     81 
     82             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_tap_test_emulator,
     83                     TapTestEmulatorActivity.class.getName(),
     84                     new Intent(this, TapTestEmulatorActivity.class), null));
     85 
     86             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_offhost_service_emulator,
     87                     OffHostEmulatorActivity.class.getName(),
     88                     new Intent(this, OffHostEmulatorActivity.class), null));
     89 
     90             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_on_and_offhost_service_emulator,
     91                     OnAndOffHostEmulatorActivity.class.getName(),
     92                     new Intent(this, OnAndOffHostEmulatorActivity.class), null));
     93 
     94         }
     95 
     96         setTestListAdapter(adapter);
     97     }
     98 }
     99