1 /*
2  * Copyright (C) 2016 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.hcef;
18 
19 import android.content.Intent;
20 import android.content.pm.PackageManager;
21 import android.os.Bundle;
22 
23 import com.android.cts.verifier.ArrayTestListAdapter;
24 import com.android.cts.verifier.PassFailButtons;
25 import com.android.cts.verifier.R;
26 import com.android.cts.verifier.TestListAdapter.TestListItem;
27 
28 /** Activity that lists all the NFC HCE reader tests. */
29 public class HceFReaderTestActivity 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(
40                 PackageManager.FEATURE_NFC_HOST_CARD_EMULATION_NFCF)) {
41             adapter.add(TestListItem.newCategory(this, R.string.nfc_hce_f_reader_tests));
42 
43             adapter.add(TestListItem.newTest(this, R.string.nfc_hce_f_reader,
44                     HceFReaderActivity.class.getName(),
45                     new Intent(this, HceFReaderActivity.class), null));
46 
47         }
48 
49         setTestListAdapter(adapter);
50     }
51 }
52