1 /* 2 * Copyright (C) 2019 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.p2p.testcase; 18 19 import android.content.Context; 20 import android.net.wifi.p2p.WifiP2pConfig; 21 22 import java.util.ArrayList; 23 24 /** 25 * Test suite to join a p2p group with 2G band config. 26 */ 27 public class P2pClientWithConfig2gBandTestSuite { 28 29 private static ArrayList<ReqTestCase> sTestSuite = null; 30 31 /** 32 * Return test suite. 33 * @param context 34 * @return 35 */ getTestSuite(Context context)36 public static ArrayList<ReqTestCase> getTestSuite(Context context) { 37 initialize(context); 38 return sTestSuite; 39 } 40 41 /** 42 * Return the specified test case. 43 * @param context 44 * @param testId 45 * @return 46 */ getTestCase(Context context, String testId)47 public static ReqTestCase getTestCase(Context context, 48 String testId) { 49 initialize(context); 50 51 for (ReqTestCase test: sTestSuite) { 52 if (test.getTestId().equals(testId)) { 53 return test; 54 } 55 } 56 return null; 57 } 58 initialize(Context context)59 private static void initialize(Context context) { 60 if (sTestSuite != null) { 61 return; 62 } 63 64 sTestSuite = new ArrayList<ReqTestCase>(); 65 sTestSuite.add(new P2pClientConfig2gBandTestCase(context)); 66 } 67 } 68