Loading .idea/codeStyles/Project.xmldeleted 100644 → 0 +0 −29 Original line number Diff line number Diff line <component name="ProjectCodeStyleConfiguration"> <code_scheme name="Project" version="173"> <Objective-C-extensions> <file> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" /> </file> <class> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" /> </class> <extensions> <pair source="cpp" header="h" fileNamingConvention="NONE" /> <pair source="c" header="h" fileNamingConvention="NONE" /> </extensions> </Objective-C-extensions> </code_scheme> </component> No newline at end of file app/src/main/java/foundation/e/drive/receivers/BatteryStateReceiver.java +4 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ import android.util.Log; import foundation.e.drive.utils.JobUtils; /** * @author Vincent Bourgmayer */ Loading @@ -30,7 +31,8 @@ public class BatteryStateReceiver extends BroadcastReceiver { String intentAction = intent.getAction(); if(intentAction == null) { Log.e(TAG, "intent Action is null"); } else if ( intentAction.equals(Intent.ACTION_BATTERY_OKAY) ) { } else if ( intentAction.equals(Intent.ACTION_BATTERY_OKAY) && !JobUtils.isScannerJobScheduled(context) ) { JobUtils.scheduleScannerJob(context); //Note: ScreenOffReciever is register in ScannerJob. So no need to register it here. }else if(intentAction.equals(Intent.ACTION_BATTERY_LOW)){ Loading app/src/main/java/foundation/e/drive/services/InitializerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -282,8 +282,9 @@ public class InitializerService extends Service implements OnRemoteOperationList .apply(); //all folder have been created JobUtils.scheduleScannerJob(this); //JobUtils.scheduleScannerJob(this); Intent intent = new Intent(this, ObserverService.class); startService(intent); //JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId); stopSelf(); Loading app/src/main/java/foundation/e/drive/services/ObserverService.java +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ public class ObserverService extends Service implements OnRemoteOperationListene this.mAccount = CommonUtils.getAccount(accountName, accountType, AccountManager.get(this)); if (this.mAccount != null ){ JobUtils.scheduleScannerJob(this); //It should restart counter so we are sure that a synchro will ever happen between now and 30 minutes if ( CommonUtils.isMediaSyncEnabled(this.mAccount) || CommonUtils.isSettingsSyncEnabled(this.mAccount) ) { if (mClient == null) //background task CommonUtils.getOwnCloudClient(this.mAccount, getApplicationContext(), this); Loading app/src/main/java/foundation/e/drive/utils/JobUtils.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,9 @@ public abstract class JobUtils { public static void stopScheduledJob(Context context, int jobId){ context.getSystemService( JobScheduler.class ).cancel(jobId); } public static boolean isScannerJobScheduled(Context context){ return ( (JobScheduler) context.getSystemService( Context.JOB_SCHEDULER_SERVICE ) ) .getPendingJob(ScannerJobId) != null ; } } Loading
.idea/codeStyles/Project.xmldeleted 100644 → 0 +0 −29 Original line number Diff line number Diff line <component name="ProjectCodeStyleConfiguration"> <code_scheme name="Project" version="173"> <Objective-C-extensions> <file> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" /> </file> <class> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" /> </class> <extensions> <pair source="cpp" header="h" fileNamingConvention="NONE" /> <pair source="c" header="h" fileNamingConvention="NONE" /> </extensions> </Objective-C-extensions> </code_scheme> </component> No newline at end of file
app/src/main/java/foundation/e/drive/receivers/BatteryStateReceiver.java +4 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ import android.util.Log; import foundation.e.drive.utils.JobUtils; /** * @author Vincent Bourgmayer */ Loading @@ -30,7 +31,8 @@ public class BatteryStateReceiver extends BroadcastReceiver { String intentAction = intent.getAction(); if(intentAction == null) { Log.e(TAG, "intent Action is null"); } else if ( intentAction.equals(Intent.ACTION_BATTERY_OKAY) ) { } else if ( intentAction.equals(Intent.ACTION_BATTERY_OKAY) && !JobUtils.isScannerJobScheduled(context) ) { JobUtils.scheduleScannerJob(context); //Note: ScreenOffReciever is register in ScannerJob. So no need to register it here. }else if(intentAction.equals(Intent.ACTION_BATTERY_LOW)){ Loading
app/src/main/java/foundation/e/drive/services/InitializerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -282,8 +282,9 @@ public class InitializerService extends Service implements OnRemoteOperationList .apply(); //all folder have been created JobUtils.scheduleScannerJob(this); //JobUtils.scheduleScannerJob(this); Intent intent = new Intent(this, ObserverService.class); startService(intent); //JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId); stopSelf(); Loading
app/src/main/java/foundation/e/drive/services/ObserverService.java +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ public class ObserverService extends Service implements OnRemoteOperationListene this.mAccount = CommonUtils.getAccount(accountName, accountType, AccountManager.get(this)); if (this.mAccount != null ){ JobUtils.scheduleScannerJob(this); //It should restart counter so we are sure that a synchro will ever happen between now and 30 minutes if ( CommonUtils.isMediaSyncEnabled(this.mAccount) || CommonUtils.isSettingsSyncEnabled(this.mAccount) ) { if (mClient == null) //background task CommonUtils.getOwnCloudClient(this.mAccount, getApplicationContext(), this); Loading
app/src/main/java/foundation/e/drive/utils/JobUtils.java +5 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,9 @@ public abstract class JobUtils { public static void stopScheduledJob(Context context, int jobId){ context.getSystemService( JobScheduler.class ).cancel(jobId); } public static boolean isScannerJobScheduled(Context context){ return ( (JobScheduler) context.getSystemService( Context.JOB_SCHEDULER_SERVICE ) ) .getPendingJob(ScannerJobId) != null ; } }