{ "id": "122933", "key": "TIMOB-15825", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-11-26T09:48:09.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "qe-3.2.0" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:03.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Android: Media: Camera is not accessible in Google Nexus 7 with autohide property false\r\nIssue is reproducible on SDK:3.1.3.GA also.\r\n\r\nSteps to reproduce:\r\n1. Run the below app.\r\n{code}\r\n\r\n\r\nTi.UI.backgroundColor = \"#fff\";\r\nvar win = Ti.UI.createWindow({ \r\n title:'Test',\r\n backgroundColor:'#fff',\r\n exitOnClose: true,\r\n orientationModes: [Ti.UI.PORTRAIT]\r\n }),\r\n log = function(s) {\r\n console.log(s);\r\n },\r\n btn = Ti.UI.createButton({\r\n title: \"Show camera\",\r\n top: \"16dp\",\r\n left: \"16dp\"\r\n }),\r\n hideSwitch = Ti.UI.createSwitch({\r\n titleOn: \"autohide=true\",\r\n titleOff: \"autohide=false\",\r\n value: true,\r\n width: Ti.UI.SIZE,\r\n height: Ti.UI.SIZE,\r\n right: \"16dp\",\r\n top: \"16dp\"\r\n }),\r\n overlayView = Ti.UI.createView({\r\n width: Ti.UI.FILL,\r\n height: Ti.UI.FILL\r\n }),\r\n overlayButtonClick = Ti.UI.createButton({\r\n width: Ti.UI.SIZE,\r\n height: \"48dp\",\r\n bottom: \"8dp\",\r\n left: \"16dp\",\r\n title: \"Take Photo\"\r\n }),\r\n overlayButtonClose = Ti.UI.createButton({\r\n width: Ti.UI.SIZE,\r\n height: \"48dp\",\r\n bottom: \"8dp\",\r\n right: \"16dp\",\r\n title: \"Close\"\r\n }),\r\n options = {\r\n cancel: function() {\r\n log(\"Cancelled\");\r\n },\r\n error: function(e){\r\n log(\"Error - \" + e.error);\r\n },\r\n success: function(e) {\r\n log(\"Media type: \" + e.mediaType);\r\n log(\"Media size: \" + e.media.length);\r\n makeImageView(e.media);\r\n },\r\n autohide: hideSwitch.value,\r\n saveToPhotoGallery: false,\r\n showControls: false\r\n },\r\n sv = Ti.UI.createScrollView({\r\n contentWidth: 'auto',\r\n contentHeight: 'auto',\r\n width: Ti.UI.FILL,\r\n height: Ti.UI.FILL,\r\n layout: 'vertical',\r\n top: \"80dp\",\r\n scrollType: 'vertical',\r\n backgroundColor: 'black'\r\n });\r\n\r\noverlayView.add(overlayButtonClick);\r\noverlayView.add(overlayButtonClose);\r\n\r\noverlayButtonClick.addEventListener(\"click\", function() {\r\n\tTi.Media.takePicture();\r\n});\r\n\r\noverlayButtonClose.addEventListener(\"click\", function() {\r\n\tTi.Media.hideCamera();\r\n});\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n options.autohide = hideSwitch.value;\r\n if (hideSwitch.value) {\r\n if (options.overlay) {\r\n delete options.overlay;\r\n }\r\n } else {\r\n options.overlay = overlayView;\r\n }\r\n\tTi.Media.showCamera(options);\r\n});\r\n\r\nfunction makeImageView(blob) {\r\n sv.add(Ti.UI.createImageView({\r\n image: blob.imageAsThumbnail(Ti.Platform.displayCaps.platformWidth, 1, 20),\r\n height: (3 * 48) + \"dp\",\r\n width: (Ti.Platform.displayCaps.platformWidth - 48) + \"px\",\r\n top: \"8dp\"\r\n }));\r\n}\r\n\r\nwin.add(btn);\r\nwin.add(hideSwitch);\r\nwin.add(sv);\r\n\r\nwin.open();\r\n{code}\r\n\r\n2. Set autohide=false, click on camera and take multiple pictures. Click on close.\r\n\r\nExpected:\r\nCamera should open.\r\n\r\nActual:\r\nError is logged as \"Camera is not accessible\".", "attachment": [], "flagged": false, "summary": "Android: Media: Camera is not accessible in Google Nexus 7 with autohide property set to false", "creator": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Tested on:\r\nDevice : Google Nexus 7, Android Version: 4.2.1\r\nSDK: 3.2.0.v20131125171956\r\nCLI version : 3.2.0-alpha3\r\nOS : MAC OSX 10.9\r\nAlloy: 1.3.0-alpha6\r\nAppcelerator Studio, build: 3.2.0.201311221207\r\nXCode : 5.0.2", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }