[
https://issues.apache.org/jira/browse/CB-11206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15317733#comment-15317733
]
ASF GitHub Bot commented on CB-11206:
-------------------------------------
GitHub user proverbface opened a pull request:
https://github.com/apache/cordova-plugin-contacts/pull/128
Resolved crash in Samsung S6 and S7. See CB-11206.
### Platforms affected
Android
### What does this PR do?
Fixes crash on Samsung S6, S7 possible on other Samsung models. See [JIRA
issue here](https://issues.apache.org/jira/browse/CB-11206)
### What testing has been done on this change?
Samsung S5, S6, S7, Nexus 5, 9, Samsung GT-S630T, Vodafone VF695 and at
least 5 other relevant emulators.
We are looking forward to this pull request being merged back to develop.
It's working pretty well on a couple of apps where we use this Cordova plugin.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/proverbface/cordova-plugin-contacts
CB-11206cordova-plugin-contacts
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-contacts/pull/128.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #128
----
commit 324385a92568f4e3bd5fce5f5982742560bac7c3
Author: Juan Pablo Proverbio <[email protected]>
Date: 2016-06-07T03:01:10Z
Resolved crash in Samsung S6 and S7. See CB-11206.
----
> Contacts plugin causes app crash
> --------------------------------
>
> Key: CB-11206
> URL: https://issues.apache.org/jira/browse/CB-11206
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Contacts
> Reporter: Petr Odut
>
> On Samsung phone app crashes instantly with a stack trace:
> {noformat}
> java.lang.NumberFormatException
> java.lang.Integer.invalidInt(Integer.java:138)
> java.lang.Integer.parseInt(Integer.java:358)
> java.lang.Integer.parseInt(Integer.java:334)
> org.apache.cordova.contacts.ContactAccessorSdk5.imQuery(ContactAccessorSdk5.java:907)
> org.apache.cordova.contacts.ContactAccessorSdk5.populateContactArray(ContactAccessorSdk5.java:435)
> org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:282)
> org.apache.cordova.contacts.ContactManager$3.run(ContactManager.java:209)
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> java.lang.Thread.run(Thread.java:818)
> {noformat}
> JS code to retrieve contacts, on Sony phone the same code works properly:
> {code:javascript}
> if(navigator.contacts) {
> var options = new ContactFindOptions();
> options.multiple = true;
> options.hasPhoneNumber = true;
> navigator.contacts.find([navigator.contacts.fieldType.phoneNumbers],
> contacts => {
> this.phoneContacts = contacts;
> d.resolve(contacts);
> }, e => d.reject(e), options);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]