OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Next min version: 3 | 5 // Next min version: 4 |
6 | 6 |
7 module arc.mojom; | 7 module arc.mojom; |
8 | 8 |
9 // Enumerates the types of wake lock the ARC instance can request from the | 9 // Enumerates the types of wake lock the ARC instance can request from the |
10 // host. | 10 // host. |
11 [Extensible] | 11 [Extensible] |
12 enum DisplayWakeLockType { | 12 enum DisplayWakeLockType { |
13 // Does not allow the screen to dim, turn off, or lock; prevents | 13 // Does not allow the screen to dim, turn off, or lock; prevents |
14 // idle suspend. | 14 // idle suspend. |
15 BRIGHT = 0, | 15 BRIGHT = 0, |
16 | 16 |
17 // Allows dimming the screen, but prevents it from turning off or locking. | 17 // Allows dimming the screen, but prevents it from turning off or locking. |
18 // Also prevents idle suspend. | 18 // Also prevents idle suspend. |
19 DIM = 1 | 19 DIM = 1 |
20 }; | 20 }; |
21 | 21 |
22 // Next method ID: 3 | 22 // Next method ID: 4 |
23 interface PowerHost { | 23 interface PowerHost { |
24 // Acquire and release wake locks on the host side. | 24 // Acquire and release wake locks on the host side. |
25 OnAcquireDisplayWakeLock@0(DisplayWakeLockType type); | 25 OnAcquireDisplayWakeLock@0(DisplayWakeLockType type); |
26 OnReleaseDisplayWakeLock@1(DisplayWakeLockType type); | 26 OnReleaseDisplayWakeLock@1(DisplayWakeLockType type); |
27 | 27 |
28 // Checks if there is a display on. | 28 // Checks if there is a display on. |
29 [MinVersion=1] IsDisplayOn@2() => (bool is_on); | 29 [MinVersion=1] IsDisplayOn@2() => (bool is_on); |
| 30 |
| 31 // Request that the screen brightness be changed to |percent|. |
| 32 // |percent| is of the range [0, 100] |
| 33 [MinVersion=3] OnScreenBrightnessUpdateRequest@3(double percent); |
30 }; | 34 }; |
31 | 35 |
32 // Next method ID: 4 | 36 // Next method ID: 5 |
33 interface PowerInstance { | 37 interface PowerInstance { |
34 // Establishes full-duplex communication with the host. | 38 // Establishes full-duplex communication with the host. |
35 Init@0(PowerHost host_ptr); | 39 Init@0(PowerHost host_ptr); |
36 | 40 |
37 // Alerts the instance to a change in interactive state. | 41 // Alerts the instance to a change in interactive state. |
38 [MinVersion=1] SetInteractive@1(bool enabled); | 42 [MinVersion=1] SetInteractive@1(bool enabled); |
39 | 43 |
40 // Called when the system is about to suspend. The callback will be invoked | 44 // Called when the system is about to suspend. The callback will be invoked |
41 // when pre-suspend work is complete. | 45 // when pre-suspend work is complete. |
42 [MinVersion=2] Suspend@2() => (); | 46 [MinVersion=2] Suspend@2() => (); |
43 | 47 |
44 // Called when the system has just resumed. | 48 // Called when the system has just resumed. |
45 [MinVersion=2] Resume@3(); | 49 [MinVersion=2] Resume@3(); |
| 50 |
| 51 // Update Android brightness settings. |
| 52 // |percent| is of the range [0, 100] |
| 53 [MinVersion=3] UpdateScreenBrightnessSettings@4(double percent); |
46 }; | 54 }; |
OLD | NEW |