Lines Matching refs:peer_
132 : State(sm, kStateIdle), peer_(sm.Peer()) {} in StateIdle()
138 BtifAvPeer& peer_; member in BtifAvStateMachine::StateIdle
144 : State(sm, kStateOpening), peer_(sm.Peer()) {} in StateOpening()
150 BtifAvPeer& peer_; member in BtifAvStateMachine::StateOpening
156 : State(sm, kStateOpened), peer_(sm.Peer()) {} in StateOpened()
162 BtifAvPeer& peer_; member in BtifAvStateMachine::StateOpened
168 : State(sm, kStateStarted), peer_(sm.Peer()) {} in StateStarted()
174 BtifAvPeer& peer_; member in BtifAvStateMachine::StateStarted
180 : State(sm, kStateClosing), peer_(sm.Peer()) {} in StateClosing()
186 BtifAvPeer& peer_; member in BtifAvStateMachine::StateClosing
189 BtifAvStateMachine(BtifAvPeer& btif_av_peer) : peer_(btif_av_peer) { in BtifAvStateMachine()
204 BtifAvPeer& Peer() { return peer_; } in Peer()
207 BtifAvPeer& peer_; member in BtifAvStateMachine
1379 peer_.PeerAddress().ToString().c_str()); in OnEnter()
1381 peer_.SetEdr(0); in OnEnter()
1382 peer_.ClearAllFlags(); in OnEnter()
1385 if (peer_.IsActivePeer() || peer_.ActivePeerAddress().IsEmpty()) { in OnEnter()
1391 if (peer_.IsActivePeer() && peer_.CanBeDeleted()) { in OnEnter()
1393 if (peer_.IsSink()) { in OnEnter()
1396 } else if (peer_.IsSource()) { in OnEnter()
1403 if (peer_.IsSink()) { in OnEnter()
1406 } else if (peer_.IsSource()) { in OnEnter()
1414 peer_.PeerAddress().ToString().c_str()); in OnExit()
1419 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1421 peer_.FlagsToString().c_str(), in ProcessEvent()
1422 logbool(peer_.IsActivePeer()).c_str()); in ProcessEvent()
1432 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1436 if (peer_.BtaHandle() != kBtaHandleUnknown) { in ProcessEvent()
1437 BTA_AvClose(peer_.BtaHandle()); in ProcessEvent()
1438 if (peer_.IsSource()) { in ProcessEvent()
1439 BTA_AvCloseRc(peer_.BtaHandle()); in ProcessEvent()
1443 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1449 peer_.SetSelfInitiatedConnection(event == BTIF_AV_CONNECT_REQ_EVT); in ProcessEvent()
1451 if (peer_.IsSink()) { in ProcessEvent()
1452 can_connect = btif_av_source.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1453 if (!can_connect) src_disconnect_sink(peer_.PeerAddress()); in ProcessEvent()
1454 } else if (peer_.IsSource()) { in ProcessEvent()
1455 can_connect = btif_av_sink.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1456 if (!can_connect) sink_disconnect_src(peer_.PeerAddress()); in ProcessEvent()
1462 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1463 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1468 btif_av_query_mandatory_codec_priority(peer_.PeerAddress()); in ProcessEvent()
1469 BTA_AvOpen(peer_.PeerAddress(), peer_.BtaHandle(), true, in ProcessEvent()
1470 BTA_SEC_AUTHENTICATE, peer_.LocalUuidServiceClass()); in ProcessEvent()
1471 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateOpening); in ProcessEvent()
1486 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1491 if (peer_.IsSink()) { in ProcessEvent()
1492 can_connect = btif_av_source.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1493 if (!can_connect) src_disconnect_sink(peer_.PeerAddress()); in ProcessEvent()
1494 } else if (peer_.IsSource()) { in ProcessEvent()
1495 can_connect = btif_av_sink.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1496 if (!can_connect) sink_disconnect_src(peer_.PeerAddress()); in ProcessEvent()
1502 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1507 peer_.AvOpenOnRcTimer(), BtifAvPeer::kTimeoutAvOpenOnRcMs, in ProcessEvent()
1508 btif_av_source_initiate_av_open_timer_timeout, &peer_); in ProcessEvent()
1510 alarm_set_on_mloop(peer_.AvOpenOnRcTimer(), in ProcessEvent()
1512 btif_av_sink_initiate_av_open_timer_timeout, &peer_); in ProcessEvent()
1542 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1544 peer_.FlagsToString().c_str(), status, in ProcessEvent()
1551 peer_.SetEdr(p_bta_data->open.edr); in ProcessEvent()
1552 CHECK(peer_.PeerSep() == p_bta_data->open.sep); in ProcessEvent()
1554 if (peer_.IsSink()) { in ProcessEvent()
1555 can_connect = btif_av_source.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1556 if (!can_connect) src_disconnect_sink(peer_.PeerAddress()); in ProcessEvent()
1557 } else if (peer_.IsSource()) { in ProcessEvent()
1558 can_connect = btif_av_sink.AllowedToConnect(peer_.PeerAddress()); in ProcessEvent()
1559 if (!can_connect) sink_disconnect_src(peer_.PeerAddress()); in ProcessEvent()
1570 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1573 btif_report_connection_state(peer_.PeerAddress(), state); in ProcessEvent()
1575 peer_.StateMachine().TransitionTo(av_state); in ProcessEvent()
1576 if (peer_.IsSink()) { in ProcessEvent()
1581 } else if (peer_.IsSource() && in ProcessEvent()
1584 BTA_AvOpenRc(peer_.BtaHandle()); in ProcessEvent()
1603 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1605 alarm_cancel(peer_.AvOpenOnRcTimer()); in ProcessEvent()
1615 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1617 btif_a2dp_on_offload_started(peer_.PeerAddress(), BTA_AV_FAIL); in ProcessEvent()
1623 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1633 peer_.PeerAddress().ToString().c_str()); in OnEnter()
1636 btif_report_connection_state(peer_.PeerAddress(), in OnEnter()
1642 peer_.PeerAddress().ToString().c_str()); in OnExit()
1648 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1650 peer_.FlagsToString().c_str(), in ProcessEvent()
1651 logbool(peer_.IsActivePeer()).c_str()); in ProcessEvent()
1664 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1666 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1668 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1669 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1675 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1677 peer_.FlagsToString().c_str()); in ProcessEvent()
1678 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1680 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1681 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1693 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1695 peer_.FlagsToString().c_str(), status, in ProcessEvent()
1702 peer_.SetEdr(p_bta_data->open.edr); in ProcessEvent()
1703 CHECK(peer_.PeerSep() == p_bta_data->open.sep); in ProcessEvent()
1705 if (btif_rc_is_connected_peer(peer_.PeerAddress())) { in ProcessEvent()
1710 peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1712 btif_rc_get_connected_peer_handle(peer_.PeerAddress()); in ProcessEvent()
1722 btif_report_connection_state(peer_.PeerAddress(), state); in ProcessEvent()
1724 peer_.StateMachine().TransitionTo(av_state); in ProcessEvent()
1725 if (peer_.IsSink()) { in ProcessEvent()
1730 } else if (peer_.IsSource() && in ProcessEvent()
1733 BTA_AvOpenRc(peer_.BtaHandle()); in ProcessEvent()
1735 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1743 if (peer_.IsSource()) { in ProcessEvent()
1756 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1767 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1774 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1776 btif_a2dp_on_offload_started(peer_.PeerAddress(), BTA_AV_FAIL); in ProcessEvent()
1781 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1783 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1784 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1790 BTA_AvClose(peer_.BtaHandle()); in ProcessEvent()
1791 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1793 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1794 if (peer_.SelfInitiatedConnection()) { in ProcessEvent()
1804 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1813 peer_.PeerAddress().ToString().c_str()); in OnEnter()
1815 peer_.ClearFlags(BtifAvPeer::kFlagLocalSuspendPending | in OnEnter()
1824 if (peer_.IsSource() && btif_av_sink.ActivePeer().IsEmpty()) { in OnEnter()
1826 if (!btif_av_sink.SetActivePeer(peer_.PeerAddress(), in OnEnter()
1829 peer_.PeerAddress().ToString().c_str()); in OnEnter()
1836 peer_.PeerAddress().ToString().c_str()); in OnExit()
1838 peer_.ClearFlags(BtifAvPeer::kFlagPendingStart); in OnExit()
1846 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1848 peer_.FlagsToString().c_str(), in ProcessEvent()
1849 logbool(peer_.IsActivePeer()).c_str()); in ProcessEvent()
1852 peer_.CheckFlags(BtifAvPeer::kFlagRemoteSuspend) && in ProcessEvent()
1856 peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1857 peer_.ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in ProcessEvent()
1868 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1870 peer_.FlagsToString().c_str()); in ProcessEvent()
1871 BTA_AvStart(peer_.BtaHandle()); in ProcessEvent()
1872 peer_.SetFlags(BtifAvPeer::kFlagPendingStart); in ProcessEvent()
1879 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
1882 peer_.FlagsToString().c_str()); in ProcessEvent()
1890 if (peer_.IsSink()) { in ProcessEvent()
1891 if (!peer_.CheckFlags(BtifAvPeer::kFlagPendingStart | in ProcessEvent()
1894 << peer_.PeerAddress() in ProcessEvent()
1897 } else if (!peer_.IsActivePeer()) { in ProcessEvent()
1899 << peer_.PeerAddress() in ProcessEvent()
1906 if (btif_a2dp_on_started(peer_.PeerAddress(), &p_av->start)) { in ProcessEvent()
1908 peer_.ClearFlags(BtifAvPeer::kFlagPendingStart); in ProcessEvent()
1915 if (peer_.IsSource() && peer_.IsActivePeer()) { in ProcessEvent()
1922 btif_av_source_dispatch_sm_event(peer_.PeerAddress(), in ProcessEvent()
1925 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateStarted); in ProcessEvent()
1930 BTA_AvClose(peer_.BtaHandle()); in ProcessEvent()
1931 if (peer_.IsSource()) { in ProcessEvent()
1932 BTA_AvCloseRc(peer_.BtaHandle()); in ProcessEvent()
1936 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1940 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateClosing); in ProcessEvent()
1946 if (peer_.CheckFlags(BtifAvPeer::kFlagPendingStart)) { in ProcessEvent()
1949 peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
1955 btif_a2dp_on_started(peer_.PeerAddress(), &av_start); in ProcessEvent()
1957 } else if (peer_.IsActivePeer()) { in ProcessEvent()
1962 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
1964 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
1969 LOG(WARNING) << __PRETTY_FUNCTION__ << ": Peer " << peer_.PeerAddress() in ProcessEvent()
1971 if (peer_.CheckFlags(BtifAvPeer::kFlagPendingStart)) { in ProcessEvent()
1972 LOG(ERROR) << __PRETTY_FUNCTION__ << ": Peer " << peer_.PeerAddress() in ProcessEvent()
1974 peer_.ClearFlags(BtifAvPeer::kFlagPendingStart); in ProcessEvent()
1977 if (peer_.IsSink()) { in ProcessEvent()
1978 src_disconnect_sink(peer_.PeerAddress()); in ProcessEvent()
1979 } else if (peer_.IsSource()) { in ProcessEvent()
1980 sink_disconnect_src(peer_.PeerAddress()); in ProcessEvent()
1985 if (peer_.IsActivePeer()) { in ProcessEvent()
1986 LOG(INFO) << __PRETTY_FUNCTION__ << " : Peer " << peer_.PeerAddress() in ProcessEvent()
1990 btif_a2dp_source_start_session(peer_.PeerAddress(), in ProcessEvent()
1993 if (peer_.CheckFlags(BtifAvPeer::kFlagPendingStart)) { in ProcessEvent()
1994 LOG(INFO) << __PRETTY_FUNCTION__ << " : Peer " << peer_.PeerAddress() in ProcessEvent()
1996 << loghex(peer_.BtaHandle()) << ")"; in ProcessEvent()
1997 BTA_AvStart(peer_.BtaHandle()); in ProcessEvent()
2004 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2012 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2014 btif_a2dp_on_offload_started(peer_.PeerAddress(), BTA_AV_FAIL); in ProcessEvent()
2018 if (peer_.CheckFlags(BtifAvPeer::kFlagRemoteSuspend)) { in ProcessEvent()
2021 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str()); in ProcessEvent()
2022 peer_.ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in ProcessEvent()
2031 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2040 peer_.PeerAddress().ToString().c_str()); in OnEnter()
2043 peer_.ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in OnEnter()
2049 btif_report_audio_state(peer_.PeerAddress(), BTAV_AUDIO_STATE_STARTED); in OnEnter()
2054 peer_.PeerAddress().ToString().c_str()); in OnExit()
2062 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2064 peer_.FlagsToString().c_str(), in ProcessEvent()
2065 logbool(peer_.IsActivePeer()).c_str()); in ProcessEvent()
2073 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2075 peer_.FlagsToString().c_str()); in ProcessEvent()
2077 if (peer_.IsSink()) btif_a2dp_on_started(peer_.PeerAddress(), nullptr); in ProcessEvent()
2084 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2086 peer_.FlagsToString().c_str()); in ProcessEvent()
2089 peer_.SetFlags(BtifAvPeer::kFlagLocalSuspendPending); in ProcessEvent()
2093 peer_.ClearFlags(BtifAvPeer::kFlagRemoteSuspend); in ProcessEvent()
2095 if (peer_.IsSink() && in ProcessEvent()
2096 (peer_.IsActivePeer() || !btif_av_stream_started_ready())) { in ProcessEvent()
2104 } else if (peer_.IsSource()) { in ProcessEvent()
2107 BTA_AvStop(peer_.BtaHandle(), true); in ProcessEvent()
2112 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2114 peer_.FlagsToString().c_str()); in ProcessEvent()
2117 BTA_AvClose(peer_.BtaHandle()); in ProcessEvent()
2118 if (peer_.IsSource()) { in ProcessEvent()
2119 BTA_AvCloseRc(peer_.BtaHandle()); in ProcessEvent()
2123 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
2127 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateClosing); in ProcessEvent()
2132 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2134 p_av->suspend.initiator, peer_.FlagsToString().c_str()); in ProcessEvent()
2137 if (peer_.IsActivePeer() || !btif_av_stream_started_ready()) { in ProcessEvent()
2143 peer_.ClearFlags(BtifAvPeer::kFlagLocalSuspendPending); in ProcessEvent()
2145 if (peer_.IsSink() && peer_.IsActivePeer()) { in ProcessEvent()
2159 if (!peer_.CheckFlags(BtifAvPeer::kFlagLocalSuspendPending)) in ProcessEvent()
2160 peer_.SetFlags(BtifAvPeer::kFlagRemoteSuspend); in ProcessEvent()
2165 btif_report_audio_state(peer_.PeerAddress(), state); in ProcessEvent()
2167 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateOpened); in ProcessEvent()
2172 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2174 peer_.FlagsToString().c_str()); in ProcessEvent()
2176 peer_.SetFlags(BtifAvPeer::kFlagPendingStop); in ProcessEvent()
2177 peer_.ClearFlags(BtifAvPeer::kFlagLocalSuspendPending); in ProcessEvent()
2181 if (peer_.IsActivePeer() || !btif_av_stream_started_ready()) { in ProcessEvent()
2185 btif_report_audio_state(peer_.PeerAddress(), BTAV_AUDIO_STATE_STOPPED); in ProcessEvent()
2189 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateOpened); in ProcessEvent()
2195 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2197 peer_.FlagsToString().c_str()); in ProcessEvent()
2199 peer_.SetFlags(BtifAvPeer::kFlagPendingStop); in ProcessEvent()
2202 if (peer_.IsActivePeer()) { in ProcessEvent()
2207 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
2210 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
2214 BTA_AvOffloadStart(peer_.BtaHandle()); in ProcessEvent()
2218 btif_a2dp_on_offload_started(peer_.PeerAddress(), p_av->status); in ProcessEvent()
2226 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2236 peer_.PeerAddress().ToString().c_str()); in OnEnter()
2238 if (peer_.IsActivePeer()) { in OnEnter()
2239 if (peer_.IsSink()) { in OnEnter()
2243 } else if (peer_.IsSource()) { in OnEnter()
2251 peer_.PeerAddress().ToString().c_str()); in OnExit()
2257 __PRETTY_FUNCTION__, peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2259 peer_.FlagsToString().c_str(), in ProcessEvent()
2260 logbool(peer_.IsActivePeer()).c_str()); in ProcessEvent()
2269 if (peer_.IsActivePeer()) { in ProcessEvent()
2276 btif_report_connection_state(peer_.PeerAddress(), in ProcessEvent()
2279 peer_.StateMachine().TransitionTo(BtifAvStateMachine::kStateIdle); in ProcessEvent()
2295 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()
2297 btif_a2dp_on_offload_started(peer_.PeerAddress(), BTA_AV_FAIL); in ProcessEvent()
2303 peer_.PeerAddress().ToString().c_str(), in ProcessEvent()