Fixed MediaServer bug TC-2309 08/33608/1
authorAlice Liu <alice.liu@intel.com>
Tue, 13 Jan 2015 10:20:50 +0000 (18:20 +0800)
committerAlice Liu <alice.liu@intel.com>
Tue, 13 Jan 2015 10:20:50 +0000 (18:20 +0800)
Package version up (2.0.48).

Change-Id: I62f86684eea28a38516f196b3c99072f334c2d50
Signed-off-by: Alice Liu <alice.liu@intel.com>
package/changelog
package/pkginfo.manifest
web/cache.manifest
web/ripple.js

index ba0bc56..95a2929 100644 (file)
@@ -1,3 +1,6 @@
+* 2.0.48
+- Fixed bug TC-2309
+== Alice Liu <alice.liu@intel.com> 2015-01-13 18:19
 * 2.0.47
 - Fixed bug TC-2255, TC-2262
 == Alice Liu <alice.liu@intel.com> 2015-01-06 14:06
index c4ad2a9..b9477d1 100644 (file)
@@ -1,4 +1,4 @@
-Version:2.0.47
+Version:2.0.48
 Maintainer:hyeongseok heo <hyeong-seok.heo@samsung.com>, gyeongseok seo <gyeongseok.seo@samsung.com>, jihoon song <jihoon80.song@samsung.com>, changhyun lee <changhyun1.lee@samsung.com>, bonyong lee <bonyong.lee@samsung.com>
 
 Package:websimulator-core
index e71d666..a9cac03 100644 (file)
@@ -108,4 +108,4 @@ themes/light/images/ui-icons_454545_256x240.png
 themes/light/images/ui-icons_888888_256x240.png
 themes/light/images/ui-icons_cd0a0a_256x240.png
 themes/light/theme.css
-# Manifest build date: Tue Jan 06 2015 14:03:19 GMT+0800 (CST)
\ No newline at end of file
+# Manifest build date: Tue Jan 13 2015 18:18:16 GMT+0800 (CST)
\ No newline at end of file
index 4362368..e31a53a 100644 (file)
@@ -1,5 +1,5 @@
 /*! 
-  Ripple Mobile Environment Emulator v0.9.8 :: Built On Tue Jan 06 2015 14:03:17 GMT+0800 (CST)
+  Ripple Mobile Environment Emulator v0.9.8 :: Built On Tue Jan 13 2015 18:18:15 GMT+0800 (CST)
 
                                 Apache License
                            Version 2.0, January 2004
@@ -79065,6 +79065,7 @@ function _initialize() {
     _data.mediaServer.containers = containers;
     _data.mediaServer.items = items;
     _data.mediaServer.onserverfound = null;
+    _data.mediaServer.onserverlost = null;
 }
 
 function _setRoot() {
@@ -79078,7 +79079,7 @@ function _formatSortMode(sortMode) {
                 "Artists", "Width", "Height", "SampleRate"];
 
     order = sortMode.match(/[+|-]/g);
-    if (order.length > 1) {
+    if (order === null || order.length > 1) {
         return null;
     }
 
@@ -79317,11 +79318,14 @@ _self = function () {
                 return;
             }
 
-            if (mediaserver.onserverfound == null) {
-                return;
+            if (mediaserver.onserverfound != null) {
+                mediaserver.onserverfound(new MediaServer(_data.mediaServer.server));
+            }
+
+            if (mediaserver.onserverlost != null) {
+                mediaserver.onserverlost(new MediaServer({'id':_data.mediaServer.server.id}));
             }
 
-            mediaserver.onserverfound(new MediaServer(_data.mediaServer.server));
         }, 1);
     }
 
@@ -79351,6 +79355,17 @@ _self = function () {
         }
     });
 
+    mediaserver.__defineGetter__("onserverlost", function () {
+        return _data.mediaServer.onserverlost;
+    });
+
+    mediaserver.__defineSetter__("onserverlost", function (val) {
+        try {
+            _data.mediaServer.onserverlost = t.Callback(val, "?");
+        } catch (e) {
+        }
+    });
+
     return mediaserver;
 };
 
@@ -79470,6 +79485,11 @@ MediaServer = function (obj) {
 
     this.cancel = function () {
         // cancel
+        return {
+            then: function(successCallback, errorCallback) {
+                successCallback();
+            }
+        };
     };
 
     this.browse = function (containerId, sortMode, count, offset,
@@ -79532,66 +79552,74 @@ MediaServer = function (obj) {
     };
 
     this.find = function (containerId, searchFilter, sortMode, count,
-            offset, successCallback, errorCallback) {
+            offset, errorCallback) {
         t.MediaServer("find", arguments);
 
-        window.setTimeout(function () {
-            var i, j, results, container = "", mediaFiles = [],
-                paths = _data.mediaServer.containers,
-                medias = _data.mediaServer.items,
-                sort = _formatSortMode(sortMode);
-
-            if (!containerId) {
-                if (errorCallback)
-                    errorCallback(new WebAPIError(errorcode.UNKNOWN));
-                return;
-            }
+        var i, j, results, container = "", mediaFiles = [],
+            paths = _data.mediaServer.containers,
+            medias = _data.mediaServer.items,
+            sort = _formatSortMode(sortMode);
 
-            for (i = 0; i < paths.length; i++) {
-                if (paths[i].id === containerId) {
-                    container = paths[i].Path;
-                    continue;
-                }
+        if (!containerId) {
+            if (errorCallback)
+                errorCallback(new WebAPIError(errorcode.UNKNOWN));
+            return;
+        }
 
-                if ((paths[i].Path.indexOf(containerId) === 0) &&
-                        (paths[i].Path !== containerId)) {
-                    mediaFiles.push(new MediaFactory(paths[i].type,
-                            paths[i]));
-                }
+        for (i = 0; i < paths.length; i++) {
+            if (paths[i].id === containerId) {
+                container = paths[i].Path;
+                continue;
             }
 
-            if (!container) {
-                if (errorCallback)
-                    errorCallback(new WebAPIError(errorcode.UNKNOWN));
-                return;
+            if ((paths[i].Path.indexOf(containerId) === 0) &&
+                    (paths[i].Path !== containerId)) {
+                mediaFiles.push(new MediaFactory(paths[i].type,
+                        paths[i]));
             }
+        }
 
-            for (i = 0; i < paths.length; i++) {
-                if ((paths[i].Path.indexOf(container) === 0) &&
-                        (paths[i].Path !== container)) {
-                    mediaFiles.push(new MediaFactory(paths[i].type,
-                            paths[i]));
-                }
+        if (!container) {
+            if (errorCallback)
+                errorCallback(new WebAPIError(errorcode.UNKNOWN));
+            return;
+        }
+
+        for (i = 0; i < paths.length; i++) {
+            if ((paths[i].Path.indexOf(container) === 0) &&
+                    (paths[i].Path !== container)) {
+                mediaFiles.push(new MediaFactory(paths[i].type,
+                        paths[i]));
             }
+        }
 
-            for (j = 0; j < medias.length; j++) {
-                if (medias[j].Path.indexOf(container) === 0) {
-                    mediaFiles.push(new MediaFactory(medias[j].type,
-                            medias[j]));
-                }
+        for (j = 0; j < medias.length; j++) {
+            if (medias[j].Path.indexOf(container) === 0) {
+                mediaFiles.push(new MediaFactory(medias[j].type,
+                        medias[j]));
             }
+        }
 
-            mediaFiles = _filter(searchFilter, mediaFiles);
-            if (mediaFiles === null) {
-                if (errorCallback)
-                    errorCallback(new WebAPIError(errorcode.UNKNOWN));
-                return;
+        mediaFiles = _filter(searchFilter, mediaFiles);
+        if (mediaFiles === null) {
+            if (errorCallback)
+                errorCallback(new WebAPIError(errorcode.UNKNOWN));
+            return;
+        }
+
+        results = ivi_utils.query(_filter(searchFilter, mediaFiles), false,
+                sort, count, offset);
+
+        return {
+            then: function (callback) {
+                callback(results);
             }
+        };
 
-            results = ivi_utils.query(_filter(searchFilter, mediaFiles), false,
-                    sort, count, offset);
-            successCallback(results);
-        }, 1);
+    };
+
+    this.oncontainerchanged = function () {
+        //oncontainerchanged
     };
 };
 
@@ -83361,12 +83389,11 @@ _i.MediaServer.find = {
     2: _t.DOMString,
     3: _t.unsigned_long,
     4: _t.unsigned_long,
-    5: _t.MediaServerBrowseFindCallback,
-    6: _t.MediaServerErrorCallback,
+    5: _t.MediaServerErrorCallback,
 
     _optional: {
         // nullable
-        6: true
+        5: true
     }
 };
 
@@ -106210,6 +106237,8 @@ var _original = window.navigator,
     devices = require('ripple/devices'),
     constants = require('ripple/constants'),
     vibration = require('ripple/platform/tizen/2.0/vibration'),
+    platform = require('ripple/platform'),
+    builder = require('ripple/platform/builder'),
     _self = {};
 
 (function () {
@@ -106221,6 +106250,11 @@ var _original = window.navigator,
             return obj[key].apply(obj, Array.prototype.slice.call(arguments));
         };
     }
+    //this is a temporary work around method
+    var sandbox = {};
+    builder.build(platform.current().objects).into(sandbox);
+    nav.vehicle = sandbox.navigator.vehicle;
+    nav.mediaServer = sandbox.navigator.mediaserver;
 
     for (key in nav) {
         _self[key] = _handle(nav, key);