[Common] Changed configuration for common profile build
[platform/core/api/webapi-plugins.git] / src / alarm / alarm_api.js
index d7ff0da..8b386bb 100755 (executable)
@@ -222,7 +222,7 @@ AlarmManager.prototype.get = function() {
                 result.period,
                 InternalData_(result)
             );
-        } else {
+        } else if ('AlarmAbsolute' === result.type) {
             var date = new Date(
                 result.year,
                 result.month,
@@ -233,6 +233,8 @@ AlarmManager.prototype.get = function() {
             );
 
             alarm = new tizen.AlarmAbsolute(date, result.second, InternalData_(result));
+        } else {
+            alarm = new Alarm(InternalData_(result));
         }
         _warningLogs.allow();
         return alarm;
@@ -310,9 +312,11 @@ AlarmManager.prototype.getAll = function() {
         data.forEach(function(i) {
             if ('AlarmRelative' === i.type) {
                 md.push(new tizen.AlarmRelative(i.delay, i.period, InternalData_(i)));
-            } else {
+            } else if ('AlarmAbsolute' === i.type) {
                 var date = new Date(i.year, i.month, i.day, i.hour, i.min, i.sec);
                 md.push(new tizen.AlarmAbsolute(date, i.second, InternalData_(i)));
+            } else {
+                md.push(new Alarm(InternalData_(i)));
             }
         });
         _warningLogs.allow();
@@ -567,7 +571,7 @@ var ProfileAlarm = (function() {
 var _profile = ProfileAlarm.getInstance().profile;
 
 // Notifications feature are available on mobile and wearable profile
-if (_profile != 'mobile' && _profile != 'wearable') {
+if (_profile != 'mobile' && _profile != 'wearable' && _profile != 'common') {
     delete AlarmManager.prototype.addAlarmNotification;
     delete AlarmManager.prototype.getAlarmNotification;
     isAlarmAbsolutePeriodDeprecated = false;