自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ITokenProvider
public
interface
ITokenProvider
com.android.tradefed.invoker.shard.token.ITokenProvider
|
用于描述可提供特定设备令牌的对象的接口。每个实现都可以检查一个或多个令牌。
令牌是特定设备上存在的特殊属性。
在分片期间使用令牌,以确保针对提供令牌的设备运行请求特定令牌的测试。
摘要
公共方法
hasToken
public abstract boolean hasToken (ITestDevice device,
TokenProperty token)
查询并返回设备是否具有特定令牌。
参数 |
device |
ITestDevice :查询其令牌的设备。 |
token |
TokenProperty :要检查的令牌 |
返回 |
boolean |
如果设备具有令牌,则为 true;否则为 false。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# ITokenProvider\n==============\n\n\n`\npublic\n\n\ninterface\nITokenProvider\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------|\n| com.android.tradefed.invoker.shard.token.ITokenProvider |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [CecControllerTokenProvider](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/CecControllerTokenProvider.html), [TelephonyTokenProvider](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.html) |---------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------| | [CecControllerTokenProvider](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/CecControllerTokenProvider.html) | Token provider for Consumer Electronics Control (CEC) related tokens. | | [TelephonyTokenProvider](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/TelephonyTokenProvider.html) | Token provider for telephony related tokens. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface describing an object that can provide the tokens of a particular device. Each\nimplementation can check one or several tokens.\n\nA token is a special property present on the particular device.\n\nTokens are used during sharding to ensure tests requesting a particular tokens are run against\nthe device providing the token.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[hasToken](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/ITokenProvider.html#hasToken(com.android.tradefed.device.ITestDevice,%20com.android.tradefed.invoker.shard.token.TokenProperty))`(`[ITestDevice](../../../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` device, `[TokenProperty](../../../../../../../../reference/tradefed/com/android/tradefed/invoker/shard/token/TokenProperty.html)` token) ` Query and return whether or not the device has a particular token. |\n\nPublic methods\n--------------\n\n### hasToken\n\n```\npublic abstract boolean hasToken (ITestDevice device, \n TokenProperty token)\n```\n\nQuery and return whether or not the device has a particular token.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------------------------------------|\n| `device` | `ITestDevice`: Device queried for its tokens. \u003cbr /\u003e |\n| `token` | `TokenProperty`: The token to check \u003cbr /\u003e |\n\n| Returns ||\n|-----------|-----------------------------------------------------------|\n| `boolean` | True if the device has the token, false otherwise. \u003cbr /\u003e |"]]