1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef nsUserIdleServiceAndroid_h__
9 #define nsUserIdleServiceAndroid_h__
11 #include "nsUserIdleService.h"
12 #include "mozilla/AppShutdown.h"
14 class nsUserIdleServiceAndroid
: public nsUserIdleService
{
16 NS_INLINE_DECL_REFCOUNTING_INHERITED(nsUserIdleServiceAndroid
,
19 bool PollIdleTime(uint32_t* aIdleTime
) override
;
21 static already_AddRefed
<nsUserIdleServiceAndroid
> GetInstance() {
22 RefPtr
<nsUserIdleService
> idleService
= nsUserIdleService::GetInstance();
24 // Avoid late instantiation or resurrection during shutdown.
25 if (mozilla::AppShutdown::IsInOrBeyond(
26 mozilla::ShutdownPhase::AppShutdownConfirmed
)) {
29 idleService
= new nsUserIdleServiceAndroid();
32 return idleService
.forget().downcast
<nsUserIdleServiceAndroid
>();
36 nsUserIdleServiceAndroid() {}
37 virtual ~nsUserIdleServiceAndroid() {}
40 #endif // nsUserIdleServiceAndroid_h__