Bug 1176682 - Checks for empty Intent as result of camera activity in onActivityResult. r=snorp
authorDylan Roeh <droeh@mozilla.com>
Tue, 07 Jul 2015 16:56:38 -0500
changeset 251873 f6fed0c761ab5d409b20ee0f9f8dce3a0a58e878
parent 251872 e29408a1923da4eb0a1df236a643906414732180
child 251874 64d240b53e52a6939a8521537dee7ab01fd2f855
push id29015
push userryanvm@gmail.com
push dateWed, 08 Jul 2015 18:21:41 +0000
treeherdermozilla-central@2469f45c4770 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1176682
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1176682 - Checks for empty Intent as result of camera activity in onActivityResult. r=snorp
mobile/android/base/FilePickerResultHandler.java
--- a/mobile/android/base/FilePickerResultHandler.java
+++ b/mobile/android/base/FilePickerResultHandler.java
@@ -60,17 +60,18 @@ class FilePickerResultHandler implements
     @Override
     public void onActivityResult(int resultCode, Intent intent) {
         if (resultCode != Activity.RESULT_OK) {
             sendResult("");
             return;
         }
 
         // Camera results won't return an Intent. Use the file name we passed to the original intent.
-        if (intent == null) {
+        // In Android M, camera results return an empty Intent rather than null.
+        if (intent == null || (intent.getAction() == null && intent.getData() == null)) {
             if (mImageName != null) {
                 File file = new File(Environment.getExternalStorageDirectory(), mImageName);
                 sendResult(file.getAbsolutePath());
             } else {
                 sendResult("");
             }
             return;
         }