mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-13 07:44:11 +01:00
codacy: These nested if statements could be combined
This commit is contained in:
parent
4440e1e192
commit
c6de6bdf28
@ -146,13 +146,12 @@ public class CallsListController extends BaseController implements SearchView.On
|
||||
|
||||
userEntity = userUtils.getCurrentUser();
|
||||
|
||||
if (userEntity == null) {
|
||||
if (getParentController() != null && getParentController().getRouter() != null) {
|
||||
if (userEntity == null &&
|
||||
getParentController() != null && getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
}
|
||||
|
||||
if (adapter == null) {
|
||||
adapter = new FlexibleAdapter<>(callItems, getActivity(), false);
|
||||
@ -359,12 +358,11 @@ public class CallsListController extends BaseController implements SearchView.On
|
||||
private void dispose(@Nullable Disposable disposable) {
|
||||
if (disposable != null && !disposable.isDisposed()) {
|
||||
disposable.dispose();
|
||||
} else if (disposable == null) {
|
||||
|
||||
if (roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed()) {
|
||||
} else if (disposable == null &&
|
||||
roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed() {
|
||||
roomsQueryDisposable.dispose();
|
||||
roomsQueryDisposable = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,20 +184,18 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
|
||||
userEntity = userUtils.getCurrentUser();
|
||||
|
||||
if (userEntity == null) {
|
||||
if (getParentController().getRouter() != null) {
|
||||
if (userEntity == null &&
|
||||
getParentController() != null && getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
}
|
||||
|
||||
if (adapter == null) {
|
||||
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
|
||||
adapter.setNotifyChangeOfUnfilteredItems(true)
|
||||
.setMode(SelectableAdapter.Mode.MULTI);
|
||||
|
||||
|
||||
if (userEntity != null) {
|
||||
fetchData();
|
||||
}
|
||||
|
@ -545,9 +545,10 @@ public class MagicAudioManager {
|
||||
bluetoothManager.updateDevice();
|
||||
}
|
||||
|
||||
if (needBluetoothAudioStart && !needBluetoothAudioStop) {
|
||||
// Attempt to start Bluetooth SCO audio (takes a few second to start).
|
||||
if (!bluetoothManager.startScoAudio()) {
|
||||
if (needBluetoothAudioStart &&
|
||||
!needBluetoothAudioStop &&
|
||||
!bluetoothManager.startScoAudio()) {
|
||||
// Remove BLUETOOTH from list of available devices since SCO failed.
|
||||
audioDevices.remove(AudioDevice.BLUETOOTH);
|
||||
audioDeviceSetUpdated = true;
|
||||
|
@ -111,12 +111,11 @@ public class MagicProximitySensor implements SensorEventListener {
|
||||
@Override
|
||||
public final void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
threadChecker.checkIsOnValidThread();
|
||||
if (sensor.getType() == Sensor.TYPE_PROXIMITY) {
|
||||
if (accuracy == SensorManager.SENSOR_STATUS_UNRELIABLE) {
|
||||
if (sensor.getType() == Sensor.TYPE_PROXIMITY &&
|
||||
accuracy == SensorManager.SENSOR_STATUS_UNRELIABLE) {
|
||||
Log.e(TAG, "The values returned by this sensor cannot be trusted");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onSensorChanged(SensorEvent event) {
|
||||
|
Loading…
Reference in New Issue
Block a user