Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
eDrive
Commits
0f69bbb2
Commit
0f69bbb2
authored
Sep 23, 2021
by
narinder Rana
Browse files
update for testing
parent
2a75778b
Pipeline
#136984
failed with stage
in 42 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/drive/services/FileObserverService.java
View file @
0f69bbb2
...
...
@@ -63,23 +63,28 @@ public class FileObserverService extends Service {
if
(
event
==
FileObserver
.
CREATE
||
event
==
FileObserver
.
MODIFY
||
event
==
FileObserver
.
DELETE
||
event
==
FileObserver
.
MOVED_TO
){
Log
.
i
(
TAG
,
"...Event ..."
+
event
+
"...file ..."
+
file
);
if
(!
InitializerService
.
files
.
contains
(
file
))
{
Log
.
e
(
"TAG"
,
"file.isDirectory() ...."
+
file
+
"......"
+
file
.
isDirectory
(
))
;
InitializerService
.
files
.
add
(
file
);
}
if
(!
ConnectivityReceiver
.
isConnected
()){
InitializerService
.
fileObserverFlag
=
true
;
}
try
{
if
(
observerFlag
==
-
1
){
new
AsyncTaskRunner
().
execute
(
""
);
if
(!
file
.
isDirectory
()){
// if(!InitializerService.files.contains(file)){
InitializerService
.
files
.
add
(
file
);
// }
if
(!
ConnectivityReceiver
.
isConnected
()){
InitializerService
.
fileObserverFlag
=
true
;
}
try
{
if
(
observerFlag
==
-
1
){
new
AsyncTaskRunner
().
execute
(
""
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -127,6 +132,12 @@ public class FileObserverService extends Service {
protected
void
onPostExecute
(
String
s
)
{
super
.
onPostExecute
(
s
);
try
{
Log
.
e
(
"Tag"
,
"onPostExecute.........."
);
for
(
File
f:
InitializerService
.
files
){
Log
.
e
(
"TAG"
,
"...........file name in post execute.."
+
f
.
getAbsolutePath
());
}
Intent
observersServiceIntent
=
new
Intent
(
getApplicationContext
(),
foundation
.
e
.
drive
.
services
.
ObserverService
.
class
);
Bundle
mBundle
=
new
Bundle
();
mBundle
.
putBoolean
(
"isFileObserverService"
,
true
);
...
...
app/src/main/java/foundation/e/drive/services/InitializerService.java
View file @
0f69bbb2
...
...
@@ -301,8 +301,8 @@ public class InitializerService extends Service
.
apply
();
//all folder have been created
//
JobUtils.stopScheduledJob(appContext, JobUtils.InitializerJobId);
//
JobUtils.scheduleScannerJob(appContext);
JobUtils
.
stopScheduledJob
(
appContext
,
JobUtils
.
InitializerJobId
);
JobUtils
.
scheduleScannerJob
(
appContext
);
Log
.
d
(
TAG
,
"RegisterReceiver: screenOffReceiver"
);
IntentFilter
filter
=
new
IntentFilter
(
Intent
.
ACTION_SCREEN_ON
);
...
...
@@ -310,8 +310,8 @@ public class InitializerService extends Service
getApplicationContext
().
registerReceiver
(
ScreenOffReceiver
.
getInstance
(),
filter
);
//Immediatly start ObserverService to not have to wait 30 minutes.
//
Intent observersServiceIntent = new Intent(getApplicationContext(), foundation.e.drive.services.ObserverService.class);
//
startService(observersServiceIntent);
Intent
observersServiceIntent
=
new
Intent
(
getApplicationContext
(),
foundation
.
e
.
drive
.
services
.
ObserverService
.
class
);
startService
(
observersServiceIntent
);
//start FileObserverService
startService
(
new
Intent
(
this
,
FileObserverService
.
class
));
...
...
app/src/main/java/foundation/e/drive/services/ObserverService.java
View file @
0f69bbb2
...
...
@@ -254,6 +254,8 @@ public class ObserverService extends Service implements OnRemoteOperationListene
}
else
{
if
(
isFileObserverService
){
Log
.
e
(
"TAG"
,
"ObserverService..isFileObserverService...."
+
isFileObserverService
);
// List<File> files = fileObserverObject.getFiles();
DbHelper
.
updateSyncedFolders
(
mSyncedFolders
,
this
);
//@ToDo: maybe do this when all contents will be synced.
...
...
@@ -671,6 +673,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
Log
.
d
(
TAG
,
"Loop through local file list"
);
Log
.
v
(
TAG
,
"format: filePath, exist, lastModified) :"
);
Log
.
e
(
"TAG"
,
"ObserverService..handleLocalFiles...."
);
//Loop through local files
for
(
int
i
=-
1
,
localFilesSize
=
localFileList
.
size
();
++
i
<
localFilesSize
;){
...
...
app/src/main/java/foundation/e/drive/utils/JobUtils.java
View file @
0f69bbb2
...
...
@@ -24,7 +24,7 @@ import foundation.e.drive.jobs.ScannerJob;
public
abstract
class
JobUtils
{
final
private
static
String
TAG
=
JobUtils
.
class
.
getSimpleName
();
//Tag for log
public
final
static
int
ScannerJobId
=
3310
;
//
public final static int InitializerJobId = 3311;
public
final
static
int
InitializerJobId
=
3311
;
/**
* Start the scheduledJob for observing remote's folder
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment