Commit 074665b9 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Fixed Android service stop & restart multiplying listeners + fixed tester compilation

parent b03a68b8
......@@ -29,7 +29,12 @@ if(SQLITE3_FOUND)
list(APPEND OTHER_LIBS_FOR_TESTER ${SQLITE3_LIBRARIES})
endif()
if(ZLIB_FOUND)
list(APPEND OTHER_LIBS_FOR_TESTER ${ZLIB_LIBRARIES})
if (ANDROID)
# Starting NDK r21, libz.a has issues: https://github.com/android/ndk/issues/1179
list(APPEND OTHER_LIBS_FOR_TESTER z)
else()
list(APPEND OTHER_LIBS_FOR_TESTER ${ZLIB_LIBRARIES})
endif()
endif()
set(SOUND_FILES
......
......@@ -91,6 +91,11 @@ public class CoreService extends Service {
if (core != null) {
Log.i("[Core Service] Core Manager found, adding our listener");
core.addListener(mListener);
if (core.getCallsNb() > 0) {
Log.w("[Core Service] Service started while at least one call active !");
startForeground();
}
}
}
......@@ -114,6 +119,15 @@ public class CoreService extends Service {
@Override
public synchronized void onDestroy() {
Log.i("[Core Service] Stopping");
if (CoreManager.isReady()) {
Core core = CoreManager.instance().getCore();
if (core != null) {
Log.i("[Core Service] Core Manager found, removing our listener");
core.removeListener(mListener);
}
}
super.onDestroy();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment