Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
47dab4f4
Commit
47dab4f4
authored
Oct 19, 2017
by
Benjamin REIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only include jni.h for android
parent
ef94fd50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
19 deletions
+12
-19
android-helpers.cpp
coreapi/android-helpers.cpp
+6
-9
call-session.cpp
src/conference/session/call-session.cpp
+6
-10
No files found.
coreapi/android-helpers.cpp
View file @
47dab4f4
...
...
@@ -17,16 +17,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "private.h"
#include "platform-helpers.h"
#include <jni.h>
#ifdef __ANDROID__
#include <jni.h>
namespace
LinphonePrivate
{
class
AndroidPlatformHelpers
:
public
PlatformHelpers
{
...
...
@@ -52,7 +49,7 @@ private:
jmethodID
mCpuLockReleaseId
;
jmethodID
mGetDnsServersId
;
jmethodID
mGetPowerManagerId
;
};
jmethodID
AndroidPlatformHelpers
::
getMethodId
(
JNIEnv
*
env
,
jclass
klass
,
const
char
*
method
,
const
char
*
signature
){
...
...
@@ -77,7 +74,7 @@ AndroidPlatformHelpers::AndroidPlatformHelpers(LinphoneCore *lc, void *system_co
return
;
}
mJavaHelper
=
(
jobject
)
env
->
NewGlobalRef
(
mJavaHelper
);
mWifiLockAcquireId
=
getMethodId
(
env
,
klass
,
"acquireWifiLock"
,
"()V"
);
mWifiLockReleaseId
=
getMethodId
(
env
,
klass
,
"releaseWifiLock"
,
"()V"
);
mMcastLockAcquireId
=
getMethodId
(
env
,
klass
,
"acquireMcastLock"
,
"()V"
);
...
...
@@ -86,10 +83,10 @@ AndroidPlatformHelpers::AndroidPlatformHelpers(LinphoneCore *lc, void *system_co
mCpuLockReleaseId
=
getMethodId
(
env
,
klass
,
"releaseCpuLock"
,
"()V"
);
mGetDnsServersId
=
getMethodId
(
env
,
klass
,
"getDnsServers"
,
"()[Ljava/lang/String;"
);
mGetPowerManagerId
=
getMethodId
(
env
,
klass
,
"getPowerManager"
,
"()Ljava/lang/Object;"
);
jobject
pm
=
env
->
CallObjectMethod
(
mJavaHelper
,
mGetPowerManagerId
);
belle_sip_wake_lock_init
(
env
,
pm
);
ms_message
(
"AndroidPlatformHelpers is fully initialised"
);
}
...
...
src/conference/session/call-session.cpp
View file @
47dab4f4
...
...
@@ -108,11 +108,9 @@ void CallSessionPrivate::setState(LinphoneCallState newState, const string &mess
switch
(
newState
)
{
case
LinphoneCallOutgoingInit
:
case
LinphoneCallIncomingReceived
:
#ifdef __ANDROID__
lInfo
()
<<
"CallSession ["
<<
q
<<
"] acquires both wifi and multicast lock"
;
linphone_core_wifi_lock_acquire
(
core
);
linphone_core_multicast_lock_acquire
(
core
);
/* Does no affect battery more than regular rtp traffic */
#endif
getPlatformHelpers
(
core
)
->
acquireWifiLock
();
getPlatformHelpers
(
core
)
->
acquireMcastLock
();
getPlatformHelpers
(
core
)
->
acquireCpuLock
();
break
;
case
LinphoneCallEnd
:
case
LinphoneCallError
:
...
...
@@ -152,11 +150,9 @@ void CallSessionPrivate::setState(LinphoneCallState newState, const string &mess
log
->
connected_date_time
=
ms_time
(
nullptr
);
break
;
case
LinphoneCallReleased
:
#ifdef __ANDROID__
lInfo
()
<<
"CallSession ["
<<
q
<<
"] releases wifi/multicast lock"
;
linphone_core_wifi_lock_release
(
core
);
linphone_core_multicast_lock_release
(
core
);
#endif
getPlatformHelpers
(
core
)
->
acquireWifiLock
();
getPlatformHelpers
(
core
)
->
acquireMcastLock
();
getPlatformHelpers
(
core
)
->
acquireCpuLock
();
break
;
default
:
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment