Fix crash with dozemode
This commit is contained in:
parent
17cb58b074
commit
7e8b12175d
1 changed files with 2 additions and 1 deletions
|
@ -846,9 +846,10 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
mDozeReceiver = new DozeReceiver();
|
||||
|
||||
if (mPrefs.isDozeModeEnabled()) {
|
||||
mServiceContext.registerReceiver(mDozeReceiver, mDozeIntentFilter);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
dozeModeEnabled = ((PowerManager) mServiceContext.getSystemService(Context.POWER_SERVICE)).isDeviceIdleMode();
|
||||
if (dozeModeEnabled)
|
||||
mServiceContext.registerReceiver(mDozeReceiver, mDozeIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue