[TIMOB-13443] Android: Deprecate incrementServiceRefCount, decrementServiceRefCount and getServiceRefCount before removing them
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-04-08T22:47:14.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 3.1.0, 2013 Sprint 07 Core, 2013 Sprint 07, Release 3.2.0 |
| Components | Android |
| Labels | qe-closed-3.1.0, regression |
| Reporter | Martin Guillon |
| Assignee | Allen Yeung |
| Created | 2013-04-06T07:25:51.000+0000 |
| Updated | 2013-04-09T23:35:34.000+0000 |
Description
this [commit](https://github.com/appcelerator/titanium_mobile/commit/48fd5c12f6f7b4941affd5ce8d6a0ab9f65113fc) broke backward compatibility of modules when using :
incrementServiceRefCount
decrementServiceRefCount
getServiceRefCount
Method names have changed without supporting deprecated. As a consequence a module built before will crash using a newer sdk and vice versa
Attachments
| File | Date | Size |
|---|---|---|
| com.service-android-0.1.zip | 2013-04-08T22:06:30.000+0000 | 44969 |
[~farfromrefuge] Those APIs are private and not listed as being supported from release to release. Is there a reason you are relying on them?
Test case: 1. Create a titanium project 2. Include the attached project 3. Run the following app.js
Expected Result: You should get an alert with '0' as its message Actual Result: The app hangs on splash screen with a class not found exception in log.var win = Ti.UI.createWindow({ backgroundColor:'white' }); var label = Ti.UI.createLabel(); win.add(label); win.open(); // TODO: write your module tests here var service = require('com.service'); Ti.API.info("module is => " + service); label.text = service.example(); Ti.API.info("module exampleProp is => " + service.exampleProp); service.exampleProp = "This is a test value"; alert(service.getServiceRefCount()); if (Ti.Platform.name == "android") { var proxy = service.createExample({ message: "Creating an example Proxy", backgroundColor: "red", width: 100, height: 100, top: 100, left: 150 }); proxy.printMessage("Hello world!"); proxy.message = "Hi world!. It's me again."; proxy.printMessage("Hello world!"); win.add(proxy); }https://github.com/appcelerator/titanium_mobile/pull/4125 EDIT: backport: https://github.com/appcelerator/titanium_mobile/pull/4127
Need backport to 3_1_X as well
Verified fixed with: Mac OS 10.8.3 Xcode 4.6 CLI: 3.1.0-cr Alloy: 1.1.0-cr Appcelerator Studio, build: 3.1.0.201304082106 Titanium SDK version 3.1.0.v20130409124549 Nexus 4 4.2.1