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
ca9870ed
Commit
ca9870ed
authored
Dec 11, 2019
by
vince-bourgmayer
Browse files
fix generation of multiple file
parent
55960ca1
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/drive/services/InitializerService.java
View file @
ca9870ed
...
...
@@ -66,8 +66,11 @@ public class InitializerService extends Service implements OnRemoteOperationList
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
Log
.
i
(
TAG
,
"onStartCommand(...)"
);
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
if
(
Thread
.
getDefaultUncaughtExceptionHandler
().
getClass
().
getSimpleName
().
equals
(
ServiceExceptionHandler
.
class
.
getSimpleName
())){
Log
.
d
(
"ObserverService"
,
"ServiceExceptionHandler already set!"
);
}
else
{
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
}
//Get account
SharedPreferences
prefs
=
this
.
getSharedPreferences
(
AppConstants
.
SHARED_PREFERENCE_NAME
,
Context
.
MODE_PRIVATE
);
...
...
app/src/main/java/foundation/e/drive/services/ObserverService.java
View file @
ca9870ed
...
...
@@ -80,8 +80,11 @@ public class ObserverService extends Service implements OnRemoteOperationListene
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
Log
.
i
(
TAG
,
"onStartCommand("
+
startId
+
")"
);
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
if
(
Thread
.
getDefaultUncaughtExceptionHandler
().
getClass
().
getSimpleName
().
equals
(
ServiceExceptionHandler
.
class
.
getSimpleName
())){
Log
.
d
(
"ObserverService"
,
"ServiceExceptionHandler already set!"
);
}
else
{
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
}
SharedPreferences
prefs
=
this
.
getSharedPreferences
(
AppConstants
.
SHARED_PREFERENCE_NAME
,
Context
.
MODE_PRIVATE
);
String
accountName
=
prefs
.
getString
(
AccountManager
.
KEY_ACCOUNT_NAME
,
""
);
String
accountType
=
prefs
.
getString
(
AccountManager
.
KEY_ACCOUNT_TYPE
,
""
);
...
...
@@ -142,7 +145,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
}
/
*
Common methods
*/
/
/
Common methods
/**
* Start to bind this service to OperationManagerService or start scan if binding is already set.
* Method to factorise code that is called from different place
...
...
@@ -198,7 +201,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene
}
Log
.
d
(
TAG
,
logFolderList
.
toString
());
if
(
remote
)
{
OwnCloudClient
client
=
DavClientProvider
.
getInstance
().
getClientInstance
(
mAccount
,
getApplicationContext
());
if
(
client
!=
null
)
{
...
...
@@ -246,6 +248,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene
@Override
public
void
onRemoteOperationFinish
(
RemoteOperation
operation
,
RemoteOperationResult
result
)
{
Log
.
i
(
TAG
,
"onRemoteOperationFinish()"
);
if
(
operation
instanceof
ListFileRemoteOperation
){
if
(
result
.
isSuccess
()
){
List
<
Object
>
resultDatas
=
result
.
getData
();
...
...
app/src/main/java/foundation/e/drive/services/OperationManagerService.java
View file @
ca9870ed
...
...
@@ -13,13 +13,11 @@ import android.app.PendingIntent;
import
android.app.Service
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.IBinder
;
import
android.os.Message
;
import
android.os.Parcelable
;
import
android.preference.Preference
;
import
android.support.annotation.Nullable
;
import
android.util.Log
;
import
com.owncloud.android.lib.common.OwnCloudClient
;
...
...
@@ -27,7 +25,6 @@ import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import
com.owncloud.android.lib.common.operations.RemoteOperation
;
import
com.owncloud.android.lib.common.operations.RemoteOperationResult
;
import
org.apache.commons.httpclient.util.DateUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.Hashtable
;
...
...
@@ -61,16 +58,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
@Override
public
void
onDestroy
()
{
Log
.
i
(
TAG
,
"onDestroy()"
);
/*this.mOperationsQueue.clear();
for(int i =-1, size = mThreadPool.length;++i < size;){
try{
if(mThreadPool[i] != null)
mThreadPool[i].interrupt();}
catch(Exception e){
Log.e(TAG, e.toString());
}
}*/
super
.
onDestroy
();
}
...
...
@@ -240,8 +227,11 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
Log
.
i
(
TAG
,
"onStartCommand()"
);
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
if
(
Thread
.
getDefaultUncaughtExceptionHandler
().
getClass
().
getSimpleName
().
equals
(
ServiceExceptionHandler
.
class
.
getSimpleName
())){
Log
.
d
(
"ObserverService"
,
"ServiceExceptionHandler already set!"
);
}
else
{
Thread
.
setDefaultUncaughtExceptionHandler
(
new
ServiceExceptionHandler
(
this
));
}
Bundle
extras
=
intent
.
getExtras
();
Log
.
d
(
TAG
,
"OperationManagerService recieved "
+(
extras
==
null
?
"null extras"
:
extras
.
size
()+
" operations to perform"
)
);
...
...
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