/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";

package android.display;

option java_outer_classname = "DisplayProtoEnums";
option java_multiple_files = true;

// Define ranges among 38 brightness buckets:
// [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80,
//   90, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200,
//   1400, 1600, 1800, 2000, 2250, 2500, 2750, 3000, inf ]
enum DisplayBrightnessRangeEnum {
    // The display brightness is unknown.
    RANGE_UNKNOWN = 0;
    // The display brightness ranges from low to high.
    RANGE_0_1 = 1;
    RANGE_1_2 = 2;
    RANGE_2_3 = 3;
    RANGE_3_4 = 4;
    RANGE_4_5 = 5;
    RANGE_5_6 = 6;
    RANGE_6_7 = 7;
    RANGE_7_8 = 8;
    RANGE_8_9 = 9;
    RANGE_9_10 = 10;
    RANGE_10_20 = 11;
    RANGE_20_30 = 12;
    RANGE_30_40 = 13;
    RANGE_40_50 = 14;
    RANGE_50_60 = 15;
    RANGE_60_70 = 16;
    RANGE_70_80 = 17;
    RANGE_80_90 = 18;
    RANGE_90_100 = 19;
    RANGE_100_200 = 20;
    RANGE_200_300 = 21;
    RANGE_300_400 = 22;
    RANGE_400_500 = 23;
    RANGE_500_600 = 24;
    RANGE_600_700 = 25;
    RANGE_700_800 = 26;
    RANGE_800_900 = 27;
    RANGE_900_1000 = 28;
    RANGE_1000_1200 = 29;
    RANGE_1200_1400 = 30;
    RANGE_1400_1600 = 31;
    RANGE_1600_1800 = 32;
    RANGE_1800_2000 = 33;
    RANGE_2000_2250 = 34;
    RANGE_2250_2500 = 35;
    RANGE_2500_2750 = 36;
    RANGE_2750_3000 = 37;
    RANGE_3000_INF = 38;
}

// The original definition of this enum comes from
// frameworks/base/services/core/java/com/android/server/display/brightness/BrightnessReason.java
enum DisplayBrightnessChangeReasonEnum {
    REASON_UNKNOWN = 0;
    REASON_MANUAL = 1;
    REASON_DOZE = 2;
    REASON_DOZE_DEFAULT = 3;
    REASON_AUTOMATIC = 4;
    REASON_SCREEN_OFF = 5;
    REASON_OVERRIDE = 6;
    REASON_TEMPORARY = 7;
    REASON_BOOST = 8;
    REASON_SCREEN_OFF_BRIGHTNESS_SENSOR = 9;
    REASON_FOLLOWER = 10;
    REASON_OFFLOAD = 11;
    REASON_DOZE_MANUAL = 12;
}

// Contains vote different statuses.
// Logged in DisplayModeDirectorVoteChanged atom.
enum DisplayModeDirectorVoteStatus {
    STATUS_UNKNOWN = 0;
    STATUS_ADDED = 1;
    STATUS_ACTIVE = 2;
    STATUS_REMOVED = 3;
}

// Define ranges among 14 ambient lux buckets (left inclusive, right exclusive).
// Designed for scenarios needing discrete light levels (e.g., display adjustments).
// [ 0, 0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000,
// 3000, 10000, 30000, 100000, inf ]
enum LuxBucketEnum {
    // The ambient lux is unknown.
    LUX_RANGE_UNKNOWN = 0;
    // The ambient lux buckets from low to high.
    LUX_RANGE_0_01 = 1;
    LUX_RANGE_01_03 = 2;
    LUX_RANGE_03_1 = 3;
    LUX_RANGE_1_3 = 4;
    LUX_RANGE_3_10 = 5;
    LUX_RANGE_10_30 = 6;
    LUX_RANGE_30_100 = 7;
    LUX_RANGE_100_300 = 8;
    LUX_RANGE_300_1000 = 9;
    LUX_RANGE_1000_3000 = 10;
    LUX_RANGE_3000_10000 = 11;
    LUX_RANGE_10000_30000 = 12;
    LUX_RANGE_30000_100000 = 13;
    LUX_RANGE_100000_INF = 14;
}

/*  Define the types of display events that can occur.
    Logged in DisplayEventCallbackOccurred atom.
    The original definition of this enum comes from
    frameworks/base/core/java/android/hardware/display/DisplayManager.java ->
    EventType
*/
enum EventType {
  TYPE_UNKNOWN = 0;
  TYPE_DISPLAY_ADDED = 1;
  TYPE_DISPLAY_REMOVED = 2;
  TYPE_DISPLAY_CHANGED = 3;
  TYPE_DISPLAY_REFRESH_RATE_CHANGED = 4;
  TYPE_DISPLAY_STATE_CHANGED = 5;
  TYPE_DISPLAY_BRIGHTNESS_CHANGED = 6;
}

// Represents the direction of a brightness adjustment.
enum BrightnessDirectionEnum {
  // Default or unknown state
  DIRECTION_UNKNOWN = 0;
  DIRECTION_INCREASE = 1;
  DIRECTION_DECREASE = 2;
}

/**
 * Display offload session types.
 */
enum DisplayOffloadSessionType {
    DISPLAY_OFFLOAD_SESSION_TYPE_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_SESSION_TYPE_WATCHFACE = 1;
    DISPLAY_OFFLOAD_SESSION_TYPE_SYSUI_OVERLAY = 2;
    DISPLAY_OFFLOAD_SESSION_TYPE_SYSTEM_FITNESS_TRACKER = 3;
    DISPLAY_OFFLOAD_SESSION_TYPE_APP_OFFLOAD = 4;
}

/**
 * Display offload MCU renderer types.
 */
enum DisplayOffloadRendererType {
    DISPLAY_OFFLOAD_RENDERER_TYPE_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_RENDERER_TYPE_REMOTE_COMPOSE = 1;
    DISPLAY_OFFLOAD_RENDERER_TYPE_PELE = 2;
    DISPLAY_OFFLOAD_RENDERER_TYPE_CUSTOM = 3;
}

/**
 * Display offload session eligibility;
 */
enum DisplayOffloadSessionEligibility {
    DISPLAY_OFFLOAD_SESSION_ELIGIBILITY_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_SESSION_ELIGIBILITY_ELIGIBLE = 1;
    DISPLAY_OFFLOAD_SESSION_ELIGIBILITY_INELIGIBLE = 2;
    DISPLAY_OFFLOAD_SESSION_ELIGIBILITY_IGNORED = 3;
}

/**
 * Display offload top-level states.
 */
enum DisplayOffloadState {
    DISPLAY_OFFLOAD_STATE_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_STATE_DEOFFLOADED = 1;
    DISPLAY_OFFLOAD_STATE_OFFLOADED = 2;
    DISPLAY_OFFLOAD_STATE_BRIGHTNESS_OFFLOADED = 3;
}

/**
 * Display offload transition types, based on frameworks/opt/wear/src/com/android/clockwork/displayoffload/DisplayOffloadState.java.
 */
enum DisplayOffloadTransitionType {
    DISPLAY_OFFLOAD_TRANSITION_TYPE_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_TRANSITION_TYPE_OFFLOAD_STATE_TRANSMISSION = 1;
    DISPLAY_OFFLOAD_TRANSITION_TYPE_OFFLOAD_FINALIZATION = 2;
    DISPLAY_OFFLOAD_TRANSITION_TYPE_DEOFFLOAD_FINALIZATION = 3;
}

/**
 * Display offload aggregation levels. Describes whether the data is aggregated at the cycle-level
 * (consists of one or more sessions) or at the session-level. Used in atoms which describe both
 * cycles and sessions with the same set of data points, but which must still make the distinction
 * between them.
 */
enum DisplayOffloadAggregationLevel {
    DISPLAY_OFFLOAD_AGGREGATION_LEVEL_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_AGGREGATION_LEVEL_PER_OFFLOAD_CYCLE = 1;
    DISPLAY_OFFLOAD_AGGREGATION_LEVEL_PER_RENDER_SESSION = 2;
}

/**
 * Display offload transition result.
 */
enum DisplayOffloadTransitionResult {
    DISPLAY_OFFLOAD_TRANSITION_RESULT_UNSPECIFIED = 0;
    DISPLAY_OFFLOAD_TRANSITION_RESULT_COMPLETE = 1;
    DISPLAY_OFFLOAD_TRANSITION_RESULT_ABORTED = 2;
}

/**
 * Display event source. Logged in DisplayInfoChanged atom.
 */
enum EventSource {
    EVENT_SOURCE_UNKNOWN = 0;
    EVENT_SOURCE_DISPLAY_SWAP = 1;
    EVENT_SOURCE_DISPLAY_MANAGER = 2;
    EVENT_SOURCE_WINDOW_MANAGER = 3;
    EVENT_SOURCE_OTHER = 4;
}
