• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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 package com.android.tradefed.invoker.shard.token;
17 
18 import com.android.tradefed.device.ITestDevice;
19 
20 /**
21  * Interface describing an object that can provide the tokens of a particular device. Each
22  * implementation can check one or several tokens.
23  *
24  * <p>A token is a special property present on the particular device.
25  *
26  * <p>Tokens are used during sharding to ensure tests requesting a particular tokens are run against
27  * the device providing the token.
28  */
29 public interface ITokenProvider {
30 
31     /**
32      * Query and return whether or not the device has a particular token.
33      *
34      * @param device Device queried for its tokens.
35      * @param token The token to check
36      * @return True if the device has the token, false otherwise.
37      */
hasToken(ITestDevice device, TokenProperty token)38     boolean hasToken(ITestDevice device, TokenProperty token);
39 }
40