From 2365be851fd8bfe153f78478220a86bb6fcceb38 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 17 Oct 2019 21:35:50 +0200 Subject: [PATCH] ActivityMonitor --- app/src/main/java/info/nightscout/androidaps/MainApp.java | 6 +++--- .../general/timeSpent/TS.kt => utils/ActivityMonitor.kt} | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/src/main/java/info/nightscout/androidaps/{plugins/general/timeSpent/TS.kt => utils/ActivityMonitor.kt} (91%) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index 97c5d49c0c..d0f41abb4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -51,7 +51,7 @@ import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin; import info.nightscout.androidaps.plugins.general.persistentNotification.PersistentNotificationPlugin; import info.nightscout.androidaps.plugins.general.signatureVerifier.SignatureVerifier; import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin; -import info.nightscout.androidaps.plugins.general.timeSpent.TS; +import info.nightscout.androidaps.utils.ActivityMonitor; import info.nightscout.androidaps.plugins.general.versionChecker.VersionCheckerPlugin; import info.nightscout.androidaps.plugins.general.wear.WearPlugin; import info.nightscout.androidaps.plugins.general.xdripStatusline.StatuslinePlugin; @@ -139,7 +139,7 @@ public class MainApp extends Application { log.error("Error with Fabric init! " + e); } - registerActivityLifecycleCallbacks(TS.INSTANCE); + registerActivityLifecycleCallbacks(ActivityMonitor.INSTANCE); mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); mFirebaseAnalytics.setAnalyticsCollectionEnabled(!Boolean.getBoolean("disableFirebase")); @@ -441,7 +441,7 @@ public class MainApp extends Application { if (timeDateOrTZChangeReceiver != null) { unregisterReceiver(timeDateOrTZChangeReceiver); } - unregisterActivityLifecycleCallbacks(TS.INSTANCE); + unregisterActivityLifecycleCallbacks(ActivityMonitor.INSTANCE); } public static int dpToPx(int dp) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/timeSpent/TS.kt b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/timeSpent/TS.kt rename to app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt index e00a8a1599..b546e766a6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/timeSpent/TS.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.timeSpent +package info.nightscout.androidaps.utils import android.app.Activity import android.app.Application @@ -6,7 +6,7 @@ import android.os.Bundle import info.nightscout.androidaps.logging.L import org.slf4j.LoggerFactory -object TS : Application.ActivityLifecycleCallbacks { +object ActivityMonitor : Application.ActivityLifecycleCallbacks { private val log = LoggerFactory.getLogger(L.CORE) override fun onActivityPaused(activity: Activity?) { log.debug("onActivityPaused " + activity?.localClassName)