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

Commit 8e1e305b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-62c3045b-4fac-455c-b27e-5c82d9790366-for-git_oc-dr1-release-42...

release-request-62c3045b-4fac-455c-b27e-5c82d9790366-for-git_oc-dr1-release-4241171 snap-temp-L59500000088705621

Change-Id: Ibdfc45e725eb6377e3f1df0fa4bf8b24cb06b614
parents fb0cfda4 39117ad2
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1731,6 +1731,10 @@ static void advertiseCleanupNative(JNIEnv* env, jobject object) {
  }
}

static uint32_t INTERVAL_MAX = 0xFFFFFF;
// Always give controller 31.25ms difference between min and max
static uint32_t INTERVAL_DELTA = 50;

static AdvertiseParameters parseParams(JNIEnv* env, jobject i) {
  AdvertiseParameters p;

@@ -1763,9 +1767,13 @@ static AdvertiseParameters parseParams(JNIEnv* env, jobject i) {
  if (isAnonymous) props |= 0x20;
  if (includeTxPower) props |= 0x40;

  if (interval > INTERVAL_MAX - INTERVAL_DELTA) {
    interval = INTERVAL_MAX - INTERVAL_DELTA;
  }

  p.advertising_event_properties = props;
  p.min_interval = interval;
  p.max_interval = interval + 50;
  p.max_interval = interval + INTERVAL_DELTA;
  p.channel_map = 0x07; /* all channels */
  p.tx_power = txPowerLevel;
  p.primary_advertising_phy = primaryPhy;