projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f88f81e
)
Fixed bug in access to SYNC_MESSAGE identifier for building broadcast intents in...
author
David A. Velasco
<dvelasco@solidgear.es>
Wed, 23 Oct 2013 16:44:20 +0000
(18:44 +0200)
committer
David A. Velasco
<dvelasco@solidgear.es>
Wed, 23 Oct 2013 16:50:30 +0000
(18:50 +0200)
src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileDownloader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileObserverService.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileUploader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/syncadapter/FileSyncService.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
b/src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
index
2f75376
..
0e6ad9e
100644
(file)
--- a/
src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
+++ b/
src/com/owncloud/android/files/InstantUploadBroadcastReceiver.java
@@
-52,9
+52,6
@@
public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log_OC.d(TAG, "Received: " + intent.getAction());
@Override
public void onReceive(Context context, Intent intent) {
Log_OC.d(TAG, "Received: " + intent.getAction());
-
- FileUploader fileUploader = new FileUploader();
-
if (intent.getAction().equals(android.net.ConnectivityManager.CONNECTIVITY_ACTION)) {
handleConnectivityAction(context, intent);
}else if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) {
if (intent.getAction().equals(android.net.ConnectivityManager.CONNECTIVITY_ACTION)) {
handleConnectivityAction(context, intent);
}else if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) {
@@
-63,7
+60,7
@@
public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
} else if (intent.getAction().equals(NEW_PHOTO_ACTION)) {
handleNewPhotoAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_PICTURE");
} else if (intent.getAction().equals(NEW_PHOTO_ACTION)) {
handleNewPhotoAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_PICTURE");
- } else if (intent.getAction().equals(
f
ileUploader.getUploadFinishMessage())) {
+ } else if (intent.getAction().equals(
F
ileUploader.getUploadFinishMessage())) {
handleUploadFinished(context, intent);
} else {
Log_OC.e(TAG, "Incorrect intent sent: " + intent.getAction());
handleUploadFinished(context, intent);
} else {
Log_OC.e(TAG, "Incorrect intent sent: " + intent.getAction());
diff --git
a/src/com/owncloud/android/files/services/FileDownloader.java
b/src/com/owncloud/android/files/services/FileDownloader.java
index
07c4257
..
f71ce33
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileDownloader.java
+++ b/
src/com/owncloud/android/files/services/FileDownloader.java
@@
-92,12
+92,12
@@
public class FileDownloader extends Service implements OnDatatransferProgressLis
private int mLastPercent;
private int mLastPercent;
- public String getDownloadAddedMessage() {
- return
getClass()
.getName().toString() + DOWNLOAD_ADDED_MESSAGE;
+ public
static
String getDownloadAddedMessage() {
+ return
FileDownloader.class
.getName().toString() + DOWNLOAD_ADDED_MESSAGE;
}
}
- public String getDownloadFinishMessage() {
- return
getClass()
.getName().toString() + DOWNLOAD_FINISH_MESSAGE;
+ public
static
String getDownloadFinishMessage() {
+ return
FileDownloader.class
.getName().toString() + DOWNLOAD_FINISH_MESSAGE;
}
/**
}
/**
diff --git
a/src/com/owncloud/android/files/services/FileObserverService.java
b/src/com/owncloud/android/files/services/FileObserverService.java
index
8a63a6e
..
8a6fd5a
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileObserverService.java
+++ b/
src/com/owncloud/android/files/services/FileObserverService.java
@@
-57,9
+57,6
@@
public class FileObserverService extends Service {
private static DownloadCompletedReceiverBis mDownloadReceiver;
private IBinder mBinder = new LocalBinder();
private static DownloadCompletedReceiverBis mDownloadReceiver;
private IBinder mBinder = new LocalBinder();
- private String mDownloadAddedMessage;
- private String mDownloadFinishMessage;
-
public class LocalBinder extends Binder {
FileObserverService getService() {
return FileObserverService.this;
public class LocalBinder extends Binder {
FileObserverService getService() {
return FileObserverService.this;
@@
-71,13
+68,9
@@
public class FileObserverService extends Service {
super.onCreate();
mDownloadReceiver = new DownloadCompletedReceiverBis();
super.onCreate();
mDownloadReceiver = new DownloadCompletedReceiverBis();
- FileDownloader downloader = new FileDownloader();
- mDownloadAddedMessage = downloader.getDownloadAddedMessage();
- mDownloadFinishMessage= downloader.getDownloadFinishMessage();
-
IntentFilter filter = new IntentFilter();
IntentFilter filter = new IntentFilter();
- filter.addAction(
mDownloadAddedMessage
);
- filter.addAction(
mDownloadFinishMessage
);
+ filter.addAction(
FileDownloader.getDownloadAddedMessage()
);
+ filter.addAction(
FileDownloader.getDownloadFinishMessage()
);
registerReceiver(mDownloadReceiver, filter);
mObserversMap = new HashMap<String, OwnCloudFileObserver>();
registerReceiver(mDownloadReceiver, filter);
mObserversMap = new HashMap<String, OwnCloudFileObserver>();
@@
-267,12
+260,12
@@
public class FileObserverService extends Service {
String downloadPath = intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH);
OwnCloudFileObserver observer = mObserversMap.get(downloadPath);
if (observer != null) {
String downloadPath = intent.getStringExtra(FileDownloader.EXTRA_FILE_PATH);
OwnCloudFileObserver observer = mObserversMap.get(downloadPath);
if (observer != null) {
- if (intent.getAction().equals(
mDownloadFinishMessage
) &&
+ if (intent.getAction().equals(
FileDownloader.getDownloadFinishMessage()
) &&
new File(downloadPath).exists()) { // the download could be successful. not; in both cases, the file could be down, due to a former download or upload
observer.startWatching();
Log_OC.d(TAG, "Watching again " + downloadPath);
new File(downloadPath).exists()) { // the download could be successful. not; in both cases, the file could be down, due to a former download or upload
observer.startWatching();
Log_OC.d(TAG, "Watching again " + downloadPath);
- } else if (intent.getAction().equals(
mDownloadAddedMessage
)) {
+ } else if (intent.getAction().equals(
FileDownloader.getDownloadAddedMessage()
)) {
observer.stopWatching();
Log_OC.d(TAG, "Disabling observance of " + downloadPath);
}
observer.stopWatching();
Log_OC.d(TAG, "Disabling observance of " + downloadPath);
}
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
e738a27
..
997a9a4
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-129,8
+129,8
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
private RemoteViews mDefaultNotificationContentView;
private RemoteViews mDefaultNotificationContentView;
- public String getUploadFinishMessage() {
- return
getClass()
.getName().toString() + UPLOAD_FINISH_MESSAGE;
+ public
static
String getUploadFinishMessage() {
+ return
FileUploader.class
.getName().toString() + UPLOAD_FINISH_MESSAGE;
}
/**
}
/**
diff --git
a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java
index
3295668
..
c7791cc
100644
(file)
--- a/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
+++ b/
src/com/owncloud/android/operations/SynchronizeFolderOperation.java
@@
-360,5
+360,4
@@
public class SynchronizeFolderOperation extends RemoteOperation {
}
}
}
}
-
}
}
diff --git
a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java
b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java
index
0d4e4c5
..
33e8dc3
100644
(file)
--- a/
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
+++ b/
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
@@
-287,9
+287,7
@@
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
* @param dirRemotePath Remote path of a folder that was just synchronized (with or without success)
*/
private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) {
* @param dirRemotePath Remote path of a folder that was just synchronized (with or without success)
*/
private void sendStickyBroadcast(boolean inProgress, String dirRemotePath, RemoteOperationResult result) {
- FileSyncService fileSyncService = new FileSyncService();
-
- Intent i = new Intent(fileSyncService.getSyncMessage());
+ Intent i = new Intent(FileSyncService.getSyncMessage());
i.putExtra(FileSyncService.IN_PROGRESS, inProgress);
i.putExtra(FileSyncService.ACCOUNT_NAME, getAccount().name);
if (dirRemotePath != null) {
i.putExtra(FileSyncService.IN_PROGRESS, inProgress);
i.putExtra(FileSyncService.ACCOUNT_NAME, getAccount().name);
if (dirRemotePath != null) {
diff --git
a/src/com/owncloud/android/syncadapter/FileSyncService.java
b/src/com/owncloud/android/syncadapter/FileSyncService.java
index
d347265
..
7d4dda6
100644
(file)
--- a/
src/com/owncloud/android/syncadapter/FileSyncService.java
+++ b/
src/com/owncloud/android/syncadapter/FileSyncService.java
@@
-28,14
+28,15
@@
import android.os.IBinder;
*
\r
*/
\r
public class FileSyncService extends Service {
\r
*
\r
*/
\r
public class FileSyncService extends Service {
\r
- public static final String SYNC_MESSAGE = "ACCOUNT_SYNC";
\r
+
\r
+ private static final String SYNC_MESSAGE = "ACCOUNT_SYNC";
\r
public static final String SYNC_FOLDER_REMOTE_PATH = "SYNC_FOLDER_REMOTE_PATH";
\r
public static final String IN_PROGRESS = "SYNC_IN_PROGRESS";
\r
public static final String ACCOUNT_NAME = "ACCOUNT_NAME";
\r
public static final String SYNC_RESULT = "SYNC_RESULT";
\r
\r
public static final String SYNC_FOLDER_REMOTE_PATH = "SYNC_FOLDER_REMOTE_PATH";
\r
public static final String IN_PROGRESS = "SYNC_IN_PROGRESS";
\r
public static final String ACCOUNT_NAME = "ACCOUNT_NAME";
\r
public static final String SYNC_RESULT = "SYNC_RESULT";
\r
\r
- public String getSyncMessage(){
\r
- return
getClass()
.getName().toString() + SYNC_MESSAGE;
\r
+ public
static
String getSyncMessage(){
\r
+ return
FileSyncService.class
.getName().toString() + SYNC_MESSAGE;
\r
}
\r
/*
\r
* {@inheritDoc}
\r
}
\r
/*
\r
* {@inheritDoc}
\r
diff --git
a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java
index
7721133
..
33cdadf
100644
(file)
--- a/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
+++ b/
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
@@
-139,9
+139,6
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
private OCFile mWaitingToPreview;
private Handler mHandler;
private OCFile mWaitingToPreview;
private Handler mHandler;
- private String mDownloadAddedMessage;
- private String mDownloadFinishMessage;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
Log_OC.d(TAG, "onCreate() start");
@Override
protected void onCreate(Bundle savedInstanceState) {
Log_OC.d(TAG, "onCreate() start");
@@
-151,10
+148,6
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
mHandler = new Handler();
mHandler = new Handler();
- FileDownloader downloader = new FileDownloader();
- mDownloadAddedMessage = downloader.getDownloadAddedMessage();
- mDownloadFinishMessage= downloader.getDownloadFinishMessage();
-
/// bindings to transference services
mUploadConnection = new ListServiceConnection();
mDownloadConnection = new ListServiceConnection();
/// bindings to transference services
mUploadConnection = new ListServiceConnection();
mDownloadConnection = new ListServiceConnection();
@@
-412,12
+405,12
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
// the user browsed to other file ; forget the automatic preview
mWaitingToPreview = null;
// the user browsed to other file ; forget the automatic preview
mWaitingToPreview = null;
- } else if (downloadEvent.equals(
mDownloadAddedMessage
)) {
+ } else if (downloadEvent.equals(
FileDownloader.getDownloadAddedMessage()
)) {
// grant that the right panel updates the progress bar
detailsFragment.listenForTransferProgress();
detailsFragment.updateFileDetails(true, false);
// grant that the right panel updates the progress bar
detailsFragment.listenForTransferProgress();
detailsFragment.updateFileDetails(true, false);
- } else if (downloadEvent.equals(
mDownloadFinishMessage
)) {
+ } else if (downloadEvent.equals(
FileDownloader.getDownloadFinishMessage()
)) {
// update the right panel
boolean detailsFragmentChanged = false;
if (waitedPreview) {
// update the right panel
boolean detailsFragmentChanged = false;
if (waitedPreview) {
@@
-635,22
+628,19
@@
OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
super.onResume();
Log_OC.e(TAG, "onResume() start");
super.onResume();
Log_OC.e(TAG, "onResume() start");
- FileUploader fileUploader = new FileUploader();
- FileSyncService fileSyncService = new FileSyncService();
-
// Listen for sync messages
// Listen for sync messages
- IntentFilter syncIntentFilter = new IntentFilter(
f
ileSyncService.getSyncMessage());
+ IntentFilter syncIntentFilter = new IntentFilter(
F
ileSyncService.getSyncMessage());
mSyncBroadcastReceiver = new SyncBroadcastReceiver();
registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
// Listen for upload messages
mSyncBroadcastReceiver = new SyncBroadcastReceiver();
registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
// Listen for upload messages
- IntentFilter uploadIntentFilter = new IntentFilter(
f
ileUploader.getUploadFinishMessage());
+ IntentFilter uploadIntentFilter = new IntentFilter(
F
ileUploader.getUploadFinishMessage());
mUploadFinishReceiver = new UploadFinishReceiver();
registerReceiver(mUploadFinishReceiver, uploadIntentFilter);
// Listen for download messages
mUploadFinishReceiver = new UploadFinishReceiver();
registerReceiver(mUploadFinishReceiver, uploadIntentFilter);
// Listen for download messages
- IntentFilter downloadIntentFilter = new IntentFilter(
mDownloadAddedMessage
);
- downloadIntentFilter.addAction(
mDownloadFinishMessage
);
+ IntentFilter downloadIntentFilter = new IntentFilter(
FileDownloader.getDownloadAddedMessage()
);
+ downloadIntentFilter.addAction(
FileDownloader.getDownloadFinishMessage()
);
mDownloadFinishReceiver = new DownloadFinishReceiver();
registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
mDownloadFinishReceiver = new DownloadFinishReceiver();
registerReceiver(mDownloadFinishReceiver, downloadIntentFilter);
diff --git
a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java
b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java
index
944decf
..
ffe464a
100644
(file)
--- a/
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
+++ b/
src/com/owncloud/android/ui/fragment/FileDetailFragment.java
@@
-207,8
+207,7
@@
public class FileDetailFragment extends FileFragment implements
public void onResume() {
super.onResume();
mUploadFinishReceiver = new UploadFinishReceiver();
public void onResume() {
super.onResume();
mUploadFinishReceiver = new UploadFinishReceiver();
- FileUploader fileUploader = new FileUploader();
- IntentFilter filter = new IntentFilter(fileUploader.getUploadFinishMessage());
+ IntentFilter filter = new IntentFilter(FileUploader.getUploadFinishMessage());
getActivity().registerReceiver(mUploadFinishReceiver, filter);
}
getActivity().registerReceiver(mUploadFinishReceiver, filter);
}
diff --git
a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java
b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java
index
6a80ffb
..
5ab92e4
100644
(file)
--- a/
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
+++ b/
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
@@
-82,9
+82,6
@@
public class PreviewImageActivity extends FileActivity implements FileFragment.C
private boolean mFullScreen;
private boolean mFullScreen;
- private String mDownloadAddedMessage;
- private String mDownloadFinishMessage;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
@Override
protected void onCreate(Bundle savedInstanceState) {
@@
-104,9
+101,6
@@
public class PreviewImageActivity extends FileActivity implements FileFragment.C
mRequestWaitingForBinder = false;
}
mRequestWaitingForBinder = false;
}
- FileDownloader downloader = new FileDownloader();
- mDownloadAddedMessage = downloader.getDownloadAddedMessage();
- mDownloadFinishMessage= downloader.getDownloadFinishMessage();
}
private void initViewPager() {
}
private void initViewPager() {
@@
-227,8
+221,8
@@
public class PreviewImageActivity extends FileActivity implements FileFragment.C
//Log.e(TAG, "ACTIVITY, ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
//Log.e(TAG, "ACTIVITY, ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
- IntentFilter filter = new IntentFilter(
mDownloadFinishMessage
);
- filter.addAction(
mDownloadAddedMessage
);
+ IntentFilter filter = new IntentFilter(
FileDownloader.getDownloadFinishMessage()
);
+ filter.addAction(
FileDownloader.getDownloadAddedMessage()
);
registerReceiver(mDownloadFinishReceiver, filter);
}
registerReceiver(mDownloadFinishReceiver, filter);
}
@@
-387,7
+381,7
@@
public class PreviewImageActivity extends FileActivity implements FileFragment.C
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
//boolean isOffscreen = Math.abs((mViewPager.getCurrentItem() - position)) <= mViewPager.getOffscreenPageLimit();
- if (position >= 0 && intent.getAction().equals(
mDownloadFinishMessage
)) {
+ if (position >= 0 && intent.getAction().equals(
FileDownloader.getDownloadFinishMessage()
)) {
if (downloadWasFine) {
mPreviewImagePagerAdapter.updateFile(position, file);
if (downloadWasFine) {
mPreviewImagePagerAdapter.updateFile(position, file);