From 2eb0a07470e100feb308676c3e3096a60802cf01 Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Thu, 14 Aug 2014 13:45:50 -0700 Subject: [PATCH] Clear the cached bluetooth devices due to UI bug This is a work-around to fix the Modello Bluetooth settings UI from hanging after bluetooth scan. The cached bluetooth device objects that are being serialized using the Knockout library is not cached properly, this caused Modello to load a list of invalid devices. This fix clears the cached devices and starts fresh when it loads. Change-Id: I80115e4510a504e51c4ff7a78cb640cfe517a844 Signed-off-by: Jimmy Huang --- css/car/components/settings/js/bluetooth.js | 4 ++-- packaging/modello-common.changes | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/css/car/components/settings/js/bluetooth.js b/css/car/components/settings/js/bluetooth.js index 42980e3..704747d 100644 --- a/css/car/components/settings/js/bluetooth.js +++ b/css/car/components/settings/js/bluetooth.js @@ -465,7 +465,7 @@ Bluetooth.prototype.loadBluetoothConfig = function() { if (!!bluetooth) { self.lastSync(bluetooth.lastSync); if (!!self.adapter() && self.adapter().powered && !!bluetooth.devices) { - self.devices(bluetooth.devices); + self.clearDevices(); self.refreshDevices(); self._setRefreshDevicesInterval(); } @@ -486,7 +486,7 @@ Bluetooth.prototype.getDevice = function(device) { self.addUpdateDevice(dev, false); self.sortDevices(); self.saveBluetooth(); - if (self.selectedDevice().address === dev.address) { + if (!!self.selectedDevice() && self.selectedDevice().address === dev.address) { self.selectedDevice(dev); } }, function(error) { diff --git a/packaging/modello-common.changes b/packaging/modello-common.changes index ef64dd7..f11a771 100644 --- a/packaging/modello-common.changes +++ b/packaging/modello-common.changes @@ -1,3 +1,6 @@ +* Thu Aug 14 2014 Jimmy Huang accepted/tizen/ivi/20140814.201957-1-g4c3a4b4 +- Clear the cached bluetooth devices due to UI bug + * Wed Aug 13 2014 Brian Jones submit/tizen_3.0.m14.2_ivi/20140723.000002-4-g94fa069 - Fix font name, temporarily remove subscribe call, and fix app name -- 2.7.4