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.location.base;
18 
19 import android.content.ContentResolver;
20 import android.content.Intent;
21 
22 /**
23  * An interface that defines a facade for {@link BaseGnssTestActivity}, so it can be consumed by
24  * other CtsVerifier Sensor Test Framework helper components.
25  */
26 public interface IGnssTestStateContainer {
27 
28     /**
29      * Waits for the operator to acknowledge to continue execution.
30      */
waitForUserToContinue()31     void waitForUserToContinue() throws InterruptedException;
32 
33     /**
34      * @param resId The resource Id to extract.
35      * @return The extracted string.
36      */
getString(int resId)37     String getString(int resId);
38 
39     /**
40      * @param resId  The resource Id to extract.
41      * @param params The parameters to format the string represented by the resource contents.
42      * @return The formatted extracted string.
43      */
getString(int resId, Object... params)44     String getString(int resId, Object... params);
45 
46     /**
47      * Starts an Activity and blocks until it completes, then it returns its result back to the
48      * client.
49      *
50      * @param action The action to start the Activity.
51      * @return The Activity's result code.
52      */
executeActivity(String action)53     int executeActivity(String action) throws InterruptedException;
54 
55     /**
56      * Starts an Activity and blocks until it completes, then it returns its result back to the
57      * client.
58      *
59      * @param intent The intent to start the Activity.
60      * @return The Activity's result code.
61      */
executeActivity(Intent intent)62     int executeActivity(Intent intent) throws InterruptedException;
63 
64     /**
65      * @return The {@link ContentResolver} associated with the test.
66      */
getContentResolver()67     ContentResolver getContentResolver();
68 }
69