use of com.nutomic.syncthingandroid.service.SyncthingService in project syncthing-android by syncthing.
the class MainActivity method onDestroy.
@Override
public void onDestroy() {
super.onDestroy();
SyncthingService mSyncthingService = getService();
if (mSyncthingService != null) {
mSyncthingService.unregisterOnServiceStateChangeListener(this);
mSyncthingService.unregisterOnServiceStateChangeListener(mFolderListFragment);
mSyncthingService.unregisterOnServiceStateChangeListener(mDeviceListFragment);
}
}
use of com.nutomic.syncthingandroid.service.SyncthingService in project syncthing-android by syncthing.
the class FolderActivity method onServiceConnected.
/**
* Save current settings in case we are in create mode and they aren't yet stored in the config.
*/
@Override
public void onServiceConnected() {
Log.v(TAG, "onServiceConnected");
SyncthingService syncthingService = (SyncthingService) getService();
syncthingService.getNotificationHandler().cancelConsentNotification(getIntent().getIntExtra(EXTRA_NOTIFICATION_ID, 0));
syncthingService.registerOnServiceStateChangeListener(this);
}
use of com.nutomic.syncthingandroid.service.SyncthingService in project syncthing-android by syncthing.
the class MainActivity method onResume.
@Override
public void onResume() {
// Check if storage permission has been revoked at runtime.
if (!PermissionUtil.haveStoragePermission(this)) {
startActivity(new Intent(this, FirstStartActivity.class));
this.finish();
}
// Evaluate run conditions to detect changes made to the metered wifi flags.
SyncthingService mSyncthingService = getService();
if (mSyncthingService != null) {
mSyncthingService.evaluateRunConditions();
}
super.onResume();
}
use of com.nutomic.syncthingandroid.service.SyncthingService in project syncthing-android by syncthing.
the class MainActivity method onServiceConnected.
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
super.onServiceConnected(componentName, iBinder);
SyncthingServiceBinder syncthingServiceBinder = (SyncthingServiceBinder) iBinder;
SyncthingService syncthingService = syncthingServiceBinder.getService();
syncthingService.registerOnServiceStateChangeListener(this);
syncthingService.registerOnServiceStateChangeListener(mFolderListFragment);
syncthingService.registerOnServiceStateChangeListener(mDeviceListFragment);
}
use of com.nutomic.syncthingandroid.service.SyncthingService in project syncthing-android by syncthing.
the class DeviceActivity method onDestroy.
@Override
public void onDestroy() {
super.onDestroy();
SyncthingService syncthingService = getService();
if (syncthingService != null) {
syncthingService.getNotificationHandler().cancelConsentNotification(getIntent().getIntExtra(EXTRA_NOTIFICATION_ID, 0));
syncthingService.unregisterOnServiceStateChangeListener(this::onServiceStateChange);
}
mIdView.removeTextChangedListener(mIdTextWatcher);
mNameView.removeTextChangedListener(mNameTextWatcher);
mAddressesView.removeTextChangedListener(mAddressesTextWatcher);
}
Aggregations