diff options
author | Rakesh Raghava <rakeshraghava@google.com> | 2022-11-15 18:30:58 +0000 |
---|---|---|
committer | Rakesh Raghava <rakeshraghava@google.com> | 2022-11-15 18:33:35 +0000 |
commit | f5f331a8c78fe2223de7885e7a9fda71eb1e7787 (patch) | |
tree | c600305cf96658602ee73482cc6165fab759a1c0 /service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp | |
parent | 5c60b21cc38bfac7887f51588e2323d686e84efb (diff) | |
download | ImsMedia-f5f331a8c78fe2223de7885e7a9fda71eb1e7787.tar.gz |
ImsMedia update to support presubmit
- core, config, protocol submodule static libs are created
- libimsmedia shared lib accesses these static libs
- ImsMediaNativeTests accesses these static libs
- Folder structure updated accordingly
Bug: 258455118
Test: Verified MO and MT calls and atest ImsMediaNativeTests
Change-Id: I06e98c7d3dded536ec8a78fc332f9213f4279269
Diffstat (limited to 'service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp')
-rw-r--r-- | service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp new file mode 100644 index 00000000..ee0d76a7 --- /dev/null +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/utils/ISocket.cpp @@ -0,0 +1,40 @@ +/** + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <ISocket.h> +#include <ImsMediaSocket.h> + +ISocket* ISocket::GetInstance( + uint32_t localPort, const char* peerIpAddress, uint32_t peerPort, eSocketClass eSocket) +{ + ISocket* pSocket = NULL; + if (eSocket == SOCKET_CLASS_DEFAULT) + { + pSocket = (ISocket*)ImsMediaSocket::GetInstance(localPort, peerIpAddress, peerPort); + if (pSocket) + pSocket->mSocketClass = SOCKET_CLASS_DEFAULT; + } + + return pSocket; +} + +void ISocket::ReleaseInstance(ISocket* pSocket) +{ + if (pSocket->mSocketClass == SOCKET_CLASS_DEFAULT) + { + ImsMediaSocket::ReleaseInstance((ImsMediaSocket*)pSocket); + } +}
\ No newline at end of file |