{ "id": "99580", "key": "TIMOB-10540", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14787", "description": "2012 Sprint 26 API", "name": "2012 Sprint 26 API", "archived": true, "released": true, "releaseDate": "2012-12-31" }, { "id": "14786", "description": "2012 Sprint 26", "name": "2012 Sprint 26", "archived": true, "released": true, "releaseDate": "2012-12-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-01-25T22:02:27.000+0000", "created": "2012-08-21T17:55:40.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "calendar", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "23452", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "88071", "key": "TIMOB-8053", "fields": { "summary": "Android: Calendar crashes on ICS", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "24693", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "108107", "key": "TIMOB-12343", "fields": { "summary": "Backport TIMOB-10540 to 3.0.2", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-07T06:59:05.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Assign \"READ_CALENDAR\" and/or \"WRITE_CALENDAR\" permissions with calendar methods appropriately in builder.py so permissions will be auto generated.\r\n\r\nSteps to reproduce: \r\n\r\n1. Run this code in Titanium Studio\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\nvar win = Titanium.UI.createWindow({ \r\n title:'Calendar',\r\n backgroundColor:'#fff'\r\n});\r\nwin.open();\r\n \r\nfunction showCalendars(calendars) {\r\n for (var i = 0; i < calendars.length; i++) {\r\n Ti.API.info(calendars[i].name);\r\n Ti.API.info(JSON.stringify(calendars[i]));\r\n }\r\n}\r\n \r\nTi.API.info('ALL CALENDARS:');\r\nshowCalendars(Ti.Android.Calendar.allCalendars);\r\nTi.API.info('SELECTABLE CALENDARS:');\r\nshowCalendars(Ti.Android.Calendar.selectableCalendars);\r\n \r\n// SHOW ALL EVENTS FOR 2010 FOR ONE CALENDAR\r\nvar YEAR = 2012;\r\nvar TEST_WITH_THIS_CAL_ID = 1;\r\nvar calendar = Ti.Android.Calendar.getCalendarById(TEST_WITH_THIS_CAL_ID);\r\n \r\nvar events = calendar.getEventsInYear(YEAR);\r\nif (events && events.length) {\r\n Ti.API.info(events.length + ' event(s) in ' + YEAR);\r\n \r\n for (var i = 0; i < events.length; i++) {\r\n Ti.API.info(JSON.stringify(events[i]));\r\n \r\n }\r\n} else {\r\n Ti.API.info('No events');\r\n}\r\n \r\n \r\n \r\nvar CALENDAR_TO_USE = 1;\r\nvar calendar = Ti.Android.Calendar.getCalendarById(CALENDAR_TO_USE);\r\n \r\n// Create the event\r\nvar eventBegins = new Date(2012, 03, 26, 12, 0, 0);\r\nvar eventEnds = new Date(2012, 03, 26, 14, 0, 0);\r\nvar details = {\r\n title: 'Do some stuff',\r\n description: \"I'm going to do some stuff at this time.\",\r\n begin: eventBegins,\r\n end: eventEnds\r\n};\r\n \r\nvar event = calendar.createEvent(details);\r\n \r\n// Now add a reminder via e-mail for 10 minutes before the event.\r\nvar reminderDetails = {\r\n minutes: 10,\r\n method: Ti.Android.Calendar.METHOD_EMAIL\r\n};\r\nevent.createReminder(reminderDetails);\r\n{code}\r\n\r\n2.Code should run w/o having to manually insert calendar permissions into tiapp.xml", "attachment": [], "flagged": false, "summary": "Android: Map Calendar methods with Android permissions", "creator": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "232485", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Hieu, could you whip up a 3.0.x pull request and I'll review and merge that too?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-12-22T01:18:36.000+0000", "updated": "2012-12-22T01:18:36.000+0000" }, { "id": "234961", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Master PR: https://github.com/appcelerator/titanium_mobile/pull/3594", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T14:15:43.000+0000", "updated": "2013-01-18T14:15:43.000+0000" }, { "id": "235259", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Backport Task TIMOB-12343\nBackport PR https://github.com/appcelerator/titanium_mobile/pull/3734", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-21T22:06:40.000+0000", "updated": "2013-01-21T22:06:40.000+0000" }, { "id": "235694", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "If Calender permissions are not inserted into the tiapp.xml then\r\nError occurs as \"\r\nException occurred at app.js:53: Uncaught Error: Permission Denial: writing com.android.providers.calendar.CalendarProvider2 uri content://com.android.calendar/events from pid=2759, uid=10061 requires android.permission.WRITE_CALENDAR \"\r\n\r\nError occurs for sdk build : 3.1.0.v20130123144204, 3.0.2.v20130122172624\r\ntested on Google Nexus \r\nAndroid version : 4.0.4", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-01-24T07:13:05.000+0000", "updated": "2013-01-24T07:13:05.000+0000" }, { "id": "235972", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Master PR: https://github.com/appcelerator/titanium_mobile/pull/3787", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T19:28:43.000+0000", "updated": "2013-01-25T19:28:43.000+0000" }, { "id": "236001", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR: https://github.com/appcelerator/titanium_mobile/pull/3788", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T21:16:08.000+0000", "updated": "2013-01-25T21:16:08.000+0000" }, { "id": "237279", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\nTitanium Studio, build: 3.0.2.201302011646\nTitanium SDK, build: 3.0.2.v20130201161712 \nDevice:\nNexus4 Android version 4.2\n\n\"READ_CALENDAR\" and/or \"WRITE_CALENDAR\" permissions are auto generated .", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T21:32:29.000+0000", "updated": "2013-02-05T21:32:29.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }