You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by adamduren <gi...@git.apache.org> on 2016/02/07 20:36:15 UTC

[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

GitHub user adamduren opened a pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51

    [CB-10554] Fix null reference in low memory conditions

    [Related Jira](https://issues.apache.org/jira/browse/CB-10554)
    State is lost when the activity is not kept as a result of low memory conditions. This causes a NullPointerException in multiple places. Save the state and restore it on resume.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/adamduren/cordova-plugin-media-capture patch-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-media-capture/pull/51.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 #51
    
----
commit 7bbec803d8aa5585a7ce2a651c34c2d5db55ba09
Author: Adam Duren <ad...@gmail.com>
Date:   2016-02-07T19:20:35Z

    Fix null reference in low memory conditions
    
    State is lost when the activity is not kept as a result of low memory conditions. This causes a NullPointerException in multiple places. Save the state and restore it on resume.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by adamduren <gi...@git.apache.org>.
Github user adamduren commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-188962549
  
    @stevengill What additional steps do I need to take to get this resolved?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-197525596
  
    Testing this now


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-192078564
  
    @adamduren any word on the README update? It just needs to be a short blurb pointing to the [Android lifecycle guide](http://cordova.apache.org/docs/en/latest/guide/platforms/android/lifecycle.html) really. Looking at the javascript code for this plugin, I don't really think there is any need for anything else. We just need to list the quirk and point to the documentation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-197549101
  
    @adamduren  I've tested this and the save/restore stuff appears to work great! There is an issue, however, with the results that are returned in the resume event. They need to be wrapped in `MediaFile` objects before use. This was also an issue in the Contacts plugin where they needed to be wrapped in a `Contact` object and the solution was to just provide an example of how to do that in the README (see [here](https://github.com/apache/cordova-plugin-contacts#android-quirks)). In this plugin it is a little bit trickier because we need to decide how to expose the `MediaFile` object creation. Currently, it just happens in the `exec` callback [here](https://github.com/apache/cordova-plugin-media-capture/blob/0867898701c9f547dddd8448bfc0f46d6ae14008/www/capture.js#L34) without a public API. Thoughts? Maybe we should add a `MediaFile` constructor that encapsulates that `exec` callback? That at least would not be a breaking change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-189025565
  
    Thanks for doing this! LGTM, I just need to test it. Can you add a note to the README about this quirk? Something like https://github.com/apache/cordova-plugin-camera#android-quirks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-189000686
  
    @riknoll to review


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by riknoll <gi...@git.apache.org>.
Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#discussion_r56393172
  
    --- Diff: README.md ---
    @@ -175,6 +175,14 @@ code.
     ### Android Quirks
     
     - The `duration` parameter is not supported.  Recording lengths can't be limited programmatically.
    +- Android uses intents to launch the camera activity on the device to capture
    +images, and on phones with low memory, the Cordova activity may be killed.  In this
    +scenario, the result from the plugin call will be delivered via the resume event.
    +See [the Android Lifecycle guide][android_lifecycle]
    --- End diff --
    
    This is a reference style markdown link and I think you missed copying over the actual link definition at the bottom of the README. Should point to http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#lifecycle-guide


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by adamduren <gi...@git.apache.org>.
Github user adamduren commented on the pull request:

    https://github.com/apache/cordova-plugin-media-capture/pull/51#issuecomment-193344477
  
    @riknoll Sorry for the delay. I pulled the note from the cordova camera plugin. They should be the same. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media-capture pull request: [CB-10554] Fix null ref...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-media-capture/pull/51


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org