From 7bb48465e21a8468a5a9ed61b81989903c8b36a4 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 2 Nov 2019 15:44:31 +0100 Subject: rename build flavors --- .../de/pixart/messenger/services/EmojiService.java | 26 +++++++++++++++ .../messenger/services/PushManagementService.java | 37 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 src/git/java/de/pixart/messenger/services/EmojiService.java create mode 100644 src/git/java/de/pixart/messenger/services/PushManagementService.java (limited to 'src/git/java/de/pixart/messenger/services') diff --git a/src/git/java/de/pixart/messenger/services/EmojiService.java b/src/git/java/de/pixart/messenger/services/EmojiService.java new file mode 100644 index 000000000..f76cf5a4b --- /dev/null +++ b/src/git/java/de/pixart/messenger/services/EmojiService.java @@ -0,0 +1,26 @@ +package de.pixart.messenger.services; + +import android.content.Context; +import android.os.Build; + +import androidx.emoji.bundled.BundledEmojiCompatConfig; +import androidx.emoji.text.EmojiCompat; + +public class EmojiService { + + private final Context context; + + public EmojiService(Context context) { + this.context = context; + } + + public void init(boolean useBundledEmoji) { + BundledEmojiCompatConfig config = new BundledEmojiCompatConfig(context); + //On recent Androids we assume to have the latest emojis + //there are some annoying bugs with emoji compat that make it a safer choice not to use it when possible + // a) the text preview has annoying glitches when the cut of text contains emojis (the emoji will be half visible) + // b) can trigger a hardware rendering bug https://issuetracker.google.com/issues/67102093 + config.setReplaceAll(useBundledEmoji && Build.VERSION.SDK_INT < Build.VERSION_CODES.O); + EmojiCompat.init(config); + } +} \ No newline at end of file diff --git a/src/git/java/de/pixart/messenger/services/PushManagementService.java b/src/git/java/de/pixart/messenger/services/PushManagementService.java new file mode 100644 index 000000000..9d4673fd3 --- /dev/null +++ b/src/git/java/de/pixart/messenger/services/PushManagementService.java @@ -0,0 +1,37 @@ +package de.pixart.messenger.services; + +import de.pixart.messenger.entities.Account; +import de.pixart.messenger.entities.Conversation; + +public class PushManagementService { + + protected final XmppConnectionService mXmppConnectionService; + + public PushManagementService(XmppConnectionService service) { + this.mXmppConnectionService = service; + } + + void registerPushTokenOnServer(Account account) { + //stub implementation. only affects playstore flavor + } + + void registerPushTokenOnServer(Conversation conversation) { + //stub implementation. only affects playstore flavor + } + + void unregisterChannel(Account account, String hash) { + //stub implementation. only affects playstore flavor + } + + void disablePushOnServer(Conversation conversation) { + //stub implementation. only affects playstore flavor + } + + public boolean available(Account account) { + return false; + } + + public boolean isStub() { + return true; + } +} -- cgit v1.2.3