Эх сурвалжийг харах

Merge pull request #1261 from nextcloud/codacy

Codacy
Andy Scherzinger 4 жил өмнө
parent
commit
f87815753d
40 өөрчлөгдсөн 635 нэмэгдсэн , 679 устгасан
  1. 0 1
      app/src/main/java/com/nextcloud/talk/adapters/ParticipantsAdapter.java
  2. 13 8
      app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java
  3. 9 9
      app/src/main/java/com/nextcloud/talk/adapters/items/CallItem.java
  4. 6 8
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java
  5. 0 1
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicUnreadNoticeMessageViewHolder.java
  6. 1 1
      app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java
  7. 0 2
      app/src/main/java/com/nextcloud/talk/callbacks/MentionAutocompleteCallback.java
  8. 1 2
      app/src/main/java/com/nextcloud/talk/components/filebrowser/controllers/BrowserController.java
  9. 0 79
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.java
  10. 61 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.kt
  11. 0 81
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.java
  12. 63 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.kt
  13. 0 79
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.java
  14. 61 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.kt
  15. 0 79
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.java
  16. 61 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.kt
  17. 0 79
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.java
  18. 61 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.kt
  19. 0 79
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.java
  20. 61 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.kt
  21. 15 13
      app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java
  22. 3 4
      app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java
  23. 3 10
      app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt
  24. 0 3
      app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java
  25. 12 11
      app/src/main/java/com/nextcloud/talk/controllers/LockedController.java
  26. 41 35
      app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java
  27. 1 4
      app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java
  28. 24 18
      app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java
  29. 25 13
      app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java
  30. 14 6
      app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java
  31. 2 2
      app/src/main/java/com/nextcloud/talk/jobs/UploadAndShareFilesWorker.kt
  32. 7 8
      app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java
  33. 2 2
      app/src/main/java/com/nextcloud/talk/utils/AuthenticatorService.java
  34. 43 30
      app/src/main/java/com/nextcloud/talk/utils/PushUtils.java
  35. 8 1
      app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java
  36. 16 4
      app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java
  37. 17 4
      app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java
  38. 2 1
      app/src/test/java/com/nextcloud/talk/utils/DoNotDisturbUtilsTest.java
  39. 1 1
      app/src/test/java/com/nextcloud/talk/utils/ShareUtilsTest.java
  40. 1 1
      app/src/test/java/com/nextcloud/talk/utils/TextMatchersTest.java

+ 0 - 1
app/src/main/java/com/nextcloud/talk/adapters/ParticipantsAdapter.java

@@ -1,7 +1,6 @@
 package com.nextcloud.talk.adapters;
 package com.nextcloud.talk.adapters;
 
 
 import android.content.Context;
 import android.content.Context;
-import android.graphics.Color;
 import android.util.Log;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;

+ 13 - 8
app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java

@@ -23,12 +23,12 @@ package com.nextcloud.talk.adapters.items;
 import android.accounts.Account;
 import android.accounts.Account;
 import android.net.Uri;
 import android.net.Uri;
 import android.view.View;
 import android.view.View;
-import android.widget.*;
-import androidx.annotation.Nullable;
-import androidx.emoji.widget.EmojiTextView;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
 
 
-import butterknife.BindView;
-import butterknife.ButterKnife;
 import com.facebook.drawee.backends.pipeline.Fresco;
 import com.facebook.drawee.backends.pipeline.Fresco;
 import com.facebook.drawee.interfaces.DraweeController;
 import com.facebook.drawee.interfaces.DraweeController;
 import com.facebook.drawee.view.SimpleDraweeView;
 import com.facebook.drawee.view.SimpleDraweeView;
@@ -38,15 +38,20 @@ import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.json.participants.Participant;
 import com.nextcloud.talk.models.json.participants.Participant;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+import androidx.annotation.Nullable;
+import androidx.emoji.widget.EmojiTextView;
+import butterknife.BindView;
+import butterknife.ButterKnife;
 import eu.davidea.flexibleadapter.FlexibleAdapter;
 import eu.davidea.flexibleadapter.FlexibleAdapter;
 import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
 import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
 import eu.davidea.flexibleadapter.items.IFilterable;
 import eu.davidea.flexibleadapter.items.IFilterable;
 import eu.davidea.flexibleadapter.utils.FlexibleUtils;
 import eu.davidea.flexibleadapter.utils.FlexibleUtils;
 import eu.davidea.viewholders.FlexibleViewHolder;
 import eu.davidea.viewholders.FlexibleViewHolder;
 
 
-import java.util.List;
-import java.util.regex.Pattern;
-
 public class AdvancedUserItem extends AbstractFlexibleItem<AdvancedUserItem.UserItemViewHolder> implements
 public class AdvancedUserItem extends AbstractFlexibleItem<AdvancedUserItem.UserItemViewHolder> implements
         IFilterable<String> {
         IFilterable<String> {
 
 

+ 9 - 9
app/src/main/java/com/nextcloud/talk/adapters/items/CallItem.java

@@ -26,12 +26,7 @@ import android.text.format.DateUtils;
 import android.view.View;
 import android.view.View;
 import android.widget.ImageButton;
 import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.ImageView;
-import android.widget.TextView;
 
 
-import androidx.emoji.widget.EmojiTextView;
-
-import butterknife.BindView;
-import butterknife.ButterKnife;
 import com.facebook.drawee.backends.pipeline.Fresco;
 import com.facebook.drawee.backends.pipeline.Fresco;
 import com.facebook.drawee.interfaces.DraweeController;
 import com.facebook.drawee.interfaces.DraweeController;
 import com.facebook.drawee.view.SimpleDraweeView;
 import com.facebook.drawee.view.SimpleDraweeView;
@@ -42,15 +37,20 @@ import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.json.conversations.Conversation;
 import com.nextcloud.talk.models.json.conversations.Conversation;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.util.List;
+import java.util.regex.Pattern;
+
+import androidx.emoji.widget.EmojiTextView;
+import butterknife.BindView;
+import butterknife.ButterKnife;
 import eu.davidea.flexibleadapter.FlexibleAdapter;
 import eu.davidea.flexibleadapter.FlexibleAdapter;
 import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
 import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
 import eu.davidea.flexibleadapter.items.IFilterable;
 import eu.davidea.flexibleadapter.items.IFilterable;
 import eu.davidea.flexibleadapter.utils.FlexibleUtils;
 import eu.davidea.flexibleadapter.utils.FlexibleUtils;
 import eu.davidea.viewholders.FlexibleViewHolder;
 import eu.davidea.viewholders.FlexibleViewHolder;
-import org.greenrobot.eventbus.EventBus;
-
-import java.util.List;
-import java.util.regex.Pattern;
 
 
 public class CallItem extends AbstractFlexibleItem<CallItem.RoomItemViewHolder> implements IFilterable<String> {
 public class CallItem extends AbstractFlexibleItem<CallItem.RoomItemViewHolder> implements IFilterable<String> {
 
 

+ 6 - 8
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -35,7 +35,6 @@ import android.util.Log;
 import android.view.Gravity;
 import android.view.Gravity;
 import android.view.View;
 import android.view.View;
 import android.widget.PopupMenu;
 import android.widget.PopupMenu;
-import android.widget.Toast;
 
 
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
@@ -69,14 +68,12 @@ import androidx.work.Data;
 import androidx.work.OneTimeWorkRequest;
 import androidx.work.OneTimeWorkRequest;
 import androidx.work.WorkInfo;
 import androidx.work.WorkInfo;
 import androidx.work.WorkManager;
 import androidx.work.WorkManager;
-
-import org.jetbrains.annotations.NotNull;
-
 import autodagger.AutoInjector;
 import autodagger.AutoInjector;
 import butterknife.BindView;
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.ButterKnife;
 import io.reactivex.Single;
 import io.reactivex.Single;
 import io.reactivex.SingleObserver;
 import io.reactivex.SingleObserver;
+import io.reactivex.annotations.NonNull;
 import io.reactivex.disposables.Disposable;
 import io.reactivex.disposables.Disposable;
 import io.reactivex.schedulers.Schedulers;
 import io.reactivex.schedulers.Schedulers;
 import okhttp3.OkHttpClient;
 import okhttp3.OkHttpClient;
@@ -461,12 +458,12 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
         }).observeOn(Schedulers.io())
         }).observeOn(Schedulers.io())
                 .subscribe(new SingleObserver<ReadFilesystemOperation>() {
                 .subscribe(new SingleObserver<ReadFilesystemOperation>() {
                     @Override
                     @Override
-                    public void onSubscribe(Disposable d) {
-
+                    public void onSubscribe(@NonNull Disposable d) {
+                        // unused atm
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onSuccess(@NotNull ReadFilesystemOperation readFilesystemOperation) {
+                    public void onSuccess(@NonNull ReadFilesystemOperation readFilesystemOperation) {
                         DavResponse davResponse = readFilesystemOperation.readRemotePath();
                         DavResponse davResponse = readFilesystemOperation.readRemotePath();
                         if (davResponse.data != null) {
                         if (davResponse.data != null) {
                             List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;
                             List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;
@@ -481,7 +478,8 @@ public class MagicPreviewMessageViewHolder extends MessageHolders.IncomingImageM
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onError(Throwable e) {
+                    public void onError(@NonNull Throwable e) {
+                        Log.e(TAG, "Error reading file information", e);
                     }
                     }
                 });
                 });
 
 

+ 0 - 1
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicUnreadNoticeMessageViewHolder.java

@@ -23,7 +23,6 @@ package com.nextcloud.talk.adapters.messages;
 import android.view.View;
 import android.view.View;
 
 
 import com.nextcloud.talk.models.json.chat.ChatMessage;
 import com.nextcloud.talk.models.json.chat.ChatMessage;
-import com.stfalcon.chatkit.commons.ViewHolder;
 import com.stfalcon.chatkit.messages.MessageHolders;
 import com.stfalcon.chatkit.messages.MessageHolders;
 
 
 public class MagicUnreadNoticeMessageViewHolder extends MessageHolders.SystemMessageViewHolder<ChatMessage> {
 public class MagicUnreadNoticeMessageViewHolder extends MessageHolders.SystemMessageViewHolder<ChatMessage> {

+ 1 - 1
app/src/main/java/com/nextcloud/talk/adapters/messages/TalkMessagesListAdapter.java

@@ -27,7 +27,7 @@ import com.stfalcon.chatkit.messages.MessagesListAdapter;
 
 
 import java.util.List;
 import java.util.List;
 
 
-public class TalkMessagesListAdapter<MESSAGE extends IMessage> extends MessagesListAdapter<MESSAGE> {
+public class TalkMessagesListAdapter<M extends IMessage> extends MessagesListAdapter<M> {
 
 
     public TalkMessagesListAdapter(String senderId, MessageHolders holders, ImageLoader imageLoader) {
     public TalkMessagesListAdapter(String senderId, MessageHolders holders, ImageLoader imageLoader) {
         super(senderId, holders, imageLoader);
         super(senderId, holders, imageLoader);

+ 0 - 2
app/src/main/java/com/nextcloud/talk/callbacks/MentionAutocompleteCallback.java

@@ -25,8 +25,6 @@ import android.text.Editable;
 import android.text.Spanned;
 import android.text.Spanned;
 import android.widget.EditText;
 import android.widget.EditText;
 
 
-import androidx.emoji.text.EmojiCompat;
-
 import com.facebook.widget.text.span.BetterImageSpan;
 import com.facebook.widget.text.span.BetterImageSpan;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.database.UserEntity;

+ 1 - 2
app/src/main/java/com/nextcloud/talk/components/filebrowser/controllers/BrowserController.java

@@ -45,7 +45,6 @@ import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 
 
-import org.jetbrains.annotations.NotNull;
 import org.parceler.Parcel;
 import org.parceler.Parcel;
 import org.parceler.Parcels;
 import org.parceler.Parcels;
 
 
@@ -117,7 +116,7 @@ public abstract class BrowserController extends BaseController implements Listin
         selectedPaths = Collections.synchronizedSet(new TreeSet<>());
         selectedPaths = Collections.synchronizedSet(new TreeSet<>());
     }
     }
 
 
-    @NotNull
+    @NonNull
     @Override
     @Override
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
         return inflater.inflate(R.layout.controller_browser, container, false);
         return inflater.inflate(R.layout.controller_browser, container, false);

+ 0 - 79
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.java

@@ -1,79 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class NCEncrypted implements Property {
-    public static final Name NAME = new Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_IS_ENCRYPTED);
-
-    private boolean ncEncrypted;
-
-    private NCEncrypted(boolean isEncrypted) {
-        ncEncrypted = isEncrypted;
-    }
-
-    public boolean isNcEncrypted() {
-        return this.ncEncrypted;
-    }
-
-    public void setNcEncrypted(boolean ncEncrypted) {
-        this.ncEncrypted = ncEncrypted;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new NCEncrypted("1".equals(text));
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("NCEncrypted", "failed to create property", e);
-            }
-
-            return new NCEncrypted(false);
-        }
-
-        @NotNull
-        @Override
-        public Name getName() {
-            return NAME;
-        }
-    }
-}

+ 61 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.kt

@@ -0,0 +1,61 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class NCEncrypted private constructor(var isNcEncrypted: Boolean) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return NCEncrypted("1" == text)
+                }
+            } catch (e: IOException) {
+                Log.e("NCEncrypted", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("NCEncrypted", "failed to create property", e)
+            }
+            return NCEncrypted(false)
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_IS_ENCRYPTED)
+    }
+}

+ 0 - 81
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.java

@@ -1,81 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- * @author Marcel Hibbe
- * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class NCPermission implements Property {
-    public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_PERMISSIONS);
-
-    private String ncPermission;
-
-    private NCPermission(String p) {
-        ncPermission = p;
-    }
-
-    public String getNcPermission() {
-        return this.ncPermission;
-    }
-
-    public void setNcPermission(String ncPermission) {
-        this.ncPermission = ncPermission;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new NCPermission(text);
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("NCPermission", "failed to create property", e);
-            }
-
-            return new NCPermission("");
-        }
-
-        @NotNull
-        @Override
-        public Name getName() {
-            return NAME;
-        }
-    }
-}

+ 63 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.kt

@@ -0,0 +1,63 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Marcel Hibbe
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class NCPermission private constructor(var ncPermission: String?) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return NCPermission(text)
+                }
+            } catch (e: IOException) {
+                Log.e("NCPermission", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("NCPermission", "failed to create property", e)
+            }
+            return NCPermission("")
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_PERMISSIONS)
+    }
+}

+ 0 - 79
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.java

@@ -1,79 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class NCPreview implements Property {
-    public static final Property.Name NAME = new Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_HAS_PREVIEW);
-
-    private boolean ncPreview;
-
-    private NCPreview(boolean hasPreview) {
-        ncPreview = hasPreview;
-    }
-
-    public boolean isNcPreview() {
-        return this.ncPreview;
-    }
-
-    public void setNcPreview(boolean ncPreview) {
-        this.ncPreview = ncPreview;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new NCPreview(Boolean.parseBoolean(text));
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("NCPreview", "failed to create property", e);
-            }
-
-            return new OCFavorite(false);
-        }
-
-        @NotNull
-        @Override
-        public Property.Name getName() {
-            return NAME;
-        }
-    }
-}

+ 61 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.kt

@@ -0,0 +1,61 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class NCPreview private constructor(var isNcPreview: Boolean) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return NCPreview(java.lang.Boolean.parseBoolean(text))
+                }
+            } catch (e: IOException) {
+                Log.e("NCPreview", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("NCPreview", "failed to create property", e)
+            }
+            return OCFavorite(false)
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_HAS_PREVIEW)
+    }
+}

+ 0 - 79
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.java

@@ -1,79 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class OCFavorite implements Property {
-    public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_FAVORITE);
-
-    private boolean ocFavorite;
-
-    OCFavorite(boolean isFavorite) {
-        ocFavorite = isFavorite;
-    }
-
-    public boolean isOcFavorite() {
-        return this.ocFavorite;
-    }
-
-    public void setOcFavorite(boolean ocFavorite) {
-        this.ocFavorite = ocFavorite;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new OCFavorite("1".equals(text));
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("OCFavorite", "failed to create property", e);
-            }
-
-            return new OCFavorite(false);
-        }
-
-        @NotNull
-        @Override
-        public Property.Name getName() {
-            return NAME;
-        }
-    }
-}

+ 61 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.kt

@@ -0,0 +1,61 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class OCFavorite internal constructor(var isOcFavorite: Boolean) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return OCFavorite("1" == text)
+                }
+            } catch (e: IOException) {
+                Log.e("OCFavorite", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("OCFavorite", "failed to create property", e)
+            }
+            return OCFavorite(false)
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_FAVORITE)
+    }
+}

+ 0 - 79
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.java

@@ -1,79 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class OCId implements Property {
-    public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_REMOTE_ID);
-
-    private String ocId;
-
-    private OCId(String id) {
-        ocId = id;
-    }
-
-    public String getOcId() {
-        return this.ocId;
-    }
-
-    public void setOcId(String ocId) {
-        this.ocId = ocId;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new OCId(text);
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("OCId", "failed to create property", e);
-            }
-
-            return new OCId("");
-        }
-
-        @NotNull
-        @Override
-        public Name getName() {
-            return NAME;
-        }
-    }
-}

+ 61 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCId.kt

@@ -0,0 +1,61 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class OCId private constructor(var ocId: String?) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return OCId(text)
+                }
+            } catch (e: IOException) {
+                Log.e("OCId", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("OCId", "failed to create property", e)
+            }
+            return OCId("")
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_REMOTE_ID)
+    }
+}

+ 0 - 79
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.java

@@ -1,79 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.nextcloud.talk.components.filebrowser.models.properties;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.nextcloud.talk.components.filebrowser.webdav.DavUtils;
-
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.PropertyFactory;
-import at.bitfire.dav4jvm.XmlUtils;
-
-public class OCSize implements Property {
-    public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_SIZE);
-
-    private long ocSize;
-
-    private OCSize(long size) {
-        ocSize = size;
-    }
-
-    public long getOcSize() {
-        return this.ocSize;
-    }
-
-    public void setOcSize(long ocSize) {
-        this.ocSize = ocSize;
-    }
-
-    public static class Factory implements PropertyFactory {
-
-        @Nullable
-        @Override
-        public Property create(@NotNull XmlPullParser xmlPullParser) {
-            try {
-                String text = XmlUtils.INSTANCE.readText(xmlPullParser);
-                if (!TextUtils.isEmpty(text)) {
-                    return new OCSize(Long.parseLong(text));
-                }
-            } catch (IOException | XmlPullParserException e) {
-                Log.e("OCSize", "failed to create property", e);
-            }
-
-            return new OCSize(-1);
-        }
-
-        @NotNull
-        @Override
-        public Name getName() {
-            return NAME;
-        }
-    }
-}

+ 61 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCSize.kt

@@ -0,0 +1,61 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.nextcloud.talk.components.filebrowser.models.properties
+
+import android.text.TextUtils
+import android.util.Log
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.PropertyFactory
+import at.bitfire.dav4jvm.XmlUtils.readText
+import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
+import org.xmlpull.v1.XmlPullParser
+import org.xmlpull.v1.XmlPullParserException
+import java.io.IOException
+
+class OCSize private constructor(var ocSize: Long) : Property {
+
+    class Factory : PropertyFactory {
+        override fun create(parser: XmlPullParser): Property {
+            try {
+                val text = readText(parser)
+                if (!TextUtils.isEmpty(text)) {
+                    return OCSize(text!!.toLong())
+                }
+            } catch (e: IOException) {
+                Log.e("OCSize", "failed to create property", e)
+            } catch (e: XmlPullParserException) {
+                Log.e("OCSize", "failed to create property", e)
+            }
+            return OCSize(-1)
+        }
+
+        override fun getName(): Property.Name {
+            return NAME
+        }
+    }
+
+    companion object {
+        @JvmField
+        val NAME: Property.Name = Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_SIZE)
+    }
+}

+ 15 - 13
app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java

@@ -29,12 +29,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
 import android.widget.TextView;
 import android.widget.TextView;
-import androidx.annotation.NonNull;
-import androidx.work.Data;
-import androidx.work.OneTimeWorkRequest;
-import androidx.work.WorkManager;
-import autodagger.AutoInjector;
-import butterknife.BindView;
+
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
@@ -48,7 +43,6 @@ import com.nextcloud.talk.jobs.SignalingSettingsWorker;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
 import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
 import com.nextcloud.talk.models.json.generic.Status;
 import com.nextcloud.talk.models.json.generic.Status;
-import com.nextcloud.talk.models.json.conversations.RoomsOverall;
 import com.nextcloud.talk.models.json.userprofile.UserProfileOverall;
 import com.nextcloud.talk.models.json.userprofile.UserProfileOverall;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ClosedInterfaceImpl;
 import com.nextcloud.talk.utils.ClosedInterfaceImpl;
@@ -57,20 +51,28 @@ import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
 import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
 
 
-import io.reactivex.CompletableObserver;
-import io.reactivex.Observer;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.disposables.Disposable;
-import io.reactivex.schedulers.Schedulers;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 import org.greenrobot.eventbus.ThreadMode;
 
 
-import javax.inject.Inject;
 import java.net.CookieManager;
 import java.net.CookieManager;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
+import javax.inject.Inject;
+
+import androidx.annotation.NonNull;
+import androidx.work.Data;
+import androidx.work.OneTimeWorkRequest;
+import androidx.work.WorkManager;
+import autodagger.AutoInjector;
+import butterknife.BindView;
+import io.reactivex.CompletableObserver;
+import io.reactivex.Observer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+
 
 
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class AccountVerificationController extends BaseController {
 public class AccountVerificationController extends BaseController {

+ 3 - 4
app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java

@@ -79,7 +79,6 @@ import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 import org.greenrobot.eventbus.ThreadMode;
-import org.jetbrains.annotations.NotNull;
 import org.michaelevans.colorart.library.ColorArt;
 import org.michaelevans.colorart.library.ColorArt;
 import org.parceler.Parcels;
 import org.parceler.Parcels;
 
 
@@ -269,12 +268,12 @@ public class CallNotificationController extends BaseController {
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new Observer<RoomOverall>() {
                 .subscribe(new Observer<RoomOverall>() {
                     @Override
                     @Override
-                    public void onSubscribe(Disposable d) {
+                    public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
                         disposablesList.add(d);
                         disposablesList.add(d);
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onNext(@NotNull RoomOverall roomOverall) {
+                    public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) {
                         currentConversation = roomOverall.getOcs().data;
                         currentConversation = roomOverall.getOcs().data;
                         runAllThings();
                         runAllThings();
 
 
@@ -294,7 +293,7 @@ public class CallNotificationController extends BaseController {
 
 
                     @SuppressLint("LongLogTag")
                     @SuppressLint("LongLogTag")
                     @Override
                     @Override
-                    public void onError(Throwable e) {
+                    public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                         Log.e(TAG, e.getMessage(), e);
                         Log.e(TAG, e.getMessage(), e);
                     }
                     }
 
 

+ 3 - 10
app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt

@@ -261,8 +261,7 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
 
 
                     dateTimePicker(
                     dateTimePicker(
                         minDateTime = Calendar.getInstance(),
                         minDateTime = Calendar.getInstance(),
-                        requireFutureDateTime =
-                        true,
+                        requireFutureDateTime = true,
                         currentDateTime = currentTimeCalendar,
                         currentDateTime = currentTimeCalendar,
                         show24HoursView = true,
                         show24HoursView = true,
                         dateTimeCallback = { _,
                         dateTimeCallback = { _,
@@ -310,11 +309,7 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
 
 
     fun submitLobbyChanges() {
     fun submitLobbyChanges() {
         val state = if (
         val state = if (
-            (
-                conversationInfoLobby.findViewById<View>(
-                    R.id.mp_checkable
-                ) as SwitchCompat
-                ).isChecked
+            (conversationInfoLobby.findViewById<View>(R.id.mp_checkable) as SwitchCompat).isChecked
         ) 1 else 0
         ) 1 else 0
 
 
         val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1))
         val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1))
@@ -669,9 +664,7 @@ class ConversationInfoController(args: Bundle) : BaseController(args), FlexibleA
 
 
     private fun loadConversationAvatar() {
     private fun loadConversationAvatar() {
         when (conversation!!.type) {
         when (conversation!!.type) {
-            Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL -> if (
-                !TextUtils.isEmpty(conversation!!.name)
-            ) {
+            Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL -> if (!TextUtils.isEmpty(conversation!!.name)) {
                 val draweeController = Fresco.newDraweeControllerBuilder()
                 val draweeController = Fresco.newDraweeControllerBuilder()
                     .setOldController(conversationAvatarImageView.controller)
                     .setOldController(conversationAvatarImageView.controller)
                     .setAutoPlayAnimations(true)
                     .setAutoPlayAnimations(true)

+ 0 - 3
app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java

@@ -26,7 +26,6 @@ import android.animation.AnimatorInflater;
 import android.annotation.SuppressLint;
 import android.annotation.SuppressLint;
 import android.app.SearchManager;
 import android.app.SearchManager;
 import android.content.Context;
 import android.content.Context;
-import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.Bitmap;
 import android.os.Build;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Bundle;
@@ -47,7 +46,6 @@ import android.widget.RelativeLayout;
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
 import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
-import com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler;
 import com.facebook.common.executors.UiThreadImmediateExecutorService;
 import com.facebook.common.executors.UiThreadImmediateExecutorService;
 import com.facebook.common.references.CloseableReference;
 import com.facebook.common.references.CloseableReference;
 import com.facebook.datasource.DataSource;
 import com.facebook.datasource.DataSource;
@@ -60,7 +58,6 @@ import com.google.android.material.button.MaterialButton;
 import com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.google.android.material.floatingactionbutton.FloatingActionButton;
 import com.kennyc.bottomsheet.BottomSheet;
 import com.kennyc.bottomsheet.BottomSheet;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
-import com.nextcloud.talk.activities.MagicCallActivity;
 import com.nextcloud.talk.activities.MainActivity;
 import com.nextcloud.talk.activities.MainActivity;
 import com.nextcloud.talk.adapters.items.CallItem;
 import com.nextcloud.talk.adapters.items.CallItem;
 import com.nextcloud.talk.adapters.items.ConversationItem;
 import com.nextcloud.talk.adapters.items.ConversationItem;

+ 12 - 11
app/src/main/java/com/nextcloud/talk/controllers/LockedController.java

@@ -33,13 +33,7 @@ import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-import androidx.biometric.BiometricPrompt;
-import androidx.core.content.res.ResourcesCompat;
-import androidx.fragment.app.FragmentActivity;
-import autodagger.AutoInjector;
-import butterknife.OnClick;
+
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.controllers.base.BaseController;
 import com.nextcloud.talk.controllers.base.BaseController;
@@ -47,12 +41,19 @@ import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.SecurityUtils;
 import com.nextcloud.talk.utils.SecurityUtils;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
 
 
-import org.jetbrains.annotations.NotNull;
-
-import javax.inject.Inject;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Executors;
 
 
+import javax.inject.Inject;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RequiresApi;
+import androidx.biometric.BiometricPrompt;
+import androidx.core.content.res.ResourcesCompat;
+import androidx.fragment.app.FragmentActivity;
+import autodagger.AutoInjector;
+import butterknife.OnClick;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class LockedController extends BaseController {
 public class LockedController extends BaseController {
     public static final String TAG = "LockedController";
     public static final String TAG = "LockedController";
@@ -61,7 +62,7 @@ public class LockedController extends BaseController {
     @Inject
     @Inject
     AppPreferences appPreferences;
     AppPreferences appPreferences;
 
 
-    @NotNull
+    @NonNull
     @Override
     @Override
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
         return inflater.inflate(R.layout.controller_locked, container, false);
         return inflater.inflate(R.layout.controller_locked, container, false);

+ 41 - 35
app/src/main/java/com/nextcloud/talk/controllers/ProfileController.java

@@ -65,7 +65,6 @@ import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 
 
-import org.jetbrains.annotations.NotNull;
 import org.parceler.Parcels;
 import org.parceler.Parcels;
 
 
 import java.io.File;
 import java.io.File;
@@ -122,8 +121,8 @@ public class ProfileController extends BaseController {
         super();
         super();
     }
     }
 
 
-    @NotNull
-    protected View inflateView(@NotNull LayoutInflater inflater, @NotNull ViewGroup container) {
+    @NonNull
+    protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
         return inflater.inflate(R.layout.controller_profile, container, false);
         return inflater.inflate(R.layout.controller_profile, container, false);
     }
     }
 
 
@@ -183,23 +182,24 @@ public class ProfileController extends BaseController {
                             .observeOn(AndroidSchedulers.mainThread())
                             .observeOn(AndroidSchedulers.mainThread())
                             .subscribe(new Observer<UserProfileFieldsOverall>() {
                             .subscribe(new Observer<UserProfileFieldsOverall>() {
                                 @Override
                                 @Override
-                                public void onSubscribe(@NotNull Disposable d) {
+                                public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                                    // unused atm
                                 }
                                 }
 
 
                                 @Override
                                 @Override
-                                public void onNext(@NotNull UserProfileFieldsOverall userProfileFieldsOverall) {
+                                public void onNext(@io.reactivex.annotations.NonNull UserProfileFieldsOverall userProfileFieldsOverall) {
                                     editableFields = userProfileFieldsOverall.getOcs().getData();
                                     editableFields = userProfileFieldsOverall.getOcs().getData();
                                     adapter.notifyDataSetChanged();
                                     adapter.notifyDataSetChanged();
                                 }
                                 }
 
 
                                 @Override
                                 @Override
-                                public void onError(@NotNull Throwable e) {
+                                public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                                     edit = false;
                                     edit = false;
                                 }
                                 }
 
 
                                 @Override
                                 @Override
                                 public void onComplete() {
                                 public void onComplete() {
-
+                                    // unused atm
                                 }
                                 }
                             });
                             });
                 } else {
                 } else {
@@ -243,11 +243,12 @@ public class ProfileController extends BaseController {
                         .observeOn(AndroidSchedulers.mainThread())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new Observer<GenericOverall>() {
                         .subscribe(new Observer<GenericOverall>() {
                             @Override
                             @Override
-                            public void onSubscribe(@NotNull Disposable d) {
+                            public void onSubscribe(@NonNull Disposable d) {
+                                // unused atm
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onNext(@NotNull GenericOverall genericOverall) {
+                            public void onNext(@NonNull GenericOverall genericOverall) {
                                 DisplayUtils.loadAvatarImage(
                                 DisplayUtils.loadAvatarImage(
                                         currentUser,
                                         currentUser,
                                         getActivity().findViewById(R.id.avatar_image),
                                         getActivity().findViewById(R.id.avatar_image),
@@ -255,13 +256,13 @@ public class ProfileController extends BaseController {
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onError(@NotNull Throwable e) {
+                            public void onError(@NonNull Throwable e) {
                                 Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
                                 Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
                             }
                             }
 
 
                             @Override
                             @Override
                             public void onComplete() {
                             public void onComplete() {
-
+                                // unused atm
                             }
                             }
                         }));
                         }));
 
 
@@ -273,17 +274,18 @@ public class ProfileController extends BaseController {
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new Observer<UserProfileOverall>() {
                 .subscribe(new Observer<UserProfileOverall>() {
                     @Override
                     @Override
-                    public void onSubscribe(@NotNull Disposable d) {
+                    public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                        // unused atm
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onNext(@NotNull UserProfileOverall userProfileOverall) {
+                    public void onNext(@io.reactivex.annotations.NonNull UserProfileOverall userProfileOverall) {
                         userInfo = userProfileOverall.getOcs().getData();
                         userInfo = userProfileOverall.getOcs().getData();
                         showUserProfile();
                         showUserProfile();
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onError(@NotNull Throwable e) {
+                    public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                         setErrorMessageForMultiList(
                         setErrorMessageForMultiList(
                                 getActivity().getString(R.string.userinfo_no_info_headline),
                                 getActivity().getString(R.string.userinfo_no_info_headline),
                                 getActivity().getString(R.string.userinfo_error_text),
                                 getActivity().getString(R.string.userinfo_error_text),
@@ -292,7 +294,7 @@ public class ProfileController extends BaseController {
 
 
                     @Override
                     @Override
                     public void onComplete() {
                     public void onComplete() {
-
+                        // unused atm
                     }
                     }
                 });
                 });
     }
     }
@@ -349,11 +351,12 @@ public class ProfileController extends BaseController {
                     .observeOn(AndroidSchedulers.mainThread())
                     .observeOn(AndroidSchedulers.mainThread())
                     .subscribe(new Observer<UserProfileFieldsOverall>() {
                     .subscribe(new Observer<UserProfileFieldsOverall>() {
                         @Override
                         @Override
-                        public void onSubscribe(@NotNull Disposable d) {
+                        public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                            // unused atm
                         }
                         }
 
 
                         @Override
                         @Override
-                        public void onNext(@NotNull UserProfileFieldsOverall userProfileFieldsOverall) {
+                        public void onNext(@io.reactivex.annotations.NonNull UserProfileFieldsOverall userProfileFieldsOverall) {
                             editableFields = userProfileFieldsOverall.getOcs().getData();
                             editableFields = userProfileFieldsOverall.getOcs().getData();
 
 
                             getActivity().invalidateOptionsMenu();
                             getActivity().invalidateOptionsMenu();
@@ -361,13 +364,13 @@ public class ProfileController extends BaseController {
                         }
                         }
 
 
                         @Override
                         @Override
-                        public void onError(@NotNull Throwable e) {
+                        public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                             edit = false;
                             edit = false;
                         }
                         }
 
 
                         @Override
                         @Override
                         public void onComplete() {
                         public void onComplete() {
-
+                            // unused atm
                         }
                         }
                     });
                     });
         }
         }
@@ -452,11 +455,12 @@ public class ProfileController extends BaseController {
                         .observeOn(AndroidSchedulers.mainThread())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new Observer<GenericOverall>() {
                         .subscribe(new Observer<GenericOverall>() {
                             @Override
                             @Override
-                            public void onSubscribe(@NotNull Disposable d) {
+                            public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                                // unused atm
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onNext(@NotNull GenericOverall userProfileOverall) {
+                            public void onNext(@io.reactivex.annotations.NonNull GenericOverall userProfileOverall) {
                                 Log.d(TAG, "Successfully saved: " + item.text + " as " + item.field);
                                 Log.d(TAG, "Successfully saved: " + item.text + " as " + item.field);
 
 
                                 if (item.field == Field.DISPLAYNAME) {
                                 if (item.field == Field.DISPLAYNAME) {
@@ -465,7 +469,7 @@ public class ProfileController extends BaseController {
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onError(@NotNull Throwable e) {
+                            public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                                 item.text = userInfo.getValueByField(item.field);
                                 item.text = userInfo.getValueByField(item.field);
                                 Toast.makeText(getApplicationContext(),
                                 Toast.makeText(getApplicationContext(),
                                         String.format(getResources().getString(R.string.failed_to_save),
                                         String.format(getResources().getString(R.string.failed_to_save),
@@ -478,7 +482,7 @@ public class ProfileController extends BaseController {
 
 
                             @Override
                             @Override
                             public void onComplete() {
                             public void onComplete() {
-
+                                // unused atm
                             }
                             }
                         });
                         });
             }
             }
@@ -534,7 +538,7 @@ public class ProfileController extends BaseController {
 
 
             @Override
             @Override
             public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
             public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
-
+                // unused atm
             }
             }
         });
         });
     }
     }
@@ -546,7 +550,6 @@ public class ProfileController extends BaseController {
             file = File.createTempFile("avatar", "png",
             file = File.createTempFile("avatar", "png",
                     Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM));
                     Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM));
 
 
-
             try (FileOutputStream out = new FileOutputStream(file)) {
             try (FileOutputStream out = new FileOutputStream(file)) {
                 bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
                 bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
             } catch (IOException e) {
             } catch (IOException e) {
@@ -602,22 +605,24 @@ public class ProfileController extends BaseController {
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new Observer<GenericOverall>() {
                 .subscribe(new Observer<GenericOverall>() {
                     @Override
                     @Override
-                    public void onSubscribe(@NotNull Disposable d) {
+                    public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                        // unused atm
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onNext(@NotNull GenericOverall genericOverall) {
+                    public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOverall) {
                         DisplayUtils.loadAvatarImage(currentUser, getActivity().findViewById(R.id.avatar_image), true);
                         DisplayUtils.loadAvatarImage(currentUser, getActivity().findViewById(R.id.avatar_image), true);
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onError(@NotNull Throwable e) {
+                    public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                         Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
                         Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
+                        Log.e(TAG, "Error uploading avatar", e);
                     }
                     }
 
 
                     @Override
                     @Override
                     public void onComplete() {
                     public void onComplete() {
-
+                        // unused atm
                     }
                     }
                 });
                 });
     }
     }
@@ -634,23 +639,24 @@ public class ProfileController extends BaseController {
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new Observer<GenericOverall>() {
                 .subscribe(new Observer<GenericOverall>() {
                     @Override
                     @Override
-                    public void onSubscribe(@NotNull Disposable d) {
+                    public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
+                        // unused atm
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onNext(@NotNull GenericOverall userProfileOverall) {
+                    public void onNext(@io.reactivex.annotations.NonNull GenericOverall userProfileOverall) {
                         Log.d(TAG, "Successfully saved: " + item.scope + " as " + item.field);
                         Log.d(TAG, "Successfully saved: " + item.scope + " as " + item.field);
                     }
                     }
 
 
                     @Override
                     @Override
-                    public void onError(@NotNull Throwable e) {
+                    public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                         item.scope = userInfo.getScopeByField(item.field);
                         item.scope = userInfo.getScopeByField(item.field);
                         Log.e(TAG, "Failed to saved: " + item.scope + " as " + item.field, e);
                         Log.e(TAG, "Failed to saved: " + item.scope + " as " + item.field, e);
                     }
                     }
 
 
                     @Override
                     @Override
                     public void onComplete() {
                     public void onComplete() {
-
+                        // unused atm
                     }
                     }
                 });
                 });
     }
     }
@@ -772,7 +778,7 @@ public class ProfileController extends BaseController {
             holder.text.addTextChangedListener(new TextWatcher() {
             holder.text.addTextChangedListener(new TextWatcher() {
                 @Override
                 @Override
                 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-
+                    // unused atm
                 }
                 }
 
 
                 @Override
                 @Override
@@ -786,7 +792,7 @@ public class ProfileController extends BaseController {
 
 
                 @Override
                 @Override
                 public void afterTextChanged(Editable s) {
                 public void afterTextChanged(Editable s) {
-
+                    // unused atm
                 }
                 }
             });
             });
 
 

+ 1 - 4
app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java

@@ -58,9 +58,6 @@ import javax.inject.Inject;
 
 
 import androidx.annotation.NonNull;
 import androidx.annotation.NonNull;
 import androidx.core.content.res.ResourcesCompat;
 import androidx.core.content.res.ResourcesCompat;
-
-import org.jetbrains.annotations.NotNull;
-
 import autodagger.AutoInjector;
 import autodagger.AutoInjector;
 import butterknife.BindView;
 import butterknife.BindView;
 import butterknife.OnClick;
 import butterknife.OnClick;
@@ -99,7 +96,7 @@ public class ServerSelectionController extends BaseController {
 
 
     private Disposable statusQueryDisposable;
     private Disposable statusQueryDisposable;
 
 
-    @NotNull
+    @NonNull
     @Override
     @Override
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
     protected View inflateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
         return inflater.inflate(R.layout.controller_server_selection, container, false);
         return inflater.inflate(R.layout.controller_server_selection, container, false);

+ 24 - 18
app/src/main/java/com/nextcloud/talk/controllers/WebViewLoginController.java

@@ -33,17 +33,16 @@ import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
-import android.webkit.*;
+import android.webkit.ClientCertRequest;
+import android.webkit.CookieSyncManager;
+import android.webkit.SslErrorHandler;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
 import android.widget.ProgressBar;
 import android.widget.ProgressBar;
 
 
-import androidx.annotation.NonNull;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.core.content.res.ResourcesCompat;
-import androidx.work.OneTimeWorkRequest;
-import androidx.work.WorkManager;
-import autodagger.AutoInjector;
-import butterknife.BindView;
-
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.RouterTransaction;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
@@ -60,17 +59,8 @@ import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
 import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
 import com.nextcloud.talk.utils.ssl.MagicTrustManager;
 import com.nextcloud.talk.utils.ssl.MagicTrustManager;
 
 
-import de.cotech.hw.fido.WebViewFidoBridge;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.disposables.Disposable;
-import io.reactivex.schedulers.Schedulers;
-import io.requery.Persistable;
-import io.requery.reactivex.ReactiveEntityStore;
-
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
 
 
-import javax.inject.Inject;
-
 import java.lang.reflect.Field;
 import java.lang.reflect.Field;
 import java.net.CookieManager;
 import java.net.CookieManager;
 import java.net.URLDecoder;
 import java.net.URLDecoder;
@@ -81,6 +71,22 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Locale;
 import java.util.Map;
 import java.util.Map;
 
 
+import javax.inject.Inject;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.content.res.ResourcesCompat;
+import androidx.work.OneTimeWorkRequest;
+import androidx.work.WorkManager;
+import autodagger.AutoInjector;
+import butterknife.BindView;
+import de.cotech.hw.fido.WebViewFidoBridge;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+import io.requery.Persistable;
+import io.requery.reactivex.ReactiveEntityStore;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class WebViewLoginController extends BaseController {
 public class WebViewLoginController extends BaseController {
 
 

+ 25 - 13
app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java

@@ -23,8 +23,7 @@ package com.nextcloud.talk.dagger.modules;
 import android.content.Context;
 import android.content.Context;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.util.Log;
 import android.util.Log;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+
 import com.github.aurae.retrofit2.LoganSquareConverterFactory;
 import com.github.aurae.retrofit2.LoganSquareConverterFactory;
 import com.nextcloud.talk.BuildConfig;
 import com.nextcloud.talk.BuildConfig;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
@@ -38,18 +37,7 @@ import com.nextcloud.talk.utils.singletons.AvatarStatusCodeHolder;
 import com.nextcloud.talk.utils.ssl.MagicKeyManager;
 import com.nextcloud.talk.utils.ssl.MagicKeyManager;
 import com.nextcloud.talk.utils.ssl.MagicTrustManager;
 import com.nextcloud.talk.utils.ssl.MagicTrustManager;
 import com.nextcloud.talk.utils.ssl.SSLSocketFactoryCompat;
 import com.nextcloud.talk.utils.ssl.SSLSocketFactoryCompat;
-import dagger.Module;
-import dagger.Provides;
-import io.reactivex.schedulers.Schedulers;
-import okhttp3.*;
-import okhttp3.internal.tls.OkHostnameVerifier;
-import okhttp3.logging.HttpLoggingInterceptor;
-import retrofit2.Retrofit;
-import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
 
 
-import javax.inject.Singleton;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.X509KeyManager;
 import java.io.IOException;
 import java.io.IOException;
 import java.net.CookieManager;
 import java.net.CookieManager;
 import java.net.InetSocketAddress;
 import java.net.InetSocketAddress;
@@ -61,6 +49,30 @@ import java.security.UnrecoverableKeyException;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
+import javax.inject.Singleton;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.X509KeyManager;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import dagger.Module;
+import dagger.Provides;
+import io.reactivex.schedulers.Schedulers;
+import okhttp3.Authenticator;
+import okhttp3.Cache;
+import okhttp3.Credentials;
+import okhttp3.Dispatcher;
+import okhttp3.Interceptor;
+import okhttp3.JavaNetCookieJar;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import okhttp3.Route;
+import okhttp3.internal.tls.OkHostnameVerifier;
+import okhttp3.logging.HttpLoggingInterceptor;
+import retrofit2.Retrofit;
+import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
+
 @Module(includes = DatabaseModule.class)
 @Module(includes = DatabaseModule.class)
 public class RestModule {
 public class RestModule {
 
 

+ 14 - 6
app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java

@@ -22,9 +22,7 @@ package com.nextcloud.talk.jobs;
 
 
 import android.content.Context;
 import android.content.Context;
 import android.util.Log;
 import android.util.Log;
-import androidx.annotation.NonNull;
-import androidx.work.*;
-import autodagger.AutoInjector;
+
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.nextcloud.talk.api.NcApi;
 import com.nextcloud.talk.api.NcApi;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
@@ -35,15 +33,25 @@ import com.nextcloud.talk.models.json.signaling.settings.SignalingSettingsOveral
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
-import io.reactivex.Observer;
-import io.reactivex.disposables.Disposable;
+
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
 
 
-import javax.inject.Inject;
 import java.io.IOException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
+import javax.inject.Inject;
+
+import androidx.annotation.NonNull;
+import androidx.work.Data;
+import androidx.work.OneTimeWorkRequest;
+import androidx.work.WorkManager;
+import androidx.work.Worker;
+import androidx.work.WorkerParameters;
+import autodagger.AutoInjector;
+import io.reactivex.Observer;
+import io.reactivex.disposables.Disposable;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class SignalingSettingsWorker extends Worker {
 public class SignalingSettingsWorker extends Worker {
     private static final String TAG = "SignalingSettingsJob";
     private static final String TAG = "SignalingSettingsJob";

+ 2 - 2
app/src/main/java/com/nextcloud/talk/jobs/UploadAndShareFilesWorker.kt

@@ -102,8 +102,8 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
         try {
         try {
             val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
             val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
             val buf = ByteArray(input.available())
             val buf = ByteArray(input.available())
-            while (input.read(buf) != -1);
-            requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), buf)
+            while (input.read(buf) != -1)
+                requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), buf)
         } catch (e: Exception) {
         } catch (e: Exception) {
             Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
             Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
         }
         }

+ 7 - 8
app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountDialogFragment.java

@@ -49,14 +49,13 @@ import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 
 
-import org.jetbrains.annotations.NotNull;
-
 import java.net.CookieManager;
 import java.net.CookieManager;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 import javax.inject.Inject;
 import javax.inject.Inject;
 
 
+import androidx.annotation.NonNull;
 import androidx.fragment.app.DialogFragment;
 import androidx.fragment.app.DialogFragment;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import autodagger.AutoInjector;
 import autodagger.AutoInjector;
@@ -82,7 +81,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
     private final List<AdvancedUserItem> userItems = new ArrayList<>();
     private final List<AdvancedUserItem> userItems = new ArrayList<>();
 
 
     @SuppressLint("InflateParams")
     @SuppressLint("InflateParams")
-    @NotNull
+    @NonNull
     @Override
     @Override
     public Dialog onCreateDialog(Bundle savedInstanceState) {
     public Dialog onCreateDialog(Bundle savedInstanceState) {
         binding = DialogChooseAccountBinding.inflate(LayoutInflater.from(requireContext()));
         binding = DialogChooseAccountBinding.inflate(LayoutInflater.from(requireContext()));
@@ -92,7 +91,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
     }
     }
 
 
     @Override
     @Override
-    public void onViewCreated(@NotNull View view, Bundle savedInstanceState) {
+    public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
         super.onViewCreated(view, savedInstanceState);
         NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
         NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
 
 
@@ -183,7 +182,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
     }
     }
 
 
     @Override
     @Override
-    public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         return dialogView;
         return dialogView;
     }
     }
 
 
@@ -211,12 +210,12 @@ public class ChooseAccountDialogFragment extends DialogFragment {
                                              null)
                                              null)
                         .subscribe(new Observer<UserEntity>() {
                         .subscribe(new Observer<UserEntity>() {
                             @Override
                             @Override
-                            public void onSubscribe(@NotNull Disposable d) {
+                            public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) {
                                 // unused at the moment
                                 // unused at the moment
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onNext(@NotNull UserEntity userEntity) {
+                            public void onNext(@io.reactivex.annotations.NonNull UserEntity userEntity) {
                                 cookieManager.getCookieStore().removeAll();
                                 cookieManager.getCookieStore().removeAll();
                                 userUtils.disableAllUsersWithoutId(userEntity.getId());
                                 userUtils.disableAllUsersWithoutId(userEntity.getId());
                                 if (getActivity() != null) {
                                 if (getActivity() != null) {
@@ -227,7 +226,7 @@ public class ChooseAccountDialogFragment extends DialogFragment {
                             }
                             }
 
 
                             @Override
                             @Override
-                            public void onError(@NotNull Throwable e) {
+                            public void onError(@io.reactivex.annotations.NonNull Throwable e) {
                                 Log.w(TAG, "Error updating user", e);
                                 Log.w(TAG, "Error updating user", e);
                             }
                             }
 
 

+ 2 - 2
app/src/main/java/com/nextcloud/talk/utils/AuthenticatorService.java

@@ -34,6 +34,8 @@ import android.os.IBinder;
 
 
 public class AuthenticatorService extends Service {
 public class AuthenticatorService extends Service {
 
 
+    private static Authenticator authenticator = null;
+
     private static class Authenticator extends AbstractAccountAuthenticator {
     private static class Authenticator extends AbstractAccountAuthenticator {
         public Authenticator(Context context) {
         public Authenticator(Context context) {
             super(context);
             super(context);
@@ -83,8 +85,6 @@ public class AuthenticatorService extends Service {
 
 
     }
     }
 
 
-    private static Authenticator authenticator = null;
-
     protected Authenticator getAuthenticator() {
     protected Authenticator getAuthenticator() {
         if (authenticator == null) {
         if (authenticator == null) {
             authenticator = new Authenticator(this);
             authenticator = new Authenticator(this);

+ 43 - 30
app/src/main/java/com/nextcloud/talk/utils/PushUtils.java

@@ -24,7 +24,7 @@ import android.content.Context;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.util.Base64;
 import android.util.Base64;
 import android.util.Log;
 import android.util.Log;
-import autodagger.AutoInjector;
+
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.api.NcApi;
 import com.nextcloud.talk.api.NcApi;
@@ -36,14 +36,24 @@ import com.nextcloud.talk.models.json.push.PushConfigurationState;
 import com.nextcloud.talk.models.json.push.PushRegistrationOverall;
 import com.nextcloud.talk.models.json.push.PushRegistrationOverall;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.database.user.UserUtils;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.nextcloud.talk.utils.preferences.AppPreferences;
-import io.reactivex.Observer;
-import io.reactivex.disposables.Disposable;
-import io.reactivex.schedulers.Schedulers;
+
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
 
 
-import javax.inject.Inject;
-import java.io.*;
-import java.security.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.security.InvalidKeyException;
+import java.security.Key;
+import java.security.KeyFactory;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
+import java.security.Signature;
+import java.security.SignatureException;
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.PKCS8EncodedKeySpec;
 import java.security.spec.PKCS8EncodedKeySpec;
 import java.security.spec.X509EncodedKeySpec;
 import java.security.spec.X509EncodedKeySpec;
@@ -51,6 +61,14 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import javax.inject.Inject;
+
+import autodagger.AutoInjector;
+import io.reactivex.Observer;
+import io.reactivex.annotations.NonNull;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class PushUtils {
 public class PushUtils {
     private static final String TAG = "PushUtils";
     private static final String TAG = "PushUtils";
@@ -238,7 +256,6 @@ public class PushUtils {
                         if (((TextUtils.isEmpty(providerValue) || accountPushData == null) && !userEntity.getScheduledForDeletion()) ||
                         if (((TextUtils.isEmpty(providerValue) || accountPushData == null) && !userEntity.getScheduledForDeletion()) ||
                                 (accountPushData != null && !accountPushData.getPushToken().equals(token) && !userEntity.getScheduledForDeletion())) {
                                 (accountPushData != null && !accountPushData.getPushToken().equals(token) && !userEntity.getScheduledForDeletion())) {
 
 
-
                             Map<String, String> queryMap = new HashMap<>();
                             Map<String, String> queryMap = new HashMap<>();
                             queryMap.put("format", "json");
                             queryMap.put("format", "json");
                             queryMap.put("pushTokenHash", pushTokenHash);
                             queryMap.put("pushTokenHash", pushTokenHash);
@@ -247,18 +264,17 @@ public class PushUtils {
 
 
                             credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken());
                             credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken());
 
 
-                            String finalCredentials = credentials;
                             ncApi.registerDeviceForNotificationsWithNextcloud(
                             ncApi.registerDeviceForNotificationsWithNextcloud(
                                     credentials,
                                     credentials,
                                     ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap)
                                     ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap)
                                     .subscribe(new Observer<PushRegistrationOverall>() {
                                     .subscribe(new Observer<PushRegistrationOverall>() {
                                         @Override
                                         @Override
-                                        public void onSubscribe(Disposable d) {
-
+                                        public void onSubscribe(@NonNull Disposable d) {
+                                            // unused atm
                                         }
                                         }
 
 
                                         @Override
                                         @Override
-                                        public void onNext(PushRegistrationOverall pushRegistrationOverall) {
+                                        public void onNext(@NonNull PushRegistrationOverall pushRegistrationOverall) {
                                             Map<String, String> proxyMap = new HashMap<>();
                                             Map<String, String> proxyMap = new HashMap<>();
                                             proxyMap.put("pushToken", token);
                                             proxyMap.put("pushToken", token);
                                             proxyMap.put("deviceIdentifier", pushRegistrationOverall.getOcs().getData().
                                             proxyMap.put("deviceIdentifier", pushRegistrationOverall.getOcs().getData().
@@ -268,18 +284,17 @@ public class PushUtils {
                                             proxyMap.put("userPublicKey", pushRegistrationOverall.getOcs()
                                             proxyMap.put("userPublicKey", pushRegistrationOverall.getOcs()
                                                     .getData().getPublicKey());
                                                     .getData().getPublicKey());
 
 
-
                                             ncApi.registerDeviceForNotificationsWithProxy(
                                             ncApi.registerDeviceForNotificationsWithProxy(
                                                     ApiUtils.getUrlPushProxy(), proxyMap)
                                                     ApiUtils.getUrlPushProxy(), proxyMap)
                                                     .subscribeOn(Schedulers.io())
                                                     .subscribeOn(Schedulers.io())
                                                     .subscribe(new Observer<Void>() {
                                                     .subscribe(new Observer<Void>() {
                                                         @Override
                                                         @Override
-                                                        public void onSubscribe(Disposable d) {
-
+                                                        public void onSubscribe(@NonNull Disposable d) {
+                                                            // unused atm
                                                         }
                                                         }
 
 
                                                         @Override
                                                         @Override
-                                                        public void onNext(Void aVoid) {
+                                                        public void onNext(@NonNull Void aVoid) {
                                                             PushConfigurationState pushConfigurationState =
                                                             PushConfigurationState pushConfigurationState =
                                                                     new PushConfigurationState();
                                                                     new PushConfigurationState();
                                                             pushConfigurationState.setPushToken(token);
                                                             pushConfigurationState.setPushToken(token);
@@ -302,17 +317,17 @@ public class PushUtils {
                                                                         null, userEntity.getId(), null, null, null)
                                                                         null, userEntity.getId(), null, null, null)
                                                                         .subscribe(new Observer<UserEntity>() {
                                                                         .subscribe(new Observer<UserEntity>() {
                                                                             @Override
                                                                             @Override
-                                                                            public void onSubscribe(Disposable d) {
-
+                                                                            public void onSubscribe(@NonNull Disposable d) {
+                                                                                // unused atm
                                                                             }
                                                                             }
 
 
                                                                             @Override
                                                                             @Override
-                                                                            public void onNext(UserEntity userEntity) {
+                                                                            public void onNext(@NonNull UserEntity userEntity) {
                                                                                 eventBus.post(new EventStatus(userEntity.getId(), EventStatus.EventType.PUSH_REGISTRATION, true));
                                                                                 eventBus.post(new EventStatus(userEntity.getId(), EventStatus.EventType.PUSH_REGISTRATION, true));
                                                                             }
                                                                             }
 
 
                                                                             @Override
                                                                             @Override
-                                                                            public void onError(Throwable e) {
+                                                                            public void onError(@NonNull Throwable e) {
                                                                                 eventBus.post(new EventStatus
                                                                                 eventBus.post(new EventStatus
                                                                                         (userEntity.getId(),
                                                                                         (userEntity.getId(),
                                                                                                 EventStatus.EventType
                                                                                                 EventStatus.EventType
@@ -321,38 +336,36 @@ public class PushUtils {
 
 
                                                                             @Override
                                                                             @Override
                                                                             public void onComplete() {
                                                                             public void onComplete() {
-
+                                                                                // unused atm
                                                                             }
                                                                             }
                                                                         });
                                                                         });
                                                             } catch (IOException e) {
                                                             } catch (IOException e) {
-                                                                Log.e(TAG, "IOException while updating user");
+                                                                Log.e(TAG, "IOException while updating user", e);
                                                             }
                                                             }
-
-
                                                         }
                                                         }
 
 
                                                         @Override
                                                         @Override
-                                                        public void onError(Throwable e) {
+                                                        public void onError(@NonNull Throwable e) {
                                                             eventBus.post(new EventStatus(userEntity.getId(),
                                                             eventBus.post(new EventStatus(userEntity.getId(),
                                                                     EventStatus.EventType.PUSH_REGISTRATION, false));
                                                                     EventStatus.EventType.PUSH_REGISTRATION, false));
                                                         }
                                                         }
 
 
                                                         @Override
                                                         @Override
                                                         public void onComplete() {
                                                         public void onComplete() {
-
+                                                            // unused atm
                                                         }
                                                         }
                                                     });
                                                     });
                                         }
                                         }
 
 
                                         @Override
                                         @Override
-                                        public void onError(Throwable e) {
+                                        public void onError(@NonNull Throwable e) {
                                             eventBus.post(new EventStatus(userEntity.getId(),
                                             eventBus.post(new EventStatus(userEntity.getId(),
                                                     EventStatus.EventType.PUSH_REGISTRATION, false));
                                                     EventStatus.EventType.PUSH_REGISTRATION, false));
-
                                         }
                                         }
 
 
                                         @Override
                                         @Override
                                         public void onComplete() {
                                         public void onComplete() {
+                                            // unused atm
                                         }
                                         }
                                     });
                                     });
                         }
                         }
@@ -383,9 +396,9 @@ public class PushUtils {
             }
             }
 
 
         } catch (NoSuchAlgorithmException e) {
         } catch (NoSuchAlgorithmException e) {
-            Log.d("TAG", "No such algorithm while reading key from string");
+            Log.d(TAG, "No such algorithm while reading key from string");
         } catch (InvalidKeySpecException e) {
         } catch (InvalidKeySpecException e) {
-            Log.d("TAG", "Invalid key spec while reading key from string");
+            Log.d(TAG, "Invalid key spec while reading key from string");
         }
         }
 
 
         return null;
         return null;

+ 8 - 1
app/src/main/java/com/nextcloud/talk/utils/preferences/AppPreferences.java

@@ -21,7 +21,14 @@
 package com.nextcloud.talk.utils.preferences;
 package com.nextcloud.talk.utils.preferences;
 
 
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
-import net.orange_box.storebox.annotations.method.*;
+
+import net.orange_box.storebox.annotations.method.ClearMethod;
+import net.orange_box.storebox.annotations.method.DefaultValue;
+import net.orange_box.storebox.annotations.method.KeyByResource;
+import net.orange_box.storebox.annotations.method.KeyByString;
+import net.orange_box.storebox.annotations.method.RegisterChangeListenerMethod;
+import net.orange_box.storebox.annotations.method.RemoveMethod;
+import net.orange_box.storebox.annotations.method.UnregisterChangeListenerMethod;
 import net.orange_box.storebox.annotations.option.SaveOption;
 import net.orange_box.storebox.annotations.option.SaveOption;
 import net.orange_box.storebox.enums.SaveMode;
 import net.orange_box.storebox.enums.SaveMode;
 import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener;
 import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener;

+ 16 - 4
app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java

@@ -24,8 +24,7 @@ package com.nextcloud.talk.webrtc;
 import android.content.Context;
 import android.content.Context;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.util.Log;
 import android.util.Log;
-import androidx.annotation.Nullable;
-import autodagger.AutoInjector;
+
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.bluelinelabs.logansquare.LoganSquare;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
@@ -37,16 +36,29 @@ import com.nextcloud.talk.models.json.signaling.DataChannelMessage;
 import com.nextcloud.talk.models.json.signaling.DataChannelMessageNick;
 import com.nextcloud.talk.models.json.signaling.DataChannelMessageNick;
 import com.nextcloud.talk.models.json.signaling.NCIceCandidate;
 import com.nextcloud.talk.models.json.signaling.NCIceCandidate;
 import com.nextcloud.talk.utils.LoggingUtils;
 import com.nextcloud.talk.utils.LoggingUtils;
+
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.EventBus;
-import org.webrtc.*;
+import org.webrtc.DataChannel;
+import org.webrtc.IceCandidate;
+import org.webrtc.MediaConstraints;
+import org.webrtc.MediaStream;
+import org.webrtc.PeerConnection;
+import org.webrtc.PeerConnectionFactory;
+import org.webrtc.RtpReceiver;
+import org.webrtc.SdpObserver;
+import org.webrtc.SessionDescription;
 
 
-import javax.inject.Inject;
 import java.io.IOException;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 
 
+import javax.inject.Inject;
+
+import androidx.annotation.Nullable;
+import autodagger.AutoInjector;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class MagicPeerConnectionWrapper {
 public class MagicPeerConnectionWrapper {
     private static String TAG = "MagicPeerConnectionWrapper";
     private static String TAG = "MagicPeerConnectionWrapper";

+ 17 - 4
app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java

@@ -20,18 +20,31 @@
 
 
 package com.nextcloud.talk.webrtc;
 package com.nextcloud.talk.webrtc;
 
 
-import autodagger.AutoInjector;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.database.UserEntity;
 import com.nextcloud.talk.models.json.signaling.NCMessageWrapper;
 import com.nextcloud.talk.models.json.signaling.NCMessageWrapper;
-import com.nextcloud.talk.models.json.websocket.*;
+import com.nextcloud.talk.models.json.websocket.ActorWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.AuthParametersWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.AuthWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.CallOverallWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.CallWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.HelloOverallWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.HelloWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.RequestOfferOverallWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.RequestOfferSignalingMessage;
+import com.nextcloud.talk.models.json.websocket.RoomOverallWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.RoomWebSocketMessage;
+import com.nextcloud.talk.models.json.websocket.SignalingDataWebSocketMessageForOffer;
 import com.nextcloud.talk.utils.ApiUtils;
 import com.nextcloud.talk.utils.ApiUtils;
-import okhttp3.OkHttpClient;
 
 
-import javax.inject.Inject;
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map;
 
 
+import javax.inject.Inject;
+
+import autodagger.AutoInjector;
+import okhttp3.OkHttpClient;
+
 @AutoInjector(NextcloudTalkApplication.class)
 @AutoInjector(NextcloudTalkApplication.class)
 public class WebSocketConnectionHelper {
 public class WebSocketConnectionHelper {
     private static Map<Long, MagicWebSocketInstance> magicWebSocketInstanceMap = new HashMap<>();
     private static Map<Long, MagicWebSocketInstance> magicWebSocketInstanceMap = new HashMap<>();

+ 2 - 1
app/src/test/java/com/nextcloud/talk/utils/DoNotDisturbUtilsTest.java

@@ -40,7 +40,8 @@ import org.powermock.modules.junit4.PowerMockRunner;
 import java.lang.reflect.Field;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Modifier;
 
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.when;
 import static org.mockito.Mockito.when;
 import static org.powermock.api.mockito.PowerMockito.mockStatic;
 import static org.powermock.api.mockito.PowerMockito.mockStatic;
 
 

+ 1 - 1
app/src/test/java/com/nextcloud/talk/utils/ShareUtilsTest.java

@@ -38,7 +38,7 @@ import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 import org.powermock.modules.junit4.PowerMockRunner;
 
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static org.mockito.Mockito.when;
 import static org.powermock.api.mockito.PowerMockito.mockStatic;
 import static org.powermock.api.mockito.PowerMockito.mockStatic;

+ 1 - 1
app/src/test/java/com/nextcloud/talk/utils/TextMatchersTest.java

@@ -24,7 +24,7 @@ import com.nextcloud.talk.models.json.chat.ChatMessage;
 
 
 import org.junit.Test;
 import org.junit.Test;
 
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 
 public class TextMatchersTest {
 public class TextMatchersTest {