自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
DeviceBaselineSetter
public
abstract
class
DeviceBaselineSetter
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.suite.checker.baseline.DeviceBaselineSetter
|
用于创建设备基准设置的抽象类。
摘要
公共构造函数
DeviceBaselineSetter
public DeviceBaselineSetter (JSONObject object,
String name)
参数 |
object |
JSONObject |
name |
String |
公共方法
getMinimalApiLevel
public int getMinimalApiLevel ()
获取 setter 支持的最低 API 级别。
getName
public String getName ()
获取 setter 的唯一名称。
isExperimental
public boolean isExperimental ()
基准设置是否处于实验阶段。它用于发布新设置。只有处于实验阶段的设置才能通过 enable-experimental-device-baseline-setters 选项选择启用。除非将 enable-device-baseline-settings 选项设为 false,否则系统会强制应用其他非实验性设置。
setBaseline
public abstract boolean setBaseline (ITestDevice mDevice)
为设备设置基准设置。
本页面上的内容和代码示例受内容许可部分所述许可的限制。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,["# DeviceBaselineSetter\n====================\n\n\n`\npublic\n\n\nabstract\nclass\nDeviceBaselineSetter\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.suite.checker.baseline.DeviceBaselineSetter |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known direct subclasses [CommandBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/CommandBaselineSetter.html), [LockSettingsBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/LockSettingsBaselineSetter.html), [SettingsBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/SettingsBaselineSetter.html) |------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------| | [CommandBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/CommandBaselineSetter.html) | A common setter to handle device baseline settings via adb shell commands. | | [LockSettingsBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/LockSettingsBaselineSetter.html) | A setter to remove screen lock settings. | | [SettingsBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/SettingsBaselineSetter.html) | A common setter to handle device baseline settings via ITestDevice.setSetting. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAbstract class used to create a device baseline setting.\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[DeviceBaselineSetter](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/DeviceBaselineSetter.html#DeviceBaselineSetter(org.json.JSONObject,%20java.lang.String))`(JSONObject object, String name) ` |\n\n| ### Public methods ||\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[getMinimalApiLevel](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/DeviceBaselineSetter.html#getMinimalApiLevel())`() ` Gets the minimal API level supported by the setter. |\n| ` String` | ` `[getName](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/DeviceBaselineSetter.html#getName())`() ` Gets the unique name of the setter. |\n| ` boolean` | ` `[isExperimental](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/DeviceBaselineSetter.html#isExperimental())`() ` Whether the baseline setting is under experiment stage. |\n| ` abstract boolean` | ` `[setBaseline](../../../../../../../../reference/tradefed/com/android/tradefed/suite/checker/baseline/DeviceBaselineSetter.html#setBaseline(com.android.tradefed.device.ITestDevice))`(`[ITestDevice](../../../../../../../../reference/tradefed/com/android/tradefed/device/ITestDevice.html)` mDevice) ` Sets the baseline setting for the device. |\n\nPublic constructors\n-------------------\n\n### DeviceBaselineSetter\n\n```\npublic DeviceBaselineSetter (JSONObject object, \n String name)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|---------------------|\n| `object` | `JSONObject` \u003cbr /\u003e |\n| `name` | `String` \u003cbr /\u003e |\n\n| Throws ||\n|-----------------|---|\n| `JSONException` | |\n\nPublic methods\n--------------\n\n### getMinimalApiLevel\n\n```\npublic int getMinimalApiLevel ()\n```\n\nGets the minimal API level supported by the setter.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------|\n| `int` | \u003cbr /\u003e |\n\n### getName\n\n```\npublic String getName ()\n```\n\nGets the unique name of the setter.\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|--------|\n| `String` | \u003cbr /\u003e |\n\n### isExperimental\n\n```\npublic boolean isExperimental ()\n```\n\nWhether the baseline setting is under experiment stage. It is used for the rollout of a new\nsetting. Only the settings under experiment can be optionally enabled via the option\nenable-experimental-device-baseline-setters. Other non experimental settings are force\napplied unless the option enable-device-baseline-settings is set to false.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n### setBaseline\n\n```\npublic abstract boolean setBaseline (ITestDevice mDevice)\n```\n\nSets the baseline setting for the device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------|\n| `mDevice` | `ITestDevice` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |\n\n| Throws ||\n|----------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DeviceNotAvailableException](../../../../../../../../reference/tradefed/com/android/tradefed/device/DeviceNotAvailableException.html) | |"]]