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

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

Add stack/include/btm_api_types::is_legal_power_mode am: 7732014a am: 2180fc50 am: 7a755a1b

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6d3ab985c9846262e67076de257667f6cc404eb7
parents 1d517865 7a755a1b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,17 @@ enum : uint8_t {
  BTM_PM_MD_FORCE = 0x10 /* OR this to force ACL link to a certain mode */
};
typedef uint8_t tBTM_PM_MODE;
inline bool is_legal_power_mode(tBTM_PM_MODE mode) {
  switch (mode & ~BTM_PM_MD_FORCE) {
    case BTM_PM_MD_ACTIVE:
    case BTM_PM_MD_HOLD:
    case BTM_PM_MD_SNIFF:
    case BTM_PM_MD_PARK:
      return true;
    default:
      return false;
  }
}

inline std::string power_mode_text(tBTM_PM_MODE mode) {
  std::string s = base::StringPrintf((mode & BTM_PM_MD_FORCE) ? "" : "forced:");