зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1085568 - nsIdleService should write Android logs as "GeckoIdleService", not "IdleService", and at DEBUG. r=vlad
This commit is contained in:
Родитель
ccd8895aa4
Коммит
7b766d90a3
|
@ -50,6 +50,9 @@ using namespace mozilla;
|
||||||
static PRLogModuleInfo *sLog = nullptr;
|
static PRLogModuleInfo *sLog = nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define LOG_TAG "GeckoIdleService"
|
||||||
|
#define LOG_LEVEL ANDROID_LOG_DEBUG
|
||||||
|
|
||||||
// Use this to find previously added observers in our array:
|
// Use this to find previously added observers in our array:
|
||||||
class IdleListenerComparator
|
class IdleListenerComparator
|
||||||
{
|
{
|
||||||
|
@ -94,7 +97,7 @@ nsIdleServiceDaily::Observe(nsISupports *,
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG,
|
PR_LOG(sLog, PR_LOG_DEBUG,
|
||||||
("nsIdleServiceDaily: Notifying idle-daily observers"));
|
("nsIdleServiceDaily: Notifying idle-daily observers"));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Notifying idle-daily observers");
|
"Notifying idle-daily observers");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -130,7 +133,7 @@ nsIdleServiceDaily::Observe(nsISupports *,
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG,
|
PR_LOG(sLog, PR_LOG_DEBUG,
|
||||||
("nsIdleServiceDaily: Storing last idle time as %d sec.", nowSec));
|
("nsIdleServiceDaily: Storing last idle time as %d sec.", nowSec));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Storing last idle time as %d", nowSec);
|
"Storing last idle time as %d", nowSec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -198,7 +201,7 @@ nsIdleServiceDaily::Init()
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG,
|
PR_LOG(sLog, PR_LOG_DEBUG,
|
||||||
("nsIdleServiceDaily: Setting timer a day from now"));
|
("nsIdleServiceDaily: Setting timer a day from now"));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Setting timer a day from now");
|
"Setting timer a day from now");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -251,7 +254,7 @@ nsIdleServiceDaily::StageIdleDaily(bool aHasBeenLongWait)
|
||||||
("nsIdleServiceDaily: Registering Idle observer callback "
|
("nsIdleServiceDaily: Registering Idle observer callback "
|
||||||
"(short wait requested? %d)", aHasBeenLongWait));
|
"(short wait requested? %d)", aHasBeenLongWait));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Registering Idle observer callback");
|
"Registering Idle observer callback");
|
||||||
#endif
|
#endif
|
||||||
mIdleDailyTriggerWait = (aHasBeenLongWait ?
|
mIdleDailyTriggerWait = (aHasBeenLongWait ?
|
||||||
|
@ -267,7 +270,7 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure)
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG,
|
PR_LOG(sLog, PR_LOG_DEBUG,
|
||||||
("nsIdleServiceDaily: DailyCallback running"));
|
("nsIdleServiceDaily: DailyCallback running"));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"DailyCallback running");
|
"DailyCallback running");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -286,7 +289,7 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure)
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec",
|
PR_LOG(sLog, PR_LOG_DEBUG, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec",
|
||||||
delayTime / PR_USEC_PER_MSEC));
|
delayTime / PR_USEC_PER_MSEC));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"DailyCallback resetting timer to %lld msec",
|
"DailyCallback resetting timer to %lld msec",
|
||||||
delayTime / PR_USEC_PER_MSEC);
|
delayTime / PR_USEC_PER_MSEC);
|
||||||
#endif
|
#endif
|
||||||
|
@ -436,7 +439,7 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS)
|
||||||
("idleService: Register idle observer %p for %d seconds",
|
("idleService: Register idle observer %p for %d seconds",
|
||||||
aObserver, aIdleTimeInS));
|
aObserver, aIdleTimeInS));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Register idle observer %p for %d seconds",
|
"Register idle observer %p for %d seconds",
|
||||||
aObserver, aIdleTimeInS);
|
aObserver, aIdleTimeInS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -464,7 +467,7 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS)
|
||||||
("idleService: Register: adjusting next switch from %d to %d seconds",
|
("idleService: Register: adjusting next switch from %d to %d seconds",
|
||||||
mDeltaToNextIdleSwitchInS, aIdleTimeInS));
|
mDeltaToNextIdleSwitchInS, aIdleTimeInS));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Register: adjusting next switch from %d to %d seconds",
|
"Register: adjusting next switch from %d to %d seconds",
|
||||||
mDeltaToNextIdleSwitchInS, aIdleTimeInS);
|
mDeltaToNextIdleSwitchInS, aIdleTimeInS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -506,7 +509,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS)
|
||||||
("idleService: Remove observer %p (%d seconds), %d remain idle",
|
("idleService: Remove observer %p (%d seconds), %d remain idle",
|
||||||
aObserver, aTimeInS, mIdleObserverCount));
|
aObserver, aTimeInS, mIdleObserverCount));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Remove observer %p (%d seconds), %d remain idle",
|
"Remove observer %p (%d seconds), %d remain idle",
|
||||||
aObserver, aTimeInS, mIdleObserverCount);
|
aObserver, aTimeInS, mIdleObserverCount);
|
||||||
#endif
|
#endif
|
||||||
|
@ -518,7 +521,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS)
|
||||||
("idleService: Failed to remove idle observer %p (%d seconds)",
|
("idleService: Failed to remove idle observer %p (%d seconds)",
|
||||||
aObserver, aTimeInS));
|
aObserver, aTimeInS));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Failed to remove idle observer %p (%d seconds)",
|
"Failed to remove idle observer %p (%d seconds)",
|
||||||
aObserver, aTimeInS);
|
aObserver, aTimeInS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -592,7 +595,7 @@ nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS)
|
||||||
("idleService: Reset idle timeout: tell observer %p user is back",
|
("idleService: Reset idle timeout: tell observer %p user is back",
|
||||||
notifyList[numberOfPendingNotifications]));
|
notifyList[numberOfPendingNotifications]));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Reset idle timeout: tell observer %p user is back",
|
"Reset idle timeout: tell observer %p user is back",
|
||||||
notifyList[numberOfPendingNotifications]);
|
notifyList[numberOfPendingNotifications]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -628,7 +631,7 @@ nsIdleService::GetIdleTime(uint32_t* idleTime)
|
||||||
("idleService: Get idle time: time since reset %u msec",
|
("idleService: Get idle time: time since reset %u msec",
|
||||||
timeSinceResetInMS));
|
timeSinceResetInMS));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Get idle time: time since reset %u msec",
|
"Get idle time: time since reset %u msec",
|
||||||
timeSinceResetInMS);
|
timeSinceResetInMS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -683,7 +686,7 @@ nsIdleService::IdleTimerCallback(void)
|
||||||
PR_LOG(sLog, PR_LOG_ALWAYS,
|
PR_LOG(sLog, PR_LOG_ALWAYS,
|
||||||
("idleService: Idle timer callback: failed to get idle time"));
|
("idleService: Idle timer callback: failed to get idle time"));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Idle timer callback: failed to get idle time");
|
"Idle timer callback: failed to get idle time");
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
|
@ -693,7 +696,7 @@ nsIdleService::IdleTimerCallback(void)
|
||||||
("idleService: Idle timer callback: current idle time %u msec",
|
("idleService: Idle timer callback: current idle time %u msec",
|
||||||
currentIdleTimeInMS));
|
currentIdleTimeInMS));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Idle timer callback: current idle time %u msec",
|
"Idle timer callback: current idle time %u msec",
|
||||||
currentIdleTimeInMS);
|
currentIdleTimeInMS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -776,7 +779,7 @@ nsIdleService::IdleTimerCallback(void)
|
||||||
("idleService: **** Idle timer callback: tell observer %p user is idle",
|
("idleService: **** Idle timer callback: tell observer %p user is idle",
|
||||||
notifyList[numberOfPendingNotifications]));
|
notifyList[numberOfPendingNotifications]));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"Idle timer callback: tell observer %p user is idle",
|
"Idle timer callback: tell observer %p user is idle",
|
||||||
notifyList[numberOfPendingNotifications]);
|
notifyList[numberOfPendingNotifications]);
|
||||||
#endif
|
#endif
|
||||||
|
@ -798,7 +801,7 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
|
||||||
nextTimeoutDuration.ToMilliseconds()));
|
nextTimeoutDuration.ToMilliseconds()));
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"SetTimerExpiryIfBefore: next timeout %0.f msec from now",
|
"SetTimerExpiryIfBefore: next timeout %0.f msec from now",
|
||||||
nextTimeoutDuration.ToMilliseconds());
|
nextTimeoutDuration.ToMilliseconds());
|
||||||
#endif
|
#endif
|
||||||
|
@ -832,7 +835,7 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
|
||||||
("idleService: IdleService reset timer expiry to %0.f msec from now",
|
("idleService: IdleService reset timer expiry to %0.f msec from now",
|
||||||
deltaTime.ToMilliseconds()));
|
deltaTime.ToMilliseconds()));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"reset timer expiry to %0.f msec from now",
|
"reset timer expiry to %0.f msec from now",
|
||||||
deltaTime.ToMilliseconds());
|
deltaTime.ToMilliseconds());
|
||||||
#endif
|
#endif
|
||||||
|
@ -856,7 +859,7 @@ nsIdleService::ReconfigureTimer(void)
|
||||||
PR_LOG(sLog, PR_LOG_DEBUG,
|
PR_LOG(sLog, PR_LOG_DEBUG,
|
||||||
("idleService: ReconfigureTimer: no idle or waiting observers"));
|
("idleService: ReconfigureTimer: no idle or waiting observers"));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"ReconfigureTimer: no idle or waiting observers");
|
"ReconfigureTimer: no idle or waiting observers");
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
|
@ -880,7 +883,7 @@ nsIdleService::ReconfigureTimer(void)
|
||||||
nextTimeoutDuration.ToMilliseconds()));
|
nextTimeoutDuration.ToMilliseconds()));
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"next timeout %0.f msec from now",
|
"next timeout %0.f msec from now",
|
||||||
nextTimeoutDuration.ToMilliseconds());
|
nextTimeoutDuration.ToMilliseconds());
|
||||||
#endif
|
#endif
|
||||||
|
@ -895,7 +898,7 @@ nsIdleService::ReconfigureTimer(void)
|
||||||
("idleService: idle observers, reducing timeout to %lu msec from now",
|
("idleService: idle observers, reducing timeout to %lu msec from now",
|
||||||
MIN_IDLE_POLL_INTERVAL_MSEC));
|
MIN_IDLE_POLL_INTERVAL_MSEC));
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
__android_log_print(ANDROID_LOG_INFO, "IdleService",
|
__android_log_print(LOG_LEVEL, LOG_TAG,
|
||||||
"idle observers, reducing timeout to %lu msec from now",
|
"idle observers, reducing timeout to %lu msec from now",
|
||||||
MIN_IDLE_POLL_INTERVAL_MSEC);
|
MIN_IDLE_POLL_INTERVAL_MSEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче