private void handleDisplayDeviceAdded(DisplayDevice device) {
    synchronized (mSyncRoot) {
      if (mDisplayDevices.contains(device)) {
        Slog.w(
            TAG,
            "Attempted to add already added display device: "
                + device.getDisplayDeviceInfoLocked());
        return;
      }

      Slog.i(TAG, "Display device added: " + device.getDisplayDeviceInfoLocked());

      mDisplayDevices.add(device);
      addLogicalDisplayLocked(device);
      scheduleTraversalLocked(false);

      // Blank or unblank the display immediately to match the state requested
      // by the power manager (if known).
      switch (mAllDisplayBlankStateFromPowerManager) {
        case DISPLAY_BLANK_STATE_BLANKED:
          device.blankLocked();
          break;
        case DISPLAY_BLANK_STATE_UNBLANKED:
          device.unblankLocked();
          break;
      }
    }
  }
  private void handleDisplayDeviceAddedLocked(DisplayDevice device) {
    if (mDisplayDevices.contains(device)) {
      Slog.w(
          TAG,
          "Attempted to add already added display device: " + device.getDisplayDeviceInfoLocked());
      return;
    }

    Slog.i(TAG, "Display device added: " + device.getDisplayDeviceInfoLocked());

    mDisplayDevices.add(device);
    addLogicalDisplayLocked(device);
    updateDisplayStateLocked(device);
    scheduleTraversalLocked(false);
  }