Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10857

Camera.getPicture return null for Google Drive (camera 2.1.1)

    XMLWordPrintableJSON

Details

    Description

      Camera.getPicture returns null for pictures and other files when using Google Drive in version 2.1.1. Other sources in the generic file picker such as Images, Photos and Astro File Manager works.

      The camera plugin gets a null value in processResultFromGallery
      03-14 10:21:00.066: D/CameraLauncher(21662): File locaton is: null

      The return value from the file picker is
      content://com.google.android.apps.docs.storage/document/acc%3D1%3Bdoc%3D3000 (see android log below)

      Code sample:

              navigator.camera.getPicture(onPhotoURISuccess, onFail, {
                  quality: 50,
                  correctOrientation: true,
                  destinationType: destinationType.FILE_URI,
                  sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                  mediaType: Camera.MediaType.ALLMEDIA,
      
              });
      

      Android log:

      03-14 10:48:31.969: I/ActivityManager(914): Displayed com.android.documentsui/.DocumentsActivity: +146ms (total +172ms)
      03-14 10:48:31.974: D/Documents(19828): userMode=0, userSortOrder=0 --> mode=2, sortOrder=2
      03-14 10:48:40.310: D/Documents(19828): userMode=0, userSortOrder=0 --> mode=1, sortOrder=1
      03-14 10:48:44.279: D/NetlinkSocketObserver(914): NeighborEvent{elapsedMs=447463541, 10.4.67.1, [FEA087606419], RTM_NEWNEIGH, NUD_STALE}
      03-14 10:48:45.778: D/Documents(19828): userMode=0, userSortOrder=0 --> mode=1, sortOrder=1
      03-14 10:48:46.192: D/ConnectivityService(914): updateNetworkScore for NetworkAgentInfo [WIFI () - 148] to 55
      03-14 10:48:48.832: I/Atfwd_Sendcmd(1677): AtCmdFwd service not ready - Exhausted retry attempts - :6
      03-14 10:48:48.833: I/Atfwd_Daemon(1677): result : -1 	 ,Init step :2 	 ,qmiErrorCode: 0
      03-14 10:48:49.211: D/ConnectivityService(914): updateNetworkScore for NetworkAgentInfo [WIFI () - 148] to 56
      03-14 10:48:49.243: D/Documents(19828): userMode=0, userSortOrder=0 --> mode=1, sortOrder=1
      03-14 10:48:52.028: D/Documents(19828): onFinished() [content://com.google.android.apps.docs.storage/document/acc%3D1%3Bdoc%3D3000]
      03-14 10:48:52.049: D/CordovaInterfaceImpl(2469): Sending activity result to plugin
      03-14 10:48:52.051: D/CameraLauncher(2469): File locaton is: null
      03-14 10:48:52.056: I/chromium(2469): [INFO:CONSOLE(39)] "onPhotoURISuccess: null", source: file:///android_asset/www/neptune/public/application/z_cats_login_bouvet/js/loglevel-persistlogstrings.js (39)
      

      Related to https://issues.apache.org/jira/browse/CB-10270

      PS Updated android log

      Attachments

        1. Filepicker_google_drive.png
          132 kB
          Dagfinn Parnas

        Issue Links

          Activity

            People

              bowserj Joey Robert Bowser
              dparnas Dagfinn Parnas
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m