Bug 1651165 - Rename nsIIdleService to nsIUserIdleService in Thunderbird code. rs=bustage-fix
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 21 Jul 2020 15:07:03 +0300
changeset 30173 ab1568fa6f2b090e1b6c2a757f8e353a90365233
parent 30172 13d4a93a840c8d6db0f1fd350a8cf441c8dc80d5
child 30174 1411c065c96371d5001e2b93b9186d57056f2cbb
push id17738
push usermkmelin@iki.fi
push dateTue, 21 Jul 2020 12:07:47 +0000
treeherdercomm-central@ab1568fa6f2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1651165
Bug 1651165 - Rename nsIIdleService to nsIUserIdleService in Thunderbird code. rs=bustage-fix Port https://hg.mozilla.org/mozilla-central/rev/2a646a7936e7
chat/components/src/imCore.jsm
mail/components/search/SearchIntegration.jsm
mailnews/db/gloda/modules/GlodaIndexer.jsm
mailnews/imap/src/nsAutoSyncManager.cpp
mailnews/imap/src/nsAutoSyncManager.h
--- a/chat/components/src/imCore.jsm
+++ b/chat/components/src/imCore.jsm
@@ -56,18 +56,18 @@ UserStatus.prototype = {
       this._removeIdleObserver();
     }
     Services.obs.removeObserver(this, NS_IOSERVICE_GOING_OFFLINE_TOPIC);
     Services.obs.removeObserver(this, NS_IOSERVICE_OFFLINE_STATUS_TOPIC);
   },
   _observingIdleness: false,
   _addIdleObserver() {
     this._observingIdleness = true;
-    this._idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(
-      Ci.nsIIdleService
+    this._idleService = Cc["@mozilla.org/widget/useridleservice;1"].getService(
+      Ci.nsIUserIdleService
     );
     Services.obs.addObserver(this, "im-sent");
 
     this._timeBeforeIdle = Services.prefs.getIntPref(kPrefTimeBeforeIdle);
     if (this._timeBeforeIdle < 0) {
       this._timeBeforeIdle = 0;
     }
     Services.prefs.addObserver(kPrefTimeBeforeIdle, this);
--- a/mail/components/search/SearchIntegration.jsm
+++ b/mail/components/search/SearchIntegration.jsm
@@ -202,18 +202,18 @@ var SearchSupport = {
           // this code pre-dates msgsClassified
           // folderAdded intentionally omitted
           MailServices.mfn.folderDeleted |
           MailServices.mfn.folderMoveCopyCompleted |
           MailServices.mfn.folderRenamed
       );
       // itemEvent intentionally omitted
       Services.obs.addObserver(this, "MsgMsgDisplayed");
-      let idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(
-        Ci.nsIIdleService
+      let idleService = Cc["@mozilla.org/widget/useridleservice;1"].getService(
+        Ci.nsIUserIdleService
       );
       idleService.addIdleObserver(this, this._idleThresholdSecs);
     } else {
       // We want to observe moves, deletes and renames in case we're disabled
       // If we don't, we'll have no idea the support files exist later
       MailServices.mfn.addListener(
         this._msgFolderListener,
         MailServices.mfn.msgsMoveCopyCompleted |
@@ -238,18 +238,18 @@ var SearchSupport = {
     if (this.enabled === null) {
       return;
     }
 
     MailServices.mfn.removeListener(this._msgFolderListener);
 
     if (this.enabled) {
       Services.obs.removeObserver(this, "MsgMsgDisplayed");
-      let idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(
-        Ci.nsIIdleService
+      let idleService = Cc["@mozilla.org/widget/useridleservice;1"].getService(
+        Ci.nsIUserIdleService
       );
       idleService.removeIdleObserver(this, this._idleThresholdSecs);
 
       // in case there's a background sweep going on
       this._cancelTimer();
     }
     // We don't need to do anything extra if we're disabled
   },
--- a/mailnews/db/gloda/modules/GlodaIndexer.jsm
+++ b/mailnews/db/gloda/modules/GlodaIndexer.jsm
@@ -317,18 +317,18 @@ var GlodaIndexer = {
       this._suppressIndexing = true;
     }
 
     // create the timer that drives our intermittent indexing
     this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     // create the timer for larger offsets independent of indexing
     this._longTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
-    this._idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(
-      Ci.nsIIdleService
+    this._idleService = Cc["@mozilla.org/widget/useridleservice;1"].getService(
+      Ci.nsIUserIdleService
     );
 
     // create our performance stopwatches
     try {
       this._perfIndexStopwatch = Cc["@mozilla.org/stopwatch;1"].createInstance(
         Ci.nsIStopwatch
       );
       this._perfPauseStopwatch = Cc["@mozilla.org/stopwatch;1"].createInstance(
--- a/mailnews/imap/src/nsAutoSyncManager.cpp
+++ b/mailnews/imap/src/nsAutoSyncManager.cpp
@@ -202,17 +202,17 @@ nsAutoSyncManager::nsAutoSyncManager() {
 
   mIdleState = notIdle;
   mStartupDone = false;
   mDownloadModel = dmChained;
   mUpdateState = completed;
   mPaused = false;
 
   nsresult rv;
-  mIdleService = do_GetService("@mozilla.org/widget/idleservice;1", &rv);
+  mIdleService = do_GetService("@mozilla.org/widget/useridleservice;1", &rv);
   if (mIdleService) mIdleService->AddIdleObserver(this, kIdleTimeInSec);
 
   // Observe xpcom-shutdown event and app-idle changes
   nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
 
   rv = observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
   observerService->AddObserver(this, kAppIdleNotification, false);
--- a/mailnews/imap/src/nsAutoSyncManager.h
+++ b/mailnews/imap/src/nsAutoSyncManager.h
@@ -9,17 +9,17 @@
 #  include "nsCOMArray.h"
 #  include "nsIObserver.h"
 #  include "nsIUrlListener.h"
 #  include "nsITimer.h"
 #  include "nsTObserverArray.h"
 #  include "nsIAutoSyncManager.h"
 #  include "nsIAutoSyncMsgStrategy.h"
 #  include "nsIAutoSyncFolderStrategy.h"
-#  include "nsIIdleService.h"
+#  include "nsIUserIdleService.h"
 #  include "prtime.h"
 
 // clang-format off
 /* Auto-Sync
  *
  * Background:
  *  it works only with offline imap folders. "autosync_offline_stores" pref
  *  enables/disables auto-sync mechanism. Note that setting "autosync_offline_stores"
@@ -198,17 +198,17 @@ class nsAutoSyncManager final : public n
   // This is set if we've finished startup and should start
   // paying attention to idle notifications.
   bool mStartupDone;
 
  private:
   uint32_t mGroupSize;
   IdleState mIdleState;
   int32_t mDownloadModel;
-  nsCOMPtr<nsIIdleService> mIdleService;
+  nsCOMPtr<nsIUserIdleService> mIdleService;
   nsCOMPtr<nsITimer> mTimer;
   nsTObserverArray<nsCOMPtr<nsIAutoSyncMgrListener> > mListeners;
 };
 
 #endif
 
 /*
 How queues inter-relate: