Fixed crashs
This commit is contained in:
parent
5172bcf5be
commit
b52bd60ca3
2 changed files with 10 additions and 2 deletions
|
@ -404,7 +404,9 @@ public final class LinphoneService extends Service {
|
|||
LinphoneManager.destroy();
|
||||
|
||||
// Make sure our notification is gone.
|
||||
if (mNotificationManager != null) {
|
||||
mNotificationManager.destroy();
|
||||
}
|
||||
|
||||
// This will prevent the app from crashing if the service gets killed in background mode
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
|
|
|
@ -101,6 +101,10 @@ public class NetworkSettingsFragment extends Fragment {
|
|||
|
||||
mAndroidBatterySaverSettings =
|
||||
mRootView.findViewById(R.id.pref_android_battery_protected_settings);
|
||||
mAndroidBatterySaverSettings.setVisibility(
|
||||
DeviceUtils.hasDevicePowerManager(LinphoneActivity.instance())
|
||||
? View.VISIBLE
|
||||
: View.GONE);
|
||||
}
|
||||
|
||||
protected void setListeners() {
|
||||
|
@ -209,8 +213,10 @@ public class NetworkSettingsFragment extends Fragment {
|
|||
Intent intent =
|
||||
DeviceUtils.getDevicePowerManagerIntent(
|
||||
LinphoneActivity.instance());
|
||||
if (intent != null) {
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue