Skip to content

Commit

Permalink
Merge pull request #133 from Logan676/camera
Browse files Browse the repository at this point in the history
stop camera upload service when params deleted
  • Loading branch information
lins05 committed Oct 24, 2014
2 parents 1b9a387 + 06dc98e commit 96e9a18
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/com/seafile/seadroid2/AccountsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.seafile.seadroid2.account.Account;
import com.seafile.seadroid2.account.AccountManager;
import com.seafile.seadroid2.monitor.FileMonitorService;
import com.seafile.seadroid2.sync.CameraUploadService;
import com.seafile.seadroid2.ui.SeafileStyleDialogBuilder;


Expand Down Expand Up @@ -228,6 +229,16 @@ public boolean onContextItemSelected(android.view.MenuItem item) {
case R.id.delete:
account = adapter.getItem((int)info.id);
accountManager.deleteAccount(account);
// stop camera upload service
if (SettingsManager.instance().getCameraUploadAccountEmail()
.equals(account.getEmail())
&& SettingsManager.instance()
.getCameraUploadAccountServer()
.equals(account.getServer())) {
Intent cameraUploadIntent = new Intent(this,
CameraUploadService.class);
stopService(cameraUploadIntent);
}
if (mMonitorService != null) {
mMonitorService.removeAccount(account);
}
Expand Down

0 comments on commit 96e9a18

Please sign in to comment.