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

Commit 6fb9788d authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6978977 from 8ed26386 to sc-release

Change-Id: I07a6d802aefa5890c99c5d2a5f597e803fd9af55
parents af9523ae 8ed26386
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -69,18 +69,24 @@ void ActivityAttributionImpl::onWakeup(
    bool success, const std::vector<std::string>& wakeupReasons) {}

Status WakelockCallback::notifyAcquired(void) {
  if (instance) {
    instance->onWakelockAcquired();
  }
  return Status::ok();
}

Status WakelockCallback::notifyReleased(void) {
  if (instance) {
    instance->onWakelockReleased();
  }
  return Status::ok();
}

Status WakeupCallback::notifyWakeup(
    bool success, const std::vector<std::string>& wakeupReasons) {
  if (instance) {
    instance->onWakeup(success, wakeupReasons);
  }
  return Status::ok();
}

+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include "btaa/include/activity_attribution.h"
#include "btif/include/btif_common.h"
#include "gd/common/init_flags.h"
#include "stack/include/btu.h"

using base::Bind;
@@ -37,6 +38,11 @@ class ActivityAttributionInterfaceImpl : public ActivityAttributionCallbacks,
  ~ActivityAttributionInterfaceImpl() override = default;

  void Init(ActivityAttributionCallbacks* callbacks) override {
    if (!bluetooth::common::InitFlags::BtaaHciLogEnabled()) {
      LOG(INFO) << __func__ << " BTAA not enabled!";
      return;
    }

    this->callbacks = callbacks;
    ActivityAttribution::Initialize(this);
  }
+20 −0
Original line number Diff line number Diff line
@@ -63,6 +63,20 @@ class HalCaptures(object):

class HciCaptures(object):

    @staticmethod
    def ReadLocalOobDataCompleteCapture():
        return Capture(
            HciMatchers.CommandComplete(hci_packets.OpCode.READ_LOCAL_OOB_DATA),
            lambda packet: HciMatchers.ExtractMatchingCommandComplete(packet.event, hci_packets.OpCode.READ_LOCAL_OOB_DATA)
        )

    @staticmethod
    def ReadLocalOobExtendedDataCompleteCapture():
        return Capture(
            HciMatchers.CommandComplete(hci_packets.OpCode.READ_LOCAL_OOB_EXTENDED_DATA),
            lambda packet: HciMatchers.ExtractMatchingCommandComplete(packet.event, hci_packets.OpCode.READ_LOCAL_OOB_EXTENDED_DATA)
        )

    @staticmethod
    def ReadBdAddrCompleteCapture():
        return Capture(
@@ -95,6 +109,12 @@ class HciCaptures(object):
        return Capture(HciMatchers.LeConnectionComplete(),
                       lambda packet: HciMatchers.ExtractLeConnectionComplete(packet.event))

    @staticmethod
    def SimplePairingCompleteCapture():
        return Capture(HciMatchers.EventWithCode(hci_packets.EventCode.SIMPLE_PAIRING_COMPLETE),
            lambda packet: hci_packets.SimplePairingCompleteView(
                HciMatchers.ExtractEventWithCode(packet.event, hci_packets.EventCode.SIMPLE_PAIRING_COMPLETE)))


class L2capCaptures(object):

+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
#   limitations under the License.

import bluetooth_packets_python3 as bt_packets
import logging

from bluetooth_packets_python3 import hci_packets
from bluetooth_packets_python3.hci_packets import EventCode
from bluetooth_packets_python3 import l2cap_packets
@@ -109,6 +111,10 @@ class HciMatchers(object):
        return hci_packets.LeEnhancedConnectionCompleteView(
            HciMatchers._extract_matching_le_event(packet_bytes, hci_packets.SubeventCode.ENHANCED_CONNECTION_COMPLETE))

    @staticmethod
    def LogEventCode():
        return lambda event: logging.info("Received event: %x" % hci_packets.EventPacketView(bt_packets.PacketViewLittleEndian(list(event.event))).GetEventCode())

    @staticmethod
    def LinkKeyRequest():
        return lambda event: HciMatchers.EventWithCode(EventCode.LINK_KEY_REQUEST)
@@ -153,6 +159,10 @@ class HciMatchers(object):
    def DisconnectionComplete():
        return lambda event: HciMatchers.EventWithCode(EventCode.DISCONNECTION_COMPLETE)

    @staticmethod
    def RemoteOobDataRequest():
        return lambda event: HciMatchers.EventWithCode(EventCode.REMOTE_OOB_DATA_REQUEST)


class NeighborMatchers(object):

+4 −4
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ class PyHal(Closable):
    def __init__(self, device):
        self.device = device

        self.hci_event_stream = EventStream(self.device.hal.FetchHciEvent(empty_proto.Empty()))
        self.acl_stream = EventStream(self.device.hal.FetchHciAcl(empty_proto.Empty()))
        self.hci_event_stream = EventStream(self.device.hal.StreamEvents(empty_proto.Empty()))
        self.acl_stream = EventStream(self.device.hal.StreamAcl(empty_proto.Empty()))

        # We don't deal with SCO for now

@@ -42,7 +42,7 @@ class PyHal(Closable):
        return self.acl_stream

    def send_hci_command(self, command):
        self.device.hal.SendHciCommand(hal_facade.HciCommandPacket(payload=bytes(command)))
        self.device.hal.SendCommand(hal_facade.Command(payload=bytes(command)))

    def send_acl(self, acl):
        self.device.hal.SendHciAcl(hal_facade.HciAclPacket(payload=bytes(acl)))
        self.device.hal.SendAcl(hal_facade.AclPacket(payload=bytes(acl)))
Loading