1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 11:21:29 +00:00

Use proper namespace for intent actions and extras.

This commit is contained in:
Felix Ableitner 2016-04-03 20:45:22 +02:00
parent 67b97435e9
commit ac7d410db4
6 changed files with 26 additions and 15 deletions

View file

@ -40,11 +40,11 @@ import java.util.TreeSet;
public class FolderPickerActivity extends SyncthingActivity
implements AdapterView.OnItemClickListener, SyncthingService.OnApiChangeListener {
private static final String TAG = "FolderPickerActivity";
public static final String EXTRA_INITIAL_DIRECTORY =
"com.nutomic.syncthingandroid.activities.FolderPickerActivity.INITIAL_DIRECTORY";
public static final String EXTRA_INITIAL_DIRECTORY = "initial_directory";
public static final String EXTRA_RESULT_DIRECTORY = "result_directory";
public static final String EXTRA_RESULT_DIRECTORY =
"com.nutomic.syncthingandroid.activities.FolderPickerActivity.RESULT_DIRECTORY";
private ListView mListView;

View file

@ -14,16 +14,20 @@ import com.nutomic.syncthingandroid.fragments.SettingsFragment;
*/
public class SettingsActivity extends SyncthingActivity {
public static final String ACTION_APP_SETTINGS = "app_settings_fragment";
public static final String ACTION_DEVICE_SETTINGS = "device_settings_fragment";
public static final String ACTION_FOLDER_SETTINGS = "folder_settings_fragment";
public static final String ACTION_APP_SETTINGS =
"com.nutomic.syncthingandroid.activities.SettingsActivity.APP_SETTINGS";
public static final String ACTION_DEVICE_SETTINGS =
"com.nutomic.syncthingandroid.activities.SettingsActivity.DEVICE_SETTINGS";
public static final String ACTION_FOLDER_SETTINGS =
"com.nutomic.syncthingandroid.activities.SettingsActivity.FOLDER_SETTINGS";
/**
* Must be set for {@link #ACTION_DEVICE_SETTINGS} and
* {@link #ACTION_FOLDER_SETTINGS} to determine if an existing folder/device should be
* edited or a new one created.
*/
public static final String EXTRA_IS_CREATE = "create";
public static final String EXTRA_IS_CREATE =
"com.nutomic.syncthingandroid.activities.SettingsActivity.IS_CREATE";
private Fragment mFragment;

View file

@ -54,7 +54,8 @@ public class DeviceFragment extends Fragment implements
SyncthingService.OnApiChangeListener, RestApi.OnDeviceIdNormalizedListener,
View.OnClickListener {
public static final String EXTRA_DEVICE_ID = "device_id";
public static final String EXTRA_DEVICE_ID =
"com.nutomic.syncthingandroid.fragments.DeviceFragment.DEVICE_ID";
private static final String TAG = "DeviceSettingsFragment";

View file

@ -52,9 +52,11 @@ import static java.lang.String.valueOf;
public class FolderFragment extends Fragment
implements SyncthingActivity.OnServiceConnectedListener, SyncthingService.OnApiChangeListener {
public static final String EXTRA_FOLDER_ID = "folder_id";
public static final String EXTRA_FOLDER_ID =
"com.nutomic.syncthingandroid.fragments.FolderFragment.FOLDER_ID";
public static final String EXTRA_DEVICE_ID = "device_id";
public static final String EXTRA_DEVICE_ID =
"com.nutomic.syncthingandroid.fragments.FolderFragment.DEVICE_ID";
private static final int DIRECTORY_REQUEST_CODE = 234;

View file

@ -20,13 +20,15 @@ public class DeviceStateHolder extends BroadcastReceiver {
/**
* Intent extra containing a boolean saying whether wifi is connected or not.
*/
public static final String EXTRA_HAS_WIFI = "has_wifi";
public static final String EXTRA_HAS_WIFI =
"com.nutomic.syncthingandroid.syncthing.DeviceStateHolder.HAS_WIFI";
/**
* Intent extra containging a boolean saying whether the device is
* charging or not (any power source).
*/
public static final String EXTRA_IS_CHARGING = "is_charging";
public static final String EXTRA_IS_CHARGING =
"com.nutomic.syncthingandroid.syncthing.DeviceStateHolder.IS_CHARGING";
private Context mContext;

View file

@ -50,12 +50,14 @@ public class SyncthingService extends Service implements
/**
* Intent action to perform a Syncthing restart.
*/
public static final String ACTION_RESTART = "restart";
public static final String ACTION_RESTART =
"com.nutomic.syncthingandroid.service.SyncthingService.RESTART";
/**
* Intent action to reset Syncthing's database.
*/
public static final String ACTION_RESET = "reset";
public static final String ACTION_RESET =
"com.nutomic.syncthingandroid.service.SyncthingService.RESET";
/**