Lines Matching refs:power
1 # @ohos.power (Power Management) (System API)
3 The **power** module provides APIs for rebooting and shutting down the system, as well as querying …
9 …he module. For details about its public APIs, see [@ohos.power (Power Management)](js-apis-power.m…
14 import {power} from '@kit.BasicServicesKit';
17 ## power.shutdown
37 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
51 power.shutdown('shutdown_test');
57 ## power.reboot<sup>9+</sup>
77 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
90 power.reboot('reboot_test');
96 ## power.wakeup<sup>9+</sup>
114 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
126 power.wakeup('wakeup_test');
132 ## power.suspend<sup>9+</sup>
151 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
163 power.suspend();
169 ## power.setPowerMode<sup>9+</sup>
173 Sets the power mode of this device. This API uses an asynchronous callback to return the result.
186 …gt; | Yes | Callback invoked to return the result.<br> If the power mode is successful…
190 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
202 power.setPowerMode(power.DevicePowerMode.MODE_PERFORMANCE, (err: Error) => {
204 console.info('set power mode to MODE_PERFORMANCE');
206 console.error('set power mode failed, err: ' + err);
211 ## power.setPowerMode<sup>9+</sup>
215 Sets the power mode of this device. This API uses a promise to return the result.
237 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
249 power.setPowerMode(power.DevicePowerMode.MODE_PERFORMANCE)
251 console.info('set power mode to MODE_PERFORMANCE');
254 console.error('set power mode failed, err: ' + err);
258 ## power.setScreenOffTime<sup>12+</sup>
276 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
288 power.setScreenOffTime(30000);
294 ## power.hibernate<sup>12+</sup>
312 For details about the error codes, see [Power Manager Error Codes](errorcode-power.md).
324 power.hibernate(true);