Home | History | Annotate | Download | only in power_manager
      1 // Copyright 2018 The Chromium OS Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 syntax = "proto2";
      6 
      7 option optimize_for = LITE_RUNTIME;
      8 
      9 package power_manager;
     10 
     11 // See
     12 // https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/docs/screen_brightness.md
     13 // for information about the mapping between brightness percents and backlight
     14 // hardware levels.
     15 
     16 // Request to change the backlight brightness sent from Chrome to powerd in a
     17 // SetScreenBrightness D-Bus method call.
     18 message SetBacklightBrightnessRequest {
     19   // Desired backlight brightness as a percent in the range [0.0, 100.0].
     20   optional double percent = 1;
     21 
     22   // The speed at which the brightness should go to the requested percent.
     23   enum Transition {
     24     // The brightness should animate to the new percent.
     25     GRADUAL = 0;
     26     // The brightness should instantaneously go to the new percent.
     27     INSTANT = 1;
     28   }
     29   optional Transition transition = 2;
     30 
     31   // The reason the request was sent.
     32   enum Cause {
     33     // Explicit user request (typically using the onscreen brightness slider).
     34     USER_REQUEST = 0;
     35     // Automated request based on a prediction of the desired brightness.
     36     MODEL = 1;
     37   }
     38   optional Cause cause = 3;
     39 
     40   // Next value to use: 4
     41 }
     42 
     43 // Announcement of a backlight brightness change emitted by powerd via a
     44 // ScreenBrightnessChanged or KeyboardBrightnessChanged D-Bus signal.
     45 message BacklightBrightnessChange {
     46   // Current backlight brightness as a percent in the range [0.0, 100.0].
     47   optional double percent = 1;
     48 
     49   // The reason the brightness was changed.
     50   enum Cause {
     51     // Explicit user request, e.g. brightness keys or brightness slider.
     52     USER_REQUEST = 0;
     53     // Automated change in response to user activity (input event, video
     54     // activity, etc.).
     55     USER_ACTIVITY = 1;
     56     // Automated powerd change triggered by idle timeout due to user inactivity.
     57     USER_INACTIVITY = 2;
     58     // Automated powerd change due by a change to the ambient light level.
     59     AMBIENT_LIGHT_CHANGED = 3;
     60     // An external power source was connected.
     61     EXTERNAL_POWER_CONNECTED = 4;
     62     // An external power source was disconnected.
     63     EXTERNAL_POWER_DISCONNECTED = 5;
     64     // Backlights were forced off by Chrome (typically due to the user tapping
     65     // the power button on a convertible device).
     66     FORCED_OFF = 6;
     67     // Backlights are no longer being forced off by Chrome.
     68     NO_LONGER_FORCED_OFF = 7;
     69     // Unspecified automated change (suspend/resume, shutdown, etc.).
     70     OTHER = 8;
     71     // Automated request based on a prediction of the desired brightness.
     72     MODEL = 9;
     73     // Next value to use: 10
     74   }
     75   optional Cause cause = 2;
     76 
     77   // Next value to use: 3
     78 }
     79