Set package name on all sticky intents

This commit is contained in:
Mario Danic 2017-02-15 08:59:28 +01:00 committed by AndyScherzinger
parent c905d7b3bf
commit 7529084f82
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
5 changed files with 28 additions and 20 deletions

View file

@ -631,6 +631,7 @@ public class FileDownloader extends Service
if (unlinkedFromRemotePath != null) {
end.putExtra(EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath);
}
end.setPackage(getPackageName());
sendStickyBroadcast(end);
}
@ -648,6 +649,7 @@ public class FileDownloader extends Service
added.putExtra(EXTRA_REMOTE_PATH, download.getRemotePath());
added.putExtra(EXTRA_FILE_PATH, download.getSavePath());
added.putExtra(EXTRA_LINKED_TO_PATH, linkedToRemotePath);
added.setPackage(getPackageName());
sendStickyBroadcast(added);
}

View file

@ -1124,6 +1124,7 @@ public class FileUploader extends Service
private void sendBroadcastUploadsAdded() {
Intent start = new Intent(getUploadsAddedMessage());
// nothing else needed right now
start.setPackage(getPackageName());
sendStickyBroadcast(start);
}
@ -1144,6 +1145,7 @@ public class FileUploader extends Service
start.putExtra(EXTRA_OLD_FILE_PATH, upload.getOriginalStoragePath());
start.putExtra(ACCOUNT_NAME, upload.getAccount().name);
start.setPackage(getPackageName());
sendStickyBroadcast(start);
}
@ -1177,7 +1179,7 @@ public class FileUploader extends Service
if (unlinkedFromRemotePath != null) {
end.putExtra(EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath);
}
end.setPackage(getPackageName());
sendStickyBroadcast(end);
}

View file

@ -523,6 +523,7 @@ public class RefreshFolderOperation extends RemoteOperation {
intent.putExtra(FileSyncAdapter.EXTRA_FOLDER_PATH, dirRemotePath);
}
intent.putExtra(FileSyncAdapter.EXTRA_RESULT, result);
intent.setPackage(mContext.getPackageName());
mContext.sendStickyBroadcast(intent);
//LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
}

View file

@ -182,6 +182,7 @@ class SyncFolderHandler extends Handler {
added.putExtra(FileDownloader.EXTRA_REMOTE_PATH, remotePath);
added.putExtra(FileDownloader.EXTRA_FILE_PATH, FileStorageUtils.getSavePath(account.name)
+ remotePath);
added.setPackage(mService.getPackageName());
mService.sendStickyBroadcast(added);
}
@ -197,6 +198,7 @@ class SyncFolderHandler extends Handler {
finished.putExtra(FileDownloader.EXTRA_FILE_PATH,
FileStorageUtils.getSavePath(account.name) + remotePath);
finished.putExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, success);
finished.setPackage(mService.getPackageName());
mService.sendStickyBroadcast(finished);
}
}

View file

@ -22,25 +22,6 @@
package com.owncloud.android.syncadapter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.jackrabbit.webdav.DavException;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.operations.RefreshFolderOperation;
import com.owncloud.android.operations.UpdateOCVersionOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
import android.accounts.Account;
import android.accounts.AccountsException;
import android.app.NotificationManager;
@ -54,6 +35,25 @@ import android.content.SyncResult;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.RefreshFolderOperation;
import com.owncloud.android.operations.UpdateOCVersionOperation;
import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
import org.apache.jackrabbit.webdav.DavException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Implementation of {@link AbstractThreadedSyncAdapter} responsible for synchronizing
* ownCloud files.
@ -376,6 +376,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
if (result != null) {
intent.putExtra(FileSyncAdapter.EXTRA_RESULT, result);
}
intent.setPackage(getContext().getPackageName());
getContext().sendStickyBroadcast(intent);
//LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
}