summaryrefslogtreecommitdiff
path: root/src/linux/up-device-idevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/up-device-idevice.c')
-rw-r--r--src/linux/up-device-idevice.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c
index c9bf5af..dad245c 100644
--- a/src/linux/up-device-idevice.c
+++ b/src/linux/up-device-idevice.c
@@ -219,6 +219,7 @@ up_device_idevice_refresh (UpDevice *device, UpRefreshReason reason)
idevice_t dev = idevice->priv->dev;
lockdownd_client_t client = NULL;
lockdownd_error_t lerr;
+ char *name = NULL;
plist_t dict, node;
guint64 percentage;
guint8 charging, has_battery;
@@ -243,6 +244,15 @@ up_device_idevice_refresh (UpDevice *device, UpRefreshReason reason)
goto out;
}
+ if (lockdownd_get_device_name (client, &name) == LOCKDOWN_E_SUCCESS) {
+ /* Prefer the user-chosen name for the device when available */
+ g_object_set (device,
+ "vendor", NULL,
+ "model", name,
+ NULL);
+ free (name);
+ }
+
if (lockdownd_get_value (client, "com.apple.mobile.battery", NULL, &dict) != LOCKDOWN_E_SUCCESS)
goto out;