Fix crash on Android 2.2 on call

This commit is contained in:
Sylvain Berfini 2014-02-03 17:29:08 +01:00
parent 82036f3e57
commit 360e437597

View file

@ -483,7 +483,10 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
stopForegroundCompat(NOTIF_ID);
mNM.cancel(INCALL_NOTIF_ID);
mNM.cancel(MESSAGE_NOTIF_ID);
if (Version.sdkAboveOrEqual(Version.API12_HONEYCOMB_MR1_31X)) {
mWifiLock.release();
}
((AlarmManager) this.getSystemService(Context.ALARM_SERVICE)).cancel(mkeepAlivePendingIntent);
super.onDestroy();
}
@ -588,14 +591,18 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
// Workaround bug current call seems to be updated after state changed to streams running
if (getResources().getBoolean(R.bool.enable_call_notification))
refreshIncallIcon(call);
if (Version.sdkAboveOrEqual(Version.API12_HONEYCOMB_MR1_31X)) {
mWifiLock.acquire();
}
} else {
if (getResources().getBoolean(R.bool.enable_call_notification))
refreshIncallIcon(LinphoneManager.getLc().getCurrentCall());
}
if ((state == State.CallEnd || state == State.Error) && LinphoneManager.getLc().getCallsNb() < 1) {
if (Version.sdkAboveOrEqual(Version.API12_HONEYCOMB_MR1_31X)) {
mWifiLock.release();
}
}
mHandler.post(new Runnable() {
public void run() {