Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 083ab6f8 authored by vince-bourgmayer's avatar vince-bourgmayer
Browse files

register ScreenOffReciever at end of initializer

parent 945f3372
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ import android.accounts.AccountManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Environment;
@@ -32,6 +33,7 @@ import java.util.List;

import foundation.e.drive.models.SyncedFolder;
import foundation.e.drive.operations.CreateInitialFolderRemoteOperation;
import foundation.e.drive.receivers.ScreenOffReceiver;
import foundation.e.drive.utils.AppConstants;
import foundation.e.drive.utils.CommonUtils;
import foundation.e.drive.utils.IGetOCClient;
@@ -282,7 +284,12 @@ public class InitializerService extends Service implements OnRemoteOperationList
                .apply();

        //all folder have been created
        //JobUtils.scheduleScannerJob(this);
        IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        getApplicationContext().registerReceiver(ScreenOffReceiver.getInstance(), filter);

        //Register screenOffReciever

        Intent intent = new Intent(this, ObserverService.class);
        startService(intent);
        //JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId);