From 2e5334eca70f84b5825965cb18bbe14d569161fe Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 20 Sep 2016 22:21:42 +0200 Subject: [PATCH] Create MrMailbox object. --- .../main/java/org/telegram/messenger/ApplicationLoader.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java index fb47b2eb3..5fa4901fb 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java @@ -53,6 +53,8 @@ public class ApplicationLoader extends Application { public static volatile boolean isScreenOn = false; public static volatile boolean mainInterfacePaused = true; + public static long hMailbox = 0; + public static boolean isCustomTheme() { return isCustomTheme; } @@ -289,6 +291,10 @@ public class ApplicationLoader extends Application { ConnectionsManager.native_setJava(Build.VERSION.SDK_INT == 14 || Build.VERSION.SDK_INT == 15); new ForegroundDetector(this); + // create a MrMailbox object; as android stops the App by just killing it, we do never call MrMailboxUnref() + // however, we may want to to have a look at onPause() eg. of activities (eg. for flushing data, if needed) + hMailbox = MrMailbox.MrMailboxNew(); + applicationHandler = new Handler(applicationContext.getMainLooper()); startPushService();