mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Fixed release of connection between FileActivity and OperationService
This commit is contained in:
parent
04f5cf170f
commit
cae7744ae1
3 changed files with 9 additions and 10 deletions
|
@ -92,12 +92,10 @@ public class CreateShareOperation extends SyncOperation {
|
||||||
OCShare share = (OCShare) result.getData().get(0);
|
OCShare share = (OCShare) result.getData().get(0);
|
||||||
|
|
||||||
// Update DB with the response
|
// Update DB with the response
|
||||||
|
share.setPath(mPath);
|
||||||
if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
|
if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
|
||||||
share.setPath(mPath.substring(0, mPath.length()-1));
|
|
||||||
share.setIsFolder(true);
|
share.setIsFolder(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
share.setPath(mPath);
|
|
||||||
share.setIsFolder(false);
|
share.setIsFolder(false);
|
||||||
}
|
}
|
||||||
share.setPermissions(mPermissions);
|
share.setPermissions(mPermissions);
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class OperationsService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));
|
mPendingOperations.add(new Pair<Target , RemoteOperation>(target, operation));
|
||||||
sendBroadcastNewOperation(target, operation);
|
//sendBroadcastNewOperation(target, operation);
|
||||||
|
|
||||||
Message msg = mServiceHandler.obtainMessage();
|
Message msg = mServiceHandler.obtainMessage();
|
||||||
msg.arg1 = startId;
|
msg.arg1 = startId;
|
||||||
|
@ -324,7 +324,7 @@ public class OperationsService extends Service {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
|
//sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result);
|
||||||
callbackOperationListeners(mLastTarget, mCurrentOperation, result);
|
callbackOperationListeners(mLastTarget, mCurrentOperation, result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,18 +160,19 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
if (mOperationsServiceBinder != null) {
|
|
||||||
mOperationsServiceBinder.removeOperationListener(this);
|
|
||||||
mOperationsServiceBinder = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (mOperationsServiceConnection != null)
|
if (mOperationsServiceConnection != null) {
|
||||||
|
if (mOperationsServiceBinder != null) {
|
||||||
|
mOperationsServiceBinder.removeOperationListener(this);
|
||||||
|
mOperationsServiceBinder = null;
|
||||||
|
}
|
||||||
unbindService(mOperationsServiceConnection);
|
unbindService(mOperationsServiceConnection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue