Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-23 00:16:06 +02:00
parent f862f7ff8f
commit a299a230c6
5 changed files with 10 additions and 13 deletions

View file

@ -99,7 +99,6 @@ public class MagicCallActivity extends AppCompatActivity {
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
eventBus.post(new ConfigurationChangeEvent());
}
}

View file

@ -215,8 +215,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
if (adapter == null) {
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
currentUser = userUtils.getCurrentUser();
if (currentUser != null) {
fetchData(true);
}

View file

@ -83,7 +83,6 @@ public class AccountRemovalWorker extends Worker {
PushConfigurationState.class);
PushConfigurationState finalPushConfigurationState = pushConfigurationState;
ApplicationWideApiHolder.getInstance().removeNcApiInstanceForAccountId(userEntity.getId());
ncApi = ApplicationWideApiHolder.getInstance().getNcApiInstanceForAccountId(userEntity.getId(), null);
credentials = ApiUtils.getCredentials(userEntity.getUserId(), userEntity.getToken());
@ -116,6 +115,9 @@ public class AccountRemovalWorker extends Worker {
@Override
public void onNext(Void aVoid) {
ApplicationWideApiHolder.getInstance().removeNcApiInstanceForAccountId(userEntity.getId());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String groupName = String.format(getApplicationContext().getResources()
.getString(R.string
@ -140,6 +142,7 @@ public class AccountRemovalWorker extends Worker {
@Override
public void onComplete() {
}
@Override

View file

@ -267,8 +267,7 @@ public class PushUtils {
ncApi.registerDeviceForNotificationsWithNextcloud(
credentials,
ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap)
.subscribeOn(Schedulers.newThread())
.subscribe(new Observer<PushRegistrationOverall>() {
.blockingSubscribe(new Observer<PushRegistrationOverall>() {
@Override
public void onSubscribe(Disposable d) {
@ -289,7 +288,7 @@ public class PushUtils {
ncApi.registerDeviceForNotificationsWithProxy(finalCredentials,
ApiUtils.getUrlPushProxy(), proxyMap)
.subscribeOn(Schedulers.newThread())
.subscribe(new Observer<Void>() {
.blockingSubscribe(new Observer<Void>() {
@Override
public void onSubscribe(Disposable d) {
@ -317,7 +316,7 @@ public class PushUtils {
userEntity.getDisplayName(),
LoganSquare.serialize(pushConfigurationState), null,
null, userEntity.getId(), null, null)
.subscribe(new Observer<UserEntity>() {
.blockingSubscribe(new Observer<UserEntity>() {
@Override
public void onSubscribe(Disposable d) {

View file

@ -49,9 +49,8 @@ public class UserUtils {
}
public List getUsers() {
Result findUsersQueryResult = dataStore.select(User.class).where(UserEntity.SCHEDULED_FOR_DELETION.notEqual
(true))
.get();
Result findUsersQueryResult = dataStore.select(User.class).where
(UserEntity.SCHEDULED_FOR_DELETION.notEqual(true)).get();
return findUsersQueryResult.toList();
}
@ -109,8 +108,7 @@ public class UserUtils {
}
public UserEntity getUserWithId(long id) {
Result findUserQueryResult = dataStore.select(User.class).where(UserEntity.ID.eq(id)
.and(UserEntity.SCHEDULED_FOR_DELETION.notEqual(true)))
Result findUserQueryResult = dataStore.select(User.class).where(UserEntity.ID.eq(id))
.limit(1).get();
return (UserEntity) findUserQueryResult.firstOrNull();