{ "id": "173484", "key": "TIMOB-27087", "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": "20412", "name": "Release 8.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-06-28T21:17:11.000+0000", "created": "2019-04-19T13:17:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "engSchedule" ], "versions": [ { "id": "19882", "name": "Release 8.0.0", "archived": false, "released": true, "releaseDate": "2019-03-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-06-28T21:17:11.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": [], "description": "on iOS, there is a method *removeAllDynamicShortcuts()* that allows me to remove all shortcuts and create new ones.\r\n\r\non Android, the only method we have is *createShortcutItem()*. There is no update or remove of any kind.\r\n\r\nIn Ti.Slack, Joshua Quick mentioned that, by looking at the code, he _thought_ all we needed to do was use the createShortcutItem() method again and as long as the \"id\" was the same - it would be overridden or replaced.\r\n\r\nThat is not happening and is resulting in an error, \"Max number of dynamic shortcuts exceeded\".\r\n\r\nWe have to have a way to remove or at a minimum replace an existing shortcut.\r\n\r\n\r\nCODE:\r\n{code:javascript}\r\n var mobileShortcut;\r\n var workShortcut;\r\n var emailShortcut;\r\n function testAndroidShortcut() {\r\n emailShortcut = Ti.UI.createShortcutItem({\r\n id: 'email_address',\r\n title: \"Email\",\r\n description: 'Email',\r\n icon: Ti.Android.R.drawable.ic_menu_send\r\n });\r\n workShortcut = Ti.UI.createShortcutItem({\r\n id: 'work_phone',\r\n title: \"Work\",\r\n description: 'Work',\r\n icon: Ti.Android.R.drawable.ic_menu_call\r\n });\r\n mobileShortcut = Ti.UI.createShortcutItem({\r\n id: 'mobile_phone',\r\n title: \"Mobile\",\r\n description: 'Mobile',\r\n icon: Ti.Android.R.drawable.ic_menu_call\r\n });\r\n }\r\n\r\n for (var i = 0; i < 7; i++) {\r\n testAndroidShortcut();\r\n }\r\n{code}\r\n\r\n\r\nERROR:\r\n{code:javascript}\r\n[ERROR] KrollProxy: (main) [22,12720] Error creating proxy\r\n[ERROR] KrollProxy: java.lang.IllegalArgumentException: Max number of dynamic shortcuts exceeded\r\n[ERROR] KrollProxy: at android.os.Parcel.createException(Parcel.java:1970)\r\n[ERROR] KrollProxy: at android.os.Parcel.readException(Parcel.java:1934)\r\n[ERROR] KrollProxy: at android.os.Parcel.readException(Parcel.java:1884)\r\n[ERROR] KrollProxy: at android.content.pm.IShortcutService$Stub$Proxy.setDynamicShortcuts(IShortcutService.java:521)\r\n[ERROR] KrollProxy: at android.content.pm.ShortcutManager.setDynamicShortcuts(ShortcutManager.java:336)\r\n[ERROR] KrollProxy: at ti.modules.titanium.ui.ShortcutItemProxy.show(ShortcutItemProxy.java:127)\r\n[ERROR] KrollProxy: at ti.modules.titanium.ui.ShortcutItemProxy.handleCreationDict(ShortcutItemProxy.java:111)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.KrollProxy.handleCreationArgs(KrollProxy.java:205)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.KrollProxy.setupProxy(KrollProxy.java:131)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.KrollProxy.createProxy(KrollProxy.java:140)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:55)\r\n[ERROR] KrollProxy: at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:41)\r\n[ERROR] KrollProxy: at ti.modules.titanium.TitaniumModule$Timer.run(TitaniumModule.java:167)\r\n[ERROR] KrollProxy: at android.os.Handler.handleCallback(Handler.java:873)\r\n[ERROR] KrollProxy: at android.os.Handler.dispatchMessage(Handler.java:99)\r\n[ERROR] KrollProxy: at android.os.Looper.loop(Looper.java:214)\r\n[ERROR] KrollProxy: at android.app.ActivityThread.main(ActivityThread.java:7032)\r\n[ERROR] KrollProxy: at java.lang.reflect.Method.invoke(Native Method)\r\n[ERROR] KrollProxy: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)\r\n[ERROR] KrollProxy: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)\r\n[ERROR] KrollProxy: Caused by: android.os.RemoteException: Remote stack trace:\r\n[ERROR] KrollProxy: at com.android.server.pm.ShortcutService.enforceMaxActivityShortcuts(ShortcutService.java:1702)\r\n[ERROR] KrollProxy: at com.android.server.pm.ShortcutPackage.enforceShortcutCountsBeforeOperation(ShortcutPackage.java:1104)\r\n[ERROR] KrollProxy: at com.android.server.pm.ShortcutService.setDynamicShortcuts(ShortcutService.java:1849)\r\n[ERROR] KrollProxy: at android.content.pm.IShortcutService$Stub.onTransact(IShortcutService.java:64)\r\n[ERROR] KrollProxy: at android.os.Binder.execTransact(Binder.java:739)\r\n[ERROR] KrollProxy:\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ShortcutItem not being updated based on \"id\"", "creator": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "amwinsauto", "key": "amwinsauto", "displayName": "Adam Armstrong", "active": true, "timeZone": "America/Chicago" }, "environment": "Ti 8.0.0.GA\r\nAndroid minSdkVersion=\"19\", targetSdkVersion=\"28\"", "closedSprints": [ { "id": 1141, "state": "closed", "name": "2019 Sprint 12", "startDate": "2019-06-03T22:00:37.435Z", "endDate": "2019-06-14T22:00:00.000Z", "completeDate": "2019-06-15T03:44:20.826Z", "originBoardId": 114 }, { "id": 1146, "state": "closed", "name": "2019 Sprint 13", "startDate": "2019-06-18T06:36:49.723Z", "endDate": "2019-07-01T06:36:00.000Z", "completeDate": "2019-07-01T16:45:24.126Z", "originBoardId": 114 }, { "id": 1136, "state": "closed", "name": "2019 Sprint 11", "startDate": "2019-05-18T17:39:52.830Z", "endDate": "2019-05-31T17:39:00.000Z", "completeDate": "2019-06-04T21:37:11.485Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "448015", "author": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "body": "I have the same issue. With one shortcut it works fine ...\r\nIn my radio app I'd like to add the 3 most listen stations in this list. This list is dynamic and changes time to time. For this I need an update...\r\n\r\nOther little question: the icon property. I used the string version (same as for imageview). It works with imageview, but not with icon. ", "updateAuthor": { "name": "titanium@webmasterei-hamburg.de", "key": "titanium@webmasterei-hamburg.de", "displayName": "Rainer Schleevoigt", "active": true, "timeZone": "Europe/Berlin" }, "created": "2019-04-27T07:18:15.000+0000", "updated": "2019-04-27T07:18:15.000+0000" }, { "id": "448875", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/10943", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-05T21:49:58.000+0000", "updated": "2019-06-05T21:49:58.000+0000" }, { "id": "449372", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Master merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-26T17:10:27.000+0000", "updated": "2019-06-26T17:10:34.000+0000" }, { "id": "449386", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (8.1.x): https://github.com/appcelerator/titanium_mobile/pull/11000", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-27T00:09:21.000+0000", "updated": "2019-06-27T00:09:21.000+0000" }, { "id": "449432", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-27T22:25:38.000+0000", "updated": "2019-06-27T22:25:38.000+0000" }, { "id": "449482", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix in SDK 8.1.0.v20190628095604 & 8.2.0.v20190628101943.\r\n\r\nClosing.\r\n\r\nStudio Ver: 5.1.3.201906102126\r\nOS Ver: 10.14.5\r\nXcode Ver: Xcode 10.2.1\r\nAppc NPM: 4.2.13\r\nAppc CLI: 7.0.12\r\nDaemon Ver: 1.1.3\r\nTi CLI Ver: 5.1.1\r\nAlloy Ver: 1.13.10\r\nNode Ver: 8.15.1\r\nNPM Ver: 6.4.1\r\nJava Ver: 10.0.2\r\nDevices: ⇨ google Pixel (Android 9)\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-06-28T21:16:48.000+0000", "updated": "2019-06-28T21:16:48.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }