|
@@ -1147,6 +1147,17 @@ public class FileDisplayActivity extends FileActivity
|
|
|
// Instead of onPostCreate, starting the loading in onResume for children fragments
|
|
|
Fragment leftFragment = getLeftFragment();
|
|
|
|
|
|
+ // Listen for sync messages
|
|
|
+ if (!(leftFragment instanceof OCFileListFragment) || !((OCFileListFragment) leftFragment).isSearchFragment()) {
|
|
|
+ IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START);
|
|
|
+ syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END);
|
|
|
+ syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED);
|
|
|
+ syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
|
|
|
+ syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
|
|
|
+ mSyncBroadcastReceiver = new SyncBroadcastReceiver();
|
|
|
+ localBroadcastManager.registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
|
|
|
+ }
|
|
|
+
|
|
|
if (!(leftFragment instanceof OCFileListFragment)) {
|
|
|
return;
|
|
|
}
|
|
@@ -1173,17 +1184,6 @@ public class FileDisplayActivity extends FileActivity
|
|
|
updateActionBarTitleAndHomeButton(startFile);
|
|
|
}
|
|
|
|
|
|
- // Listen for sync messages
|
|
|
- if (!ocFileListFragment.isSearchFragment()) {
|
|
|
- IntentFilter syncIntentFilter = new IntentFilter(FileSyncAdapter.EVENT_FULL_SYNC_START);
|
|
|
- syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_END);
|
|
|
- syncIntentFilter.addAction(FileSyncAdapter.EVENT_FULL_SYNC_FOLDER_CONTENTS_SYNCED);
|
|
|
- syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
|
|
|
- syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
|
|
|
- mSyncBroadcastReceiver = new SyncBroadcastReceiver();
|
|
|
- localBroadcastManager.registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
|
|
|
- }
|
|
|
-
|
|
|
// Listen for upload messages
|
|
|
IntentFilter uploadIntentFilter = new IntentFilter(FileUploader.getUploadFinishMessage());
|
|
|
mUploadFinishReceiver = new UploadFinishReceiver();
|