51 #include <nsIPropertyBag.h>
52 #include <nsIPropertyBag2.h>
53 #include <nsIWritablePropertyBag.h>
80 NS_ENSURE_SUCCESS(rv, rv);
84 NS_ENSURE_SUCCESS(rv, rv);
86 NS_ENSURE_SUCCESS(rv, rv);
106 nsIPropertyBag* aProperties) :
114 LOG(
"Enter: sbIPDSysDevice::sbIPDSysDevice\n");
117 NS_ASSERTION(aProperties,
"aProperties is null");
128 LOG(
"Enter: sbIPDSysDevice::~sbIPDSysDevice\n");
146 NS_ENSURE_TRUE(mSBLibHalCtx, NS_ERROR_OUT_OF_MEMORY);
148 NS_ENSURE_SUCCESS(rv, rv);
151 nsCOMPtr<nsIPropertyBag2>
properties = do_QueryInterface(mProperties, &rv);
152 NS_ENSURE_SUCCESS(rv, rv);
153 nsCOMPtr<nsIWritablePropertyBag> writeProperties =
154 do_QueryInterface(mProperties, &rv);
155 NS_ENSURE_SUCCESS(rv, rv);
158 rv = properties->GetPropertyAsACString(NS_LITERAL_STRING(
"DeviceUDI"),
160 NS_ENSURE_SUCCESS(rv, rv);
161 rv = properties->GetPropertyAsACString(NS_LITERAL_STRING(
"MediaPartitionUDI"),
163 NS_ENSURE_SUCCESS(rv, rv);
166 nsAutoString mountPath;
167 rv = GetMountPath(mountPath);
168 NS_ENSURE_SUCCESS(rv, rv);
169 rv = writeProperties->SetProperty(NS_LITERAL_STRING(
"MountPath"),
171 NS_ENSURE_SUCCESS(rv, rv);
174 rv = writeProperties->SetProperty
177 NS_ENSURE_SUCCESS(rv, rv);
180 NS_ENSURE_SUCCESS(rv, rv);
183 nsAutoString firewireGUID;
184 rv = GetFirewireGUID(firewireGUID);
185 NS_ENSURE_SUCCESS(rv, rv);
186 rv = writeProperties->SetProperty(NS_LITERAL_STRING(
"FirewireGUID"),
188 NS_ENSURE_SUCCESS(rv, rv);
192 rv = writeProperties->SetProperty
195 NS_ENSURE_SUCCESS(rv, rv);
199 nsCAutoString fstype;
203 NS_ENSURE_SUCCESS(rv, rv);
206 "volume.is_mounted_read_only",
208 NS_ENSURE_SUCCESS(rv, rv);
209 if (fstype.EqualsLiteral(
"hfsplus") && readonly) {
210 rv = writeProperties->SetProperty(NS_LITERAL_STRING(
"HFSPlusReadOnly"),
216 NS_ENSURE_SUCCESS(rv, rv);
235 mSBLibHalCtx = nsnull;
252 sbIPDSysDevice::GetMountPath(nsAString& aMountPath)
257 nsCAutoString mountPoint;
259 "volume.mount_point",
261 NS_ENSURE_SUCCESS(rv, rv);
264 aMountPath.Assign(NS_ConvertUTF8toUTF16(mountPoint));
277 sbIPDSysDevice::GetFirewireGUID(nsAString& aFirewireGUID)
282 nsCAutoString storageSerial;
286 NS_ENSURE_SUCCESS(rv, rv);
289 nsCString firewireGUID;
291 (
i < storageSerial.Length()) && (firewireGUID.Length() < 16);
293 char guidChar = storageSerial.CharAt(
i);
294 if (isxdigit(guidChar))
295 firewireGUID += guidChar;
297 firewireGUID.Truncate();
299 NS_ENSURE_TRUE(firewireGUID.Length() == 16, NS_ERROR_FAILURE);
302 aFirewireGUID.Assign(NS_ConvertUTF8toUTF16(firewireGUID));
#define SB_PRLOG_SETUP(x)
nsresult DeviceVolumeEject(nsCString &aDeviceUDI)
nsCOMPtr< nsIArray > mProperties
#define SB_DEVICE_PROPERTY_MANUFACTURER
sbIPDSysDevice(const nsID &aControllerID, nsIPropertyBag *aProperties)
Songbird iPod Device Logging Definitions.
nsresult DeviceVolumeUnmount(nsCString &aDeviceUDI)
readonly attribute sbIDeviceProperties properties
#define SB_DEVICE_PROPERTY_SERIAL_NUMBER
nsresult DeviceGetPropertyBool(const nsACString &aUDI, const char *aKey, PRBool *aProperty)
#define SB_DEVICE_PROPERTY_MODEL
_getSelectedPageStyle s i
nsresult DeviceGetPropertyString(const nsACString &aUDI, const char *aKey, nsCString &aProperty)