/*
 * Copyright 2014-present Facebook, Inc.
 *
 * 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.
 */

package com.facebook.litho;

import android.support.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Set of events and event params logged by the framework if a {@link ComponentsLogger} was
 * supplied to the {@link ComponentContext} used to create the tree.
 */
public interface FrameworkLogEvents {
  int EVENT_CREATE_LAYOUT = 0;
  int EVENT_CSS_LAYOUT = 1;
  int EVENT_COLLECT_RESULTS = 2;
  int EVENT_LAYOUT_CALCULATE = 3;
  int EVENT_PREPARE_PART_DEFINITION = 4;
  int EVENT_PREPARE_MOUNT = 5;
  int EVENT_MOUNT = 6;
  // Previously EVENT_SHOULD_UPDATE_REFERENCE_LAYOUT_MISMATCH = 7; Now unused.
  int EVENT_PRE_ALLOCATE_MOUNT_CONTENT = 8;
  int EVENT_ERROR = 9;
  int EVENT_WARNING = 10;
  int EVENT_SECTIONS_CREATE_NEW_TREE = 11;
  int EVENT_SECTIONS_DATA_DIFF_CALCULATE_DIFF = 12;
  int EVENT_SECTIONS_GENERATE_CHANGESET = 13;
  int EVENT_SECTIONS_ON_CREATE_CHILDREN = 14;
  int EVENT_SECTIONS_SET_ROOT = 15;
  int EVENT_CALCULATE_LAYOUT_STATE = 16;

  @IntDef({
    FrameworkLogEvents.EVENT_CREATE_LAYOUT,
    FrameworkLogEvents.EVENT_CSS_LAYOUT,
    FrameworkLogEvents.EVENT_COLLECT_RESULTS,
    FrameworkLogEvents.EVENT_LAYOUT_CALCULATE,
    FrameworkLogEvents.EVENT_PREPARE_PART_DEFINITION,
    FrameworkLogEvents.EVENT_PREPARE_MOUNT,
    FrameworkLogEvents.EVENT_MOUNT,
    FrameworkLogEvents.EVENT_PRE_ALLOCATE_MOUNT_CONTENT,
    FrameworkLogEvents.EVENT_ERROR,
    FrameworkLogEvents.EVENT_WARNING,
    FrameworkLogEvents.EVENT_SECTIONS_CREATE_NEW_TREE,
    FrameworkLogEvents.EVENT_SECTIONS_DATA_DIFF_CALCULATE_DIFF,
    FrameworkLogEvents.EVENT_SECTIONS_GENERATE_CHANGESET,
    FrameworkLogEvents.EVENT_SECTIONS_ON_CREATE_CHILDREN,
    FrameworkLogEvents.EVENT_SECTIONS_SET_ROOT,
    FrameworkLogEvents.EVENT_CALCULATE_LAYOUT_STATE,
  })
  @Retention(RetentionPolicy.SOURCE)
  @interface LogEventId {}

  String PARAM_COMPONENT = "component";
  String PARAM_LOG_TAG = "log_tag";
  String PARAM_TREE_DIFF_ENABLED = "tree_diff_enabled";
  String PARAM_IS_ASYNC_PREPARE = "is_async_prepare";
  String PARAM_IS_BACKGROUND_LAYOUT = "is_background_layout";
  String PARAM_IS_BACKGROUND_LAYOUT_ENABLED = "is_background_layout_enabled";
  String PARAM_UNMOUNTED_COUNT = "unmounted_count";
  String PARAM_UNMOUNTED_CONTENT = "unmounted_content";
  String PARAM_UNMOUNTED_TIME = "unmounted_time_ms";
  String PARAM_MOVED_COUNT = "moved_count";
  String PARAM_UNCHANGED_COUNT = "unchanged_count";
  String PARAM_MOUNTED_COUNT = "mounted_count";
  String PARAM_MOUNTED_CONTENT = "mounted_content";
  String PARAM_MOUNTED_EXTRAS = "mounted_extras";
  String PARAM_MOUNTED_TIME = "mounted_time_ms";
  String PARAM_UPDATED_COUNT = "updated_count";
  String PARAM_UPDATED_CONTENT = "updated_content";
  String PARAM_UPDATED_TIME = "updated_time_ms";
  String PARAM_NO_OP_COUNT = "no_op_count";
  String PARAM_IS_DIRTY = "is_dirty";
  String PARAM_VISIBILITY_HANDLERS_TOTAL_TIME = "visibility_handlers_total_time_ms";
  String PARAM_VISIBILITY_HANDLER = "visibility_handler";
  String PARAM_VISIBILITY_HANDLER_TIME = "visibility_handler_time_ms";
  String PARAM_MESSAGE = "message";
  String PARAM_SECTION_CURRENT = "section_current";
  String PARAM_SECTION_NEXT = "section_next";
  String PARAM_SECTION_SET_ROOT_SOURCE = "section_set_root_source";
  String PARAM_SET_ROOT_ON_BG_THREAD = "sections_set_root_bg_thread";
  String PARAM_LAYOUT_STATE_SOURCE = "calculate_layout_state_source";
}

@@ -1303,27 +1303,37 @@
 TENT = 8;%0A  
-int
+// Previously
  EVENT_ERROR
@@ -1337,22 +1337,44 @@
 ROR = 9;
-%0A  int
+ Now unused.%0A  // Previously
  EVENT_W
@@ -1385,16 +1385,28 @@
 NG = 10;
+ Now unused.
 %0A  int E
@@ -2048,82 +2048,8 @@
 NT,%0A
-    FrameworkLogEvents.EVENT_ERROR,%0A    FrameworkLogEvents.EVENT_WARNING,%0A
     
@@ -3681,44 +3681,8 @@
 s%22;%0A
-  String PARAM_MESSAGE = %22message%22;%0A
   St

Remove unused FrameworkLogEvents constants