#ifndef CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_
#define CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_
#include <stdint.h>
#include "base/android/jni_android.h"
#include "base/lazy_instance.h"
#include "base/time/time.h"
#include "third_party/blink/public/mojom/background_sync/background_sync.mojom.h"
class BackgroundSyncLauncherAndroid {
public:
static BackgroundSyncLauncherAndroid* Get();
BackgroundSyncLauncherAndroid(const BackgroundSyncLauncherAndroid&) = delete;
BackgroundSyncLauncherAndroid& operator=(
const BackgroundSyncLauncherAndroid&) = delete;
static void ScheduleBrowserWakeUpWithDelay(
blink::mojom::BackgroundSyncType sync_type,
base::TimeDelta delay);
static void CancelBrowserWakeup(blink::mojom::BackgroundSyncType sync_type);
static bool ShouldDisableBackgroundSync();
static void SetPlayServicesVersionCheckDisabledForTests(bool disabled);
void FireBackgroundSyncEvents(
blink::mojom::BackgroundSyncType sync_type,
const base::android::JavaParamRef<jobject>& j_runnable);
private:
friend struct base::LazyInstanceTraitsBase<BackgroundSyncLauncherAndroid>;
BackgroundSyncLauncherAndroid();
~BackgroundSyncLauncherAndroid();
void ScheduleBrowserWakeUpWithDelayImpl(
blink::mojom::BackgroundSyncType sync_type,
base::TimeDelta soonest_wakeup_delta);
void CancelBrowserWakeupImpl(blink::mojom::BackgroundSyncType sync_type);
base::android::ScopedJavaGlobalRef<jobject>
java_background_sync_background_task_scheduler_launcher_;
};
#endif