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,12 +146,11 @@ public class CallsListController extends BaseController implements SearchView.On
|
||||
|
||||
userEntity = userUtils.getCurrentUser();
|
||||
|
||||
if (userEntity == null) {
|
||||
if (getParentController() != null && getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
if (userEntity == null &&
|
||||
getParentController() != null && getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
|
||||
if (adapter == null) {
|
||||
@ -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) {
|
||||
} else if (disposable == null &&
|
||||
roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed() {
|
||||
roomsQueryDisposable.dispose();
|
||||
roomsQueryDisposable = null;
|
||||
|
||||
if (roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed()) {
|
||||
roomsQueryDisposable.dispose();
|
||||
roomsQueryDisposable = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,12 +184,11 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
|
||||
userEntity = userUtils.getCurrentUser();
|
||||
|
||||
if (userEntity == null) {
|
||||
if (getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
if (userEntity == null &&
|
||||
getParentController() != null && getParentController().getRouter() != null) {
|
||||
getParentController().getRouter().setRoot((RouterTransaction.with(new ServerSelectionController())
|
||||
.pushChangeHandler(new HorizontalChangeHandler())
|
||||
.popChangeHandler(new HorizontalChangeHandler())));
|
||||
}
|
||||
|
||||
if (adapter == null) {
|
||||
@ -197,7 +196,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
||||
adapter.setNotifyChangeOfUnfilteredItems(true)
|
||||
.setMode(SelectableAdapter.Mode.MULTI);
|
||||
|
||||
|
||||
if (userEntity != null) {
|
||||
fetchData();
|
||||
}
|
||||
|
@ -545,14 +545,15 @@ public class MagicAudioManager {
|
||||
bluetoothManager.updateDevice();
|
||||
}
|
||||
|
||||
if (needBluetoothAudioStart && !needBluetoothAudioStop) {
|
||||
// Attempt to start Bluetooth SCO audio (takes a few second to start).
|
||||
if (!bluetoothManager.startScoAudio()) {
|
||||
// Remove BLUETOOTH from list of available devices since SCO failed.
|
||||
audioDevices.remove(AudioDevice.BLUETOOTH);
|
||||
audioDeviceSetUpdated = true;
|
||||
}
|
||||
// Attempt to start Bluetooth SCO audio (takes a few second to start).
|
||||
if (needBluetoothAudioStart &&
|
||||
!needBluetoothAudioStop &&
|
||||
!bluetoothManager.startScoAudio()) {
|
||||
// Remove BLUETOOTH from list of available devices since SCO failed.
|
||||
audioDevices.remove(AudioDevice.BLUETOOTH);
|
||||
audioDeviceSetUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Update selected audio device.
|
||||
AudioDevice newAudioDevice = selectedAudioDevice;
|
||||
|
@ -111,10 +111,9 @@ 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) {
|
||||
Log.e(TAG, "The values returned by this sensor cannot be trusted");
|
||||
}
|
||||
if (sensor.getType() == Sensor.TYPE_PROXIMITY &&
|
||||
accuracy == SensorManager.SENSOR_STATUS_UNRELIABLE) {
|
||||
Log.e(TAG, "The values returned by this sensor cannot be trusted");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user