Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8da8e84 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

enum-ify stack/btm/security_device_record::BTM_SEC_STATE_ am: a1491e7c am:...

enum-ify stack/btm/security_device_record::BTM_SEC_STATE_ am: a1491e7c am: 9eed1bde am: 00a8c659

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1459357

Change-Id: Idc0a9c0345f25db5e03e4e7eab347a311825eea9
parents a43f215a 00a8c659
Loading
Loading
Loading
Loading
+16 −13
Original line number Diff line number Diff line
@@ -133,6 +133,22 @@ enum : uint16_t {
  BTM_SEC_16_DIGIT_PIN_AUTHED = 0x4000,
};

typedef enum : uint8_t {
  BTM_SEC_STATE_IDLE = 0,
  BTM_SEC_STATE_AUTHENTICATING = 1,
  BTM_SEC_STATE_ENCRYPTING = 2,
  BTM_SEC_STATE_GETTING_NAME = 3,
  BTM_SEC_STATE_AUTHORIZING = 4,
  BTM_SEC_STATE_SWITCHING_ROLE = 5,
  /* disconnecting BR/EDR */
  BTM_SEC_STATE_DISCONNECTING = 6,
  /* delay to check for encryption to work around */
  /* controller problems */
  BTM_SEC_STATE_DELAY_FOR_ENC = 7,
  BTM_SEC_STATE_DISCONNECTING_BLE = 8,
  BTM_SEC_STATE_DISCONNECTING_BOTH = 9,
} tSECURITY_STATE;

/*
 * Define structure for Security Device Record.
 * A record exists for each device authenticated with this device
@@ -247,19 +263,6 @@ typedef struct {
                            1]; /* Features supported by the device */
  uint8_t num_read_pages;

#define BTM_SEC_STATE_IDLE 0
#define BTM_SEC_STATE_AUTHENTICATING 1
#define BTM_SEC_STATE_ENCRYPTING 2
#define BTM_SEC_STATE_GETTING_NAME 3
#define BTM_SEC_STATE_AUTHORIZING 4
#define BTM_SEC_STATE_SWITCHING_ROLE 5
#define BTM_SEC_STATE_DISCONNECTING 6 /* disconnecting BR/EDR */
#define BTM_SEC_STATE_DELAY_FOR_ENC \
  7 /* delay to check for encryption to work around */
    /* controller problems */
#define BTM_SEC_STATE_DISCONNECTING_BLE 8  /* disconnecting BLE */
#define BTM_SEC_STATE_DISCONNECTING_BOTH 9 /* disconnecting BR/EDR and BLE */

  uint8_t sec_state;          /* Operating state                    */
  bool is_security_state_idle() const {
    return sec_state == BTM_SEC_STATE_IDLE;