| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library power_management.src.native_extension_api; | 5 library power_management.src.native_extension_api; |
| 6 | 6 |
| 7 import "dart-ext:../native/power_management_extension_lib"; | 7 import "dart-ext:power_management_extension_lib"; |
| 8 | 8 |
| 9 /// Disables sleep. | 9 /// Disables sleep. |
| 10 /// | 10 /// |
| 11 /// The [reason] is used to indicate why sleep needs to be disabled. On | 11 /// The [reason] is used to indicate why sleep needs to be disabled. On |
| 12 /// some systems this string can be surfaced to the user to tell why the | 12 /// some systems this string can be surfaced to the user to tell why the |
| 13 /// system is not entering sleep mode. | 13 /// system is not entering sleep mode. |
| 14 /// | 14 /// |
| 15 /// Returns an id which must be used to re-enable sleep. | 15 /// Returns an id which must be used to re-enable sleep. |
| 16 /// | 16 /// |
| 17 /// On most systems normal sleep behavior will be re-established if the | 17 /// On most systems normal sleep behavior will be re-established if the |
| 18 /// program calling `disableSleep` terminates before calling `enableSleep`. | 18 /// program calling `disableSleep` terminates before calling `enableSleep`. |
| 19 int disableSleep(String reason) native 'PowerManagementExtension_DisableSleep'; | 19 int disableSleep(String reason) native 'PowerManagementExtension_DisableSleep'; |
| 20 | 20 |
| 21 /// Enable sleep again. | 21 /// Enable sleep again. |
| 22 /// | 22 /// |
| 23 /// Pass the return value from [disableSleep] as the [disableId] | 23 /// Pass the return value from [disableSleep] as the [disableId] |
| 24 /// argument. | 24 /// argument. |
| 25 void enableSleep(disableId) native 'PowerManagementExtension_EnableSleep'; | 25 void enableSleep(disableId) native 'PowerManagementExtension_EnableSleep'; |
| OLD | NEW |