New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 655081 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
inactive
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Crash in NOS Drag & Drop Feature

Reported by lge-systemwebview@lge.com, Oct 12 2016

Issue description

This report will ONLY be viewable by Google.

Device name: LG 
Android version:7.0
Fingerprint:
WebView version: 54.0.2840.50(Chrome Beta)
Application:
Application version:

URLs (if applicable):


Steps to reproduce:
1) Open Webview Editor Application
2) Dual window
3) Open Gallery/File manager in another window
4) Drag and drop any image/file to composer

Expected result:
File attachment

Actual result:
Crash

Issue is not observed in 53.0.2785.124(stable Chrome)
 
Crash log:

10-12 10:05:39.999 13582-13582/com.lge.email E/AndroidRuntime: FATAL EXCEPTION: main
                                                               Process: com.lge.email, PID: 13582
                                                               java.lang.NullPointerException: Attempt to get length of null array
                                                                   at org.chromium.content.browser.ContentViewCore.onDragEvent(ContentViewCore.java:3173)
                                                                   at org.chromium.android_webview.AwContents$AwViewMethodsImpl.onDragEvent(AwContents.java:3052)
                                                                   at com.android.webview.chromium.WebViewChromium.onDragEvent(WebViewChromium.java:33929)
                                                                   at android.webkit.WebView.onDragEvent(WebView.java:2554)
                                                                   at android.view.View.dispatchDragEvent(View.java:20923)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1397)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewGroup.notifyChildOfDragStart(ViewGroup.java:1592)
                                                                   at android.view.ViewGroup.dispatchDragEvent(ViewGroup.java:1390)
                                                                   at android.view.ViewRootImpl.handleDragEvent(ViewRootImpl.java:5746)
                                                                   at android.view.ViewRootImpl.-wrap8(ViewRootImpl.java)
                                                                   at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3747)
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                   at android.os.Looper.loop(Looper.java:154)
                                                                   at android.app.ActivityThread.main(ActivityThread.java:6248)
                                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Comment 2 by torne@chromium.org, Oct 12 2016

Labels: -Restrict-View-Google -Pri-3 M-54 Pri-2
Owner: hush@chromium.org
Status: Assigned (was: Unconfirmed)
Please file bugs publicly when possible, not privately - there doesn't appear to be any confidential information here.
ChromeDragDrop.mp4
8.3 MB View Download

Comment 4 by hush@chromium.org, Oct 12 2016

        String[] mimeTypes =
                clipDescription == null ? new String[0] : clipDescription.filterMimeTypes("text/*");

Mimetypes array is somehow null?
Let me see if that's possible.

Comment 5 by hush@chromium.org, Oct 12 2016

Labels: ReleaseBlock-Stable
Sorry yeah. My mistake. It is possible to be null.
    public String[] filterMimeTypes(String mimeType) {
        ArrayList<String> array = null;
        for (int i=0; i<mMimeTypes.length; i++) {
            if (compareMimeTypes(mMimeTypes[i], mimeType)) {
                if (array == null) {
                    array = new ArrayList<String>();
                }
                array.add(mMimeTypes[i]);
            }
        }
        if (array == null) {
            return null;
        }
        String[] rawArray = new String[array.size()];
        array.toArray(rawArray);
        return rawArray;
    }

Comment 6 by hush@chromium.org, Oct 12 2016

Cc: amineer@chromium.org

Comment 7 by hush@chromium.org, Oct 12 2016

lge-systemwebview@lge.com:
Chrome and webview only support text drag and drop at the moment.
At least I will try to make it not crash.
But your image won't be dragged from the gallery to the email, unfortunately, unless your email app handles the drag and drop of images by itself (which is done by Gmail by the way)
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 12 2016

Labels: merge-merged-2840
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/decf96b192fe59f678af8725939c32a314b80d60

commit decf96b192fe59f678af8725939c32a314b80d60
Author: Alex Mineer <amineer@chromium.org>
Date: Wed Oct 12 16:20:22 2016

Fix a crash where the dragged content does not contain any text.

Landing directly on branch for a quick respin

R=hush
BUG= 655081 

Review URL: https://codereview.chromium.org/2416613002 .

Cr-Commit-Position: refs/branch-heads/2840@{#733}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/decf96b192fe59f678af8725939c32a314b80d60/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4bc70d726ec085234f888dd1342dad0108025472

commit 4bc70d726ec085234f888dd1342dad0108025472
Author: hush <hush@chromium.org>
Date: Wed Oct 12 17:04:52 2016

Fix a crash where the dragged content does not contain any text.

The filtered mimetypes array could be null instead of an empty array. We need to
check for that.

BUG= 655081 

Review-Url: https://codereview.chromium.org/2413743002
Cr-Commit-Position: refs/heads/master@{#424767}

[modify] https://crrev.com/4bc70d726ec085234f888dd1342dad0108025472/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Comment 11 by hush@chromium.org, Oct 12 2016

Labels: M-55 Merge-Request-55
request merge to m55

Comment 12 by aluo@chromium.org, Oct 12 2016

Verified on Pixel Xl on 54.0.2840.61 build using downloads app.

Comment 13 by dimu@chromium.org, Oct 12 2016

Labels: -Merge-Request-55 Merge-Approved-55 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M55 (branch: 2883)
Project Member

Comment 14 by bugdroid1@chromium.org, Oct 12 2016

Labels: -merge-approved-55 merge-merged-2883
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37de6df964e163323f8461ee3fd3e9209c461038

commit 37de6df964e163323f8461ee3fd3e9209c461038
Author: Hui Shu <hush@google.com>
Date: Wed Oct 12 21:19:32 2016

Fix a crash where the dragged content does not contain any text.

The filtered mimetypes array could be null instead of an empty array. We need to
check for that.

BUG= 655081 

Review-Url: https://codereview.chromium.org/2413743002
Cr-Commit-Position: refs/heads/master@{#424767}
(cherry picked from commit 4bc70d726ec085234f888dd1342dad0108025472)

Review URL: https://codereview.chromium.org/2415713002 .

Cr-Commit-Position: refs/branch-heads/2883@{#75}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/37de6df964e163323f8461ee3fd3e9209c461038/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Comment 15 by hush@chromium.org, Oct 12 2016

Status: Fixed (was: Assigned)
Thanks for reporting lge-systemwebview@lge.com. This is fixed.
Project Member

Comment 16 by bugdroid1@chromium.org, Oct 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1e780b7035ad3b12d8536659f535492143ca5a6

commit c1e780b7035ad3b12d8536659f535492143ca5a6
Author: Alex Mineer <amineer@chromium.org>
Date: Wed Oct 12 23:36:51 2016

Fix a crash where the dragged content does not contain any text.

Landing directly on branch for a quick respin

R=hush
BUG= 655081 

Review URL: https://codereview.chromium.org/2416613002 .

Committed: https://chromium.googlesource.com/chromium/src/+/decf96b192fe59f678af8725939c32a314b80d60
Cr-Commit-Position: refs/branch-heads/2840@{#735}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/c1e780b7035ad3b12d8536659f535492143ca5a6/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java

Comment 17 by hush@chromium.org, Oct 13 2016

Hi Alex, I'm confused. 
PhysicalWebDiagnosticsPage.java is somehow changed??
But https://codereview.chromium.org/2416613002 shows the correct diff
I screwed up and didn't git pull before cherry-picking another change for the release branch, and it used the old commit message for the cherry-pick :(

Sorry for the confusion.
Verified on Nexus6 NMF11B Web view 55.0.2883.18 build.

Comment 20 by aluo@chromium.org, Oct 19 2016

Verified on Nexus 5x, NRD91N, 54.0.2840.68
Project Member

Comment 21 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/37de6df964e163323f8461ee3fd3e9209c461038

commit 37de6df964e163323f8461ee3fd3e9209c461038
Author: Hui Shu <hush@google.com>
Date: Wed Oct 12 21:19:32 2016

Fix a crash where the dragged content does not contain any text.

The filtered mimetypes array could be null instead of an empty array. We need to
check for that.

BUG= 655081 

Review-Url: https://codereview.chromium.org/2413743002
Cr-Commit-Position: refs/heads/master@{#424767}
(cherry picked from commit 4bc70d726ec085234f888dd1342dad0108025472)

Review URL: https://codereview.chromium.org/2415713002 .

Cr-Commit-Position: refs/branch-heads/2883@{#75}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/37de6df964e163323f8461ee3fd3e9209c461038/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Project Member

Comment 22 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/decf96b192fe59f678af8725939c32a314b80d60

commit decf96b192fe59f678af8725939c32a314b80d60
Author: Alex Mineer <amineer@chromium.org>
Date: Wed Oct 12 16:20:22 2016

Fix a crash where the dragged content does not contain any text.

Landing directly on branch for a quick respin

R=hush
BUG= 655081 

Review URL: https://codereview.chromium.org/2416613002 .

Cr-Commit-Position: refs/branch-heads/2840@{#733}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/decf96b192fe59f678af8725939c32a314b80d60/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Project Member

Comment 23 by bugdroid1@chromium.org, Oct 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1e780b7035ad3b12d8536659f535492143ca5a6

commit c1e780b7035ad3b12d8536659f535492143ca5a6
Author: Alex Mineer <amineer@chromium.org>
Date: Wed Oct 12 23:36:51 2016

Fix a crash where the dragged content does not contain any text.

Landing directly on branch for a quick respin

R=hush
BUG= 655081 

Review URL: https://codereview.chromium.org/2416613002 .

Committed: https://chromium.googlesource.com/chromium/src/+/decf96b192fe59f678af8725939c32a314b80d60
Cr-Commit-Position: refs/branch-heads/2840@{#735}
Cr-Branched-From: 1ae106dbab4bddd85132d5b75c670794311f4c57-refs/heads/master@{#414607}

[modify] https://crrev.com/c1e780b7035ad3b12d8536659f535492143ca5a6/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebDiagnosticsPage.java

Sign in to add a comment