class DriveDatabaseManager {

    @SuppressLint("CheckResult")
    public void syncDatabase() {
        // TODO: Make sure the database is closed or inactive before performing this
        // TODO: We can trigger this off of our #close() method in DB helper
        final File filesDir = mContext.getExternalFilesDir(null);
        if (filesDir != null) {
            final File dbFile = new File(filesDir, DatabaseConstants.DATABASE_NAME);
            if (dbFile.exists()) {
                if (!mIsSyncInProgress.getAndSet(true)) {
                    getSyncDatabaseObservable(dbFile)
                            .observeOn(mObserveOnScheduler)
                            .subscribeOn(mSubscribeOnScheduler)
                            .subscribe(identifier -> {
                                Logger.info(DriveDatabaseManager.this, "Successfully synced our database");
                                mGoogleDriveSyncMetadata.setDatabaseSyncIdentifier(identifier);
                                mIsSyncInProgress.set(false);
                            }, throwable -> {
                                mIsSyncInProgress.set(false);
                                mAnalytics.record(new ErrorEvent(DriveDatabaseManager.this, throwable));
                                Logger.error(DriveDatabaseManager.this, "Failed to sync our database", throwable);
                            });
                } else {
                    Logger.debug(DriveDatabaseManager.this, "A sync is already in progress. Ignoring subsequent one for now");
                }
            } else {
                Logger.error(DriveDatabaseManager.this, "Failed to find our main database");
            }
        } else {
            Logger.error(DriveDatabaseManager.this, "Failed to find our main database storage directory");
        }
    }

    public  DriveDatabaseManager(@NonNull Context context, @NonNull DriveStreamsManager driveTaskManager,
                                @NonNull GoogleDriveSyncMetadata googleDriveSyncMetadata,
                                @NonNull Analytics analytics);
    public  DriveDatabaseManager(@NonNull Context context, @NonNull DriveStreamsManager driveTaskManager, @NonNull GoogleDriveSyncMetadata googleDriveSyncMetadata,
                                @NonNull Analytics analytics, @NonNull Scheduler observeOnScheduler, @NonNull Scheduler subscribeOnScheduler);

}