Skip to content

Commit

Permalink
Add brightness API
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Jul 23, 2020
1 parent b72cd16 commit 0557732
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified docs/.DS_Store
Binary file not shown.
24 changes: 19 additions & 5 deletions docs/_posts/2019-12-02-Profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,14 @@ interface IActivity {

电源相关能力

| 能力 | 含义 | 参数 | 举例 | 返回值 |
| ------ | ------------ | ------------ | ---- | ------ |
| sleep | 休眠(锁屏) | 延迟的毫秒数 | 如下 ||
| wakeup | 唤醒 | 延迟的毫秒数 | 如下 ||
| 能力 | 含义 | 参数 | 举例 | 返回值 |
| ------------------------ | ---------------- | ------------------ | ---- | ---------------- |
| sleep | 休眠(锁屏) | 延迟的毫秒数 | 如下 ||
| wakeup | 唤醒 | 延迟的毫秒数 | 如下 ||
| setBrightness | 设置屏幕亮度 | 亮度Level值(0~255) | 如下 ||
| getBrightness | 获取当前屏幕亮度 || 如下 | 度Level值(0~255) |
| setAutoBrightnessEnabled | 设置自动亮度开关 | true/false | 如下 ||
| isAutoBrightnessEnabled | 是否开启自动亮度 || 如下 | true/false |

接口定义:

Expand All @@ -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();
}

```
Expand All @@ -458,7 +470,9 @@ interface IPower {
// 立即锁屏
"power.sleep(0)",
// 1秒后亮屏
"power.wakeup(1000)"
"power.wakeup(1000)",
"power.setAutoBrightnessEnabled(false)",
"power.setBrightness(power.getBrightness() + 1)",
]
}
```
Expand Down

0 comments on commit 0557732

Please sign in to comment.