{ "id": "115568", "key": "TIMOB-14134", "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": "15547", "description": "2013 Sprint 14", "name": "2013 Sprint 14", "archived": true, "released": true, "releaseDate": "2013-07-15" }, { "id": "15548", "description": "2013 Sprint 14 API", "name": "2013 Sprint 14 API", "archived": true, "released": true, "releaseDate": "2013-07-15" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-07-02T16:19:09.000+0000", "created": "2013-06-06T00:25:52.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "supportTeam" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T22:08:59.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": "h6.Issue\r\nApp is not responding if you press the Android power button 2-3 times, then you can reproduce the ANR. Sometimes even at first time pressing power button you can reproduce this issue.\r\n\r\nh6.Tested on\r\nSamsung S3 - 4.1.2 , Sony Xperia U - 2.3.7 , HTC amaze - 2.3.4 , Droid Razr 2.3.5\r\n\r\nh6.Steps to reproduce\r\n1. Run app \r\n2. Click \"sync\" button (there will be a HTTP call after got the response from the server)\r\n3. Huge data will be inserted into local database.\r\n\r\nHe is trying to stop the animation and start it again while locking and unlocking the mobile screen. Like:\r\n\r\n{code}\r\nvar bc = Ti.Android.createBroadcastReceiver({\r\n onReceived: function() {\r\n // Animation remove\r\n }\r\n});\r\n\r\nTi.Android.registerBroadcastReceiver(bc, [Ti.Android.ACTION_SCREEN_OFF]);\r\n{code}\r\n\r\nIt would also save the extra overhead of the app when the phone screen is locked since they have a requirement they have to use a custom indicator.\r\n\r\nh6.Reproduction sample\r\n{code}\r\nTitanium.UI.setBackgroundColor('#000');\r\nTi.Database.install('indicator.sqlite', \"indicator\");\r\nTi.App.Properties.setBool('isLoading', false);\r\nvar win = Titanium.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\nvar wrappr,loaderView;\r\n\r\nvar inserRow = function(rowIndex){\r\n\t var db = Ti.Database.open(\"indicator\");\r\n\t db.execute(\"INSERT OR REPLACE INTO demo (cid,coloumn1,coloumn2,coloumn3,coloumn4,coloumn5,coloumn6,coloumn7,coloumn8,coloumn9,coloumn10,coloumn11,coloumn12,coloumn13,coloumn14,coloumn15,coloumn16,coloumn17,coloumn18,coloumn19,coloumn20,coloumn21,coloumn22) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\", rowIndex, \"coloumn1 - this sampele description text\", \"coloumn2 - this sampele description text\", \"coloumn3 - this sampele description text\", \"coloumn4 - this sampele description text\", \"coloumn5 - this sampele description text\", \"coloumn6 - this sampele description text\", \"coloumn7 - this sampele description text\", \"coloumn8 - this sampele description text\", \"coloumn9 - this sampele description text\", \"coloumn10 - this sampele description text\", \"coloumn11 - this sampele description text\", \"coloumn12 - this sampele description text\", \"coloumn13 - this sampele description text\", \"coloumn14 - this sampele description text\", \"coloumn15 - this sampele description text\", \"coloumn16 - this sampele description text\", \"coloumn17 - this sampele description text\", \"coloumn18 - this sampele description text\", \"coloumn19 - this sampele description text\", \"coloumn20 - this sampele description text\", \"coloumn21 - this sampele description text\", \"coloumn22 - this sampele description text\");\r\n\t db.close();\r\n};\r\n\r\nvar deleteTable = function(){\r\n\tvar db = Ti.Database.open(\"indicator\");\r\n\tdb.execute(\"delete from demo\");\r\n\tdb.close();\r\n};\r\n\r\nvar addLoader = function(bgColor){\r\n\tvar loaderView = Ti.UI.createView({\r\n\t\theight : Ti.UI.SIZE,\r\n\t\ttop : 35\r\n\t});\r\n\r\n\tif(bgColor){\r\n\t\tloaderView.backgroundColor = bgColor;\r\n\t}\r\n\r\n\tvar prefix = 'loadingSmall/';\r\n \r\n Ti.API.info(\"prefix = \"+prefix);\r\n\tvar loader = Ti.UI.createImageView({\r\n\t\theight : 50,\r\n\t\twidth : 50,\r\n\t\tduration : 50,\r\n\t\timages : [prefix + 'loading01.png', prefix + 'loading02.png', prefix + 'loading03.png', prefix + 'loading04.png', prefix + 'loading05.png', prefix + 'loading06.png', prefix + 'loading07.png', prefix + 'loading08.png', prefix + 'loading09.png', prefix + 'loading10.png', prefix + 'loading11.png', prefix + 'loading12.png', prefix + 'loading13.png', prefix + 'loading14.png', prefix + 'loading15.png', prefix + 'loading16.png', prefix + 'loading17.png', prefix + 'loading18.png']\r\n\t});\r\n\tloaderView.add(loader);\r\n\tloader.start();\r\n\r\n\treturn loaderView;\r\n};\r\n\r\nvar loadingHolderView = new function () {\r\n\tthis.loadingHolderView = null;\r\n\r\n\tthis.getLoadingHolderView = function () {\r\n\t\treturn this.loadingHolderView;\r\n\t};\r\n\r\n\tthis.setLoadingHolderView = function (view) {\r\n\t\tthis.loadingHolderView = view;\r\n\t};\r\n};\r\n\r\nvar addLoading = function(){\r\n wrappr = Titanium.UI.createView({\r\n height: Ti.Platform.displayCaps.platformHeight,\r\n width: Ti.Platform.displayCaps.platformWidth,\r\n backgroundColor: '#000',\r\n opacity: 0.8\r\n });\r\n win.add(wrappr);\r\n \r\n var indView = Titanium.UI.createView({\r\n height : \"150\",\r\n width : Ti.UI.FILL,\r\n backgroundColor: '#000'\r\n });\r\n wrappr.add(indView);\r\n \r\n var tmpView = Titanium.UI.createView();\r\n indView.add(tmpView);\r\n\r\n var loadingImage = addLoader();\r\n tmpView.add(loadingImage);\r\n \r\n\tloadingHolderView.setLoadingHolderView(tmpView);\r\n\r\n\tvar message = Titanium.UI.createLabel({ \r\n\t\ttop: 100,\r\n\t text: 'Loading...',\r\n\t color: '#fff',\r\n\t width: Ti.UI.SIZE,\r\n\t height: Ti.UI.SIZE,\r\n\t font : {\r\n\t\t\tfontFamily:\"Helvetica Nue\",\r\n\t\t\tfontSize:14,\r\n\t\t\tfontWight:\"bold\"\r\n\t\t}\r\n\t});\r\n\tindView.add(message);\r\n};\r\n\r\nvar removeLoading = function(){\r\n\twin.remove(wrappr);\r\n}\r\n\r\n// Create a Button.\r\nvar syncBtn = Ti.UI.createButton({\r\n\ttitle : 'Sync'\r\n});\r\n\r\n// Listen for click events.\r\nsyncBtn.addEventListener('click', function() {\r\n\t addLoading();\r\n\t Ti.App.Properties.setBool('isLoading', true);\r\n\t var url = \"http://www.appcelerator.com\";\r\n\t var client = Ti.Network.createHTTPClient({\r\n\t // function called when the response data is available\r\n\t onload : function(e) {\r\n\t Ti.API.info(\"Received text: \" + this.responseText);\r\n\t Ti.API.info(\"delete demo table\");\r\n\t deleteTable();\r\n\t\t\t Ti.API.info(\"insert demo table\");\r\n\t for(var i = 1; i<3500; i++){\r\n\t \t Ti.API.info(\"row index = \"+i);\r\n\t \t inserRow(i);\r\n\t\t\t }\r\n\t\t\t removeLoading();\r\n\t\t\t Ti.App.Properties.setBool('isLoading', false);\r\n\t },\r\n\t // function called when an error occurs, including a timeout\r\n\t onerror : function(e) {\r\n\t \t removeLoading();\r\n\t \t Ti.App.Properties.setBool('isLoading', false);\r\n\t Ti.API.debug(e.error);\r\n\t },\r\n\t timeout : 5000 // in milliseconds\r\n\t });\r\n\t // Prepare the connection.\r\n\t client.open(\"GET\", url);\r\n\t // Send the request.\r\n\t client.send();\r\n});\r\n\r\nwin.add(syncBtn);\r\n\r\n\r\nvar bc = Ti.Android.createBroadcastReceiver({\r\n onReceived: function() {\r\n // Animation remove\r\n\t\tTi.API.info('@@@Android Camed to resume, isLoading = '+Ti.App.Properties.getBool('isLoading')); \r\n\t\tif(Ti.App.Properties.getBool('isLoading')){\r\n\t\t\tvar lhv = loadingHolderView.getLoadingHolderView();\r\n\t\t\tTi.API.info('@@@Android child len = '+lhv.children.length);\r\n\t\t\tif(lhv.children.length){\r\n\t\t\t lhv.remove(lhv.children[0]);\r\n\t\t\t var loadingImage = addLoader(\"green\");\r\n\t\t\t lhv.add(loadingImage);\r\n\t\t }\r\n\t\t}\r\n }\r\n});\r\n\r\nTi.Android.registerBroadcastReceiver(bc, [Ti.Android.ACTION_SCREEN_OFF]);\r\n\r\nwin.open();\r\n{code}\r\n\r\nsqlite and loadingSmall assets were attached or can be downloaded here: https://github.com/karthi-anubavam/indicator-test\r\n\r\nh6.Stack trace\r\nEventually App is not responding, device logs have been attached.", "attachment": [ { "id": "39506", "filename": "ANR_device_logs_2.3.5.txt", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-06T00:25:52.000+0000", "size": 329126, "mimeType": "text/plain" }, { "id": "39508", "filename": "indicator-test-master (1).zip", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-06T00:25:52.000+0000", "size": 2982607, "mimeType": "application/zip" }, { "id": "39507", "filename": "log (2).txt", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-06-06T00:25:52.000+0000", "size": 234764, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: ANR during Imageview animation ", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Android 2.3 & 4.1.2\r\nTiSDK 3.1.0.GA & 3.2 CI build", "comment": { "comments": [ { "id": "408958", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T22:08:59.000+0000", "updated": "2017-03-03T22:08:59.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }