cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rpanadero opened a new pull request #298: Fixed FileProvider NullPointerException and pictures edition by Google+
Date Thu, 01 Jan 1970 00:00:00 GMT
rpanadero opened a new pull request #298: Fixed FileProvider NullPointerException and pictures
edition by Google+
URL: https://github.com/apache/cordova-plugin-camera/pull/298
 
 
   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist
   is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   Android 
   
   ### What does this PR do?
   This pull request fix two important issues on Android that it makes the plugin not work
properly. The issues are:
   
   -  FileProvider error related to a NULL reference that it happens taking a photo when the
cordova application was restarted by OS.
   If the OS restart the cordova application while you are taking a photo with the camera
application, the application will trigger an error when you press on "Accept"  because the
plugin variables were cleaned up (they are not initialized). The crash is related to {@see
android.support.v4.content.FileProvider} and it happens because the plugin invoke the 'getUriForFile'
method (FileProvider method) with a NULL authority (=applicationId).
   
   Stacktrace:
   java.lang.NullPointerException: Attempt to invoke virtual method ?android.content.res.XmlResourceParser
   android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)?
on a null object reference
   
   To reproduce this issue, move to background your application and open a lot of applications
while the camera application is still opened. When you press on "Accept" the plugin will triggers
the above error.
   
   - Error editing a photo with Google+
   We have detected an issue with Google+ editor on Android. If you edit a picture with Google+,
Google+ will always return the same image next times that you edit a new one. For that reason,
we have made the plugin to be capable to receive a blacklist list of application packages
that cannot edit a picture. These forbidden editors will not be shown when the user is prompted
for picture edition.
   
   The new config properties introduced for 'takePicture' method are:
   - forbiddenPicEditors. List of application packages.
   - editChooserTitle. Title that appears when the editor chooser appears on screen. By default,
its value is "Complete action using".
   
   Example of 'takePicture' config
   {
     destinationType: this.camera.DestinationType.FILE_URI,
     sourceType: this.camera.PictureSourceType.CAMERA,
     allowEdit: true,
     targetWidth: 1024,
     targetHeight: 1024,
     quality: 80,
     saveToPhotoAlbum: true,
     forbiddenPicEditors: ["com.google.android.apps.plus"]
   }
   
   We consider so interesting to add these changes to the master branch. In fact, we are using
our plugin fork right now because many issues related to this were reported.
   
   ### What testing has been done on this change?
   Tested in development and even on a application in production. So it is being used in a
real environment and no bugs related to this have been reported up to now.
   
   Ionic info:
   cli packages: 
       @ionic/cli-utils  : 1.12.0
       ionic (Ionic CLI) : 3.12.0
   global packages:
       cordova (Cordova CLI) : 7.1.0 
   local packages:
       @ionic/app-scripts : 2.1.4
       Cordova Platforms  : android 6.2.3
       Ionic Framework    : ionic-angular 3.6.1
   System:
       Android SDK Tools : 26.0.1
       ios-deploy        : 1.9.2 
       ios-sim           : 6.1.2 
       Node              : v8.8.1
       npm               : 5.5.1 
       OS                : macOS High Sierra
       Xcode             : Xcode 9.1 Build version 9B55 
   Misc:
       backend : legacy
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


Mime
View raw message