diff options
author | Alex Deymo <deymo@chromium.org> | 2015-08-26 19:38:43 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-08-27 21:27:43 -0700 |
commit | 9bbde1b1afee1529c6ed7b6569630b591c60ddb4 (patch) | |
tree | 8a1437afe3720f1f6405d2527748b77bf19e50c4 /dbus/cros-disks | |
parent | 383376f7a551a823d4300188c5d41f19dc16dc00 (diff) | |
download | system_api-9bbde1b1afee1529c6ed7b6569630b591c60ddb4.tar.gz |
Split DBus constants per daemon.
The service_constants.h file defines the DBus method names, property
names, signal names, property values and other DBus string constants
that define the API from Chromium to the Chromium OS system. It was
also the main way daemons in Chromium OS could talk to other daemons,
by sending DBus method calls using the method and interface names
defined here.
We are moving towards generated proxies for DBus communication packaged
in client libraries. Each daemon should expose a client library use to
talk to that daemon. The code generated from the .xml description
covers the interface names, methods names and property names, but
doesn't include property values and other required constants involved
in the interface but not expressed in the .xml file.
This patch splits the DBus constants used by Chromium and other daemons
in one file per daemon, that will eventually be part of the client
library presented by that daemon.
CQ-DEPEND=CL:295757
BUG=b:23560718
TEST=emerge-link system_api update_engine
Change-Id: I726633454ef248d280e0a21c534da6c42b1d53ab
Reviewed-on: https://chromium-review.googlesource.com/295756
Commit-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Diffstat (limited to 'dbus/cros-disks')
-rw-r--r-- | dbus/cros-disks/dbus-constants.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/dbus/cros-disks/dbus-constants.h b/dbus/cros-disks/dbus-constants.h new file mode 100644 index 0000000..c58af38 --- /dev/null +++ b/dbus/cros-disks/dbus-constants.h @@ -0,0 +1,119 @@ +// Copyright 2015 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_ +#define SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_ + +namespace cros_disks { +const char kCrosDisksInterface[] = "org.chromium.CrosDisks"; +const char kCrosDisksServicePath[] = "/org/chromium/CrosDisks"; +const char kCrosDisksServiceName[] = "org.chromium.CrosDisks"; +const char kCrosDisksServiceError[] = "org.chromium.CrosDisks.Error"; + +// Methods. +const char kEnumerateAutoMountableDevices[] = "EnumerateAutoMountableDevices"; +const char kEnumerateMountEntries[] = "EnumerateMountEntries"; +const char kFormat[] = "Format"; +const char kGetDeviceProperties[] = "GetDeviceProperties"; +const char kMount[] = "Mount"; +const char kUnmount[] = "Unmount"; + +// Signals. +const char kDeviceAdded[] = "DeviceAdded"; +const char kDeviceScanned[] = "DeviceScanned"; +const char kDeviceRemoved[] = "DeviceRemoved"; +const char kDiskAdded[] = "DiskAdded"; +const char kDiskChanged[] = "DiskChanged"; +const char kDiskRemoved[] = "DiskRemoved"; +const char kFormatCompleted[] = "FormatCompleted"; +const char kMountCompleted[] = "MountCompleted"; + +// Properties. +// TODO(benchan): Rename 'DeviceIs*' property to 'DiskIs*' as the latter is more +// accurate. +const char kDeviceFile[] = "DeviceFile"; +const char kDeviceIsDrive[] = "DeviceIsDrive"; +const char kDeviceIsMediaAvailable[] = "DeviceIsMediaAvailable"; +const char kDeviceIsMounted[] = "DeviceIsMounted"; +const char kDeviceIsOnBootDevice[] = "DeviceIsOnBootDevice"; +const char kDeviceIsOnRemovableDevice[] = "DeviceIsOnRemovableDevice"; +const char kDeviceIsReadOnly[] = "DeviceIsReadOnly"; +const char kDeviceIsVirtual[] = "DeviceIsVirtual"; +const char kDeviceMediaType[] = "DeviceMediaType"; +const char kDeviceMountPaths[] = "DeviceMountPaths"; +const char kDevicePresentationHide[] = "DevicePresentationHide"; +const char kDeviceSize[] = "DeviceSize"; +const char kDriveIsRotational[] = "DriveIsRotational"; +const char kDriveModel[] = "DriveModel"; +const char kExperimentalFeaturesEnabled[] = "ExperimentalFeaturesEnabled"; +const char kIdLabel[] = "IdLabel"; +const char kIdUuid[] = "IdUuid"; +const char kVendorId[] = "VendorId"; +const char kVendorName[] = "VendorName"; +const char kProductId[] = "ProductId"; +const char kProductName[] = "ProductName"; +const char kNativePath[] = "NativePath"; + +// Enum values. +// DeviceMediaType enum values are reported through UMA. +// All values but DEVICE_MEDIA_NUM_VALUES should not be changed or removed. +// Additional values can be added but DEVICE_MEDIA_NUM_VALUES should always +// be the last value in the enum. +enum DeviceMediaType { + DEVICE_MEDIA_UNKNOWN = 0, + DEVICE_MEDIA_USB = 1, + DEVICE_MEDIA_SD = 2, + DEVICE_MEDIA_OPTICAL_DISC = 3, + DEVICE_MEDIA_MOBILE = 4, + DEVICE_MEDIA_DVD = 5, + DEVICE_MEDIA_NUM_VALUES, +}; + +enum FormatErrorType { + FORMAT_ERROR_NONE = 0, + FORMAT_ERROR_UNKNOWN = 1, + FORMAT_ERROR_INTERNAL = 2, + FORMAT_ERROR_INVALID_DEVICE_PATH = 3, + FORMAT_ERROR_DEVICE_BEING_FORMATTED = 4, + FORMAT_ERROR_UNSUPPORTED_FILESYSTEM = 5, + FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND = 6, + FORMAT_ERROR_FORMAT_PROGRAM_FAILED = 7, + FORMAT_ERROR_DEVICE_NOT_ALLOWED = 8, +}; + +// TODO(benchan): After both Chrome and cros-disks use these enum values, +// make these error values contiguous so that they can be directly reported +// via UMA. +enum MountErrorType { + MOUNT_ERROR_NONE = 0, + MOUNT_ERROR_UNKNOWN = 1, + MOUNT_ERROR_INTERNAL = 2, + MOUNT_ERROR_INVALID_ARGUMENT = 3, + MOUNT_ERROR_INVALID_PATH = 4, + MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5, + MOUNT_ERROR_PATH_NOT_MOUNTED = 6, + MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7, + MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8, + MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9, + MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10, + MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11, + MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12, + MOUNT_ERROR_INVALID_DEVICE_PATH = 100, + MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101, + MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102, + MOUNT_ERROR_INVALID_ARCHIVE = 201, + MOUNT_ERROR_UNSUPPORTED_ARCHIVE = 202, +}; + +// MountSourceType enum values are solely used by Chrome/CrosDisks in +// the MountCompleted signal, and currently not reported through UMA. +enum MountSourceType { + MOUNT_SOURCE_INVALID = 0, + MOUNT_SOURCE_REMOVABLE_DEVICE = 1, + MOUNT_SOURCE_ARCHIVE = 2, + MOUNT_SOURCE_NETWORK_STORAGE = 3, +}; +} // namespace cros_disks + +#endif // SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_ |