Home | History | Annotate | Download | only in 2.0
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.hardware.tests.extension.light@2.0;
     18 
     19 import android.hardware.light@2.0;
     20 
     21 enum Default : int32_t {
     22     // for calls to setLight from the framework that don't know about this
     23     // extension or its requirements
     24     INTERPOLATION_OMEGA = 2
     25 };
     26 
     27 /**
     28  * One possibility is renaming an old type. Another possibility is taking
     29  * advantages of the different namespaces.
     30  */
     31 enum ExtBrightness : Brightness {
     32     /**
     33      * Say we're really going to use the phone as a heater.
     34      */
     35     EXTREME,
     36 
     37     /**
     38      * Sometimes at night, we need it to be day.
     39      */
     40      THE_SUN,
     41 };
     42 
     43 /**
     44  * Structs can't inherit eachother in hidl. Use composition instead. In this
     45  * case, I won't use inheritence because I want to replace Brightness with
     46  * ExtBrightness.
     47  */
     48 struct ExtLightState {
     49     LightState state;
     50 
     51     /**
     52      * This is the secret sauce that will really make this extension shine.
     53      * No other person has such a cool feature in their hals. Don't forget
     54      * to describe all details of parameters. An interface is a contract, and
     55      * specifying this contract to the letter is what allows that contracted
     56      * to be maintained. :)
     57      *
     58      * So, this parameter represents the speed at which brightness is changed
     59      * to the new value in the three dimensional space with coordinates RGB
     60      * from the red, blue, and green.
     61      */
     62     int32_t interpolationOmega;
     63 
     64     /**
     65      * Include new values.
     66      */
     67     ExtBrightness brightness;
     68 };
     69