diff --git a/.DS_Store b/.DS_Store index d9eefd5bf..71a5cd1ad 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/docs/.DS_Store b/docs/.DS_Store index 8652c4988..0d58bea42 100644 Binary files a/docs/.DS_Store and b/docs/.DS_Store differ diff --git a/docs/_posts/2019-12-02-Profile.md b/docs/_posts/2019-12-02-Profile.md index 4cc8fbd71..b11cea85f 100644 --- a/docs/_posts/2019-12-02-Profile.md +++ b/docs/_posts/2019-12-02-Profile.md @@ -433,10 +433,14 @@ interface IActivity { 电源相关能力 -| 能力 | 含义 | 参数 | 举例 | 返回值 | -| ------ | ------------ | ------------ | ---- | ------ | -| sleep | 休眠(锁屏) | 延迟的毫秒数 | 如下 | 无 | -| wakeup | 唤醒 | 延迟的毫秒数 | 如下 | 无 | +| 能力 | 含义 | 参数 | 举例 | 返回值 | +| ------------------------ | ---------------- | ------------------ | ---- | ---------------- | +| sleep | 休眠(锁屏) | 延迟的毫秒数 | 如下 | 无 | +| wakeup | 唤醒 | 延迟的毫秒数 | 如下 | 无 | +| setBrightness | 设置屏幕亮度 | 亮度Level值(0~255) | 如下 | 无 | +| getBrightness | 获取当前屏幕亮度 | 无 | 如下 | 度Level值(0~255) | +| setAutoBrightnessEnabled | 设置自动亮度开关 | true/false | 如下 | 无 | +| isAutoBrightnessEnabled | 是否开启自动亮度 | 无 | 如下 | true/false | 接口定义: @@ -446,6 +450,14 @@ interface IPower { void sleep(long delay); void wakeup(long delay); + + void setBrightness(int level); + + int getBrightness(); + + void setAutoBrightnessEnabled(boolean enable); + + boolean isAutoBrightnessEnabled(); } ``` @@ -458,7 +470,9 @@ interface IPower { // 立即锁屏 "power.sleep(0)", // 1秒后亮屏 - "power.wakeup(1000)" + "power.wakeup(1000)", + "power.setAutoBrightnessEnabled(false)", + "power.setBrightness(power.getBrightness() + 1)", ] } ```