Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5f3264f authored by Peter Nilsson's avatar Peter Nilsson Committed by Gerrit Code Review
Browse files

Email force close when pressing back key after selecting characters

Email and Browser will be forced closed after selecting a text
and then press the back key, tilting the screen or trying to
share or copy the text. This is because a previouse fix
is using a part of the code that Google has removed.
Fix: clearSelection will now use its own EventHub id,
CLEAR_SELECT_TEXT.

This part describes the previous fix.
Marking a text on the web page and then press copy works,
but trying to mark the same text again does not work.
The reason for this is that the selection never gets
cleared in webkit.
The fix, calling cleaSelection in the onDestroyActionMode.
Also added clearSelection when getting an
onConfigurationChange.

FIX=DMS01503793

Change-Id: I5e5673bac4efb3d28e9fc613da4bf636f8ab3c39
parent 9975780f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4449,7 +4449,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
    public void clearSelection() {
        selectionDone();
        if (mWebViewCore != null) {
            mWebViewCore.sendMessage(EventHub.SELECT_TEXT, null);
            mWebViewCore.sendMessage(EventHub.CLEAR_SELECT_TEXT);
        }
    }

+9 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 * Copyright (C) 2012-2013 Sony Mobile Communications AB.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -12,6 +13,9 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * NOTE: This file has been modified by Sony Mobile Communications AB.
 * Modifications are licensed under the License.
 */

package android.webkit;
@@ -1172,6 +1176,7 @@ public final class WebViewCore {
        static final int SELECT_TEXT = 213;
        static final int SELECT_WORD_AT = 214;
        static final int SELECT_ALL = 215;
        static final int CLEAR_SELECT_TEXT = 216;

        // for updating state on trust storage change
        static final int TRUST_STORAGE_UPDATED = 220;
@@ -1694,6 +1699,10 @@ public final class WebViewCore {
                        case INSERT_TEXT:
                            nativeInsertText(mNativeClass, (String) msg.obj);
                            break;
                        case CLEAR_SELECT_TEXT: {
                            nativeClearTextSelection(mNativeClass);
                            break;
                        }
                        case SELECT_TEXT: {
                            int handleId = (Integer) msg.obj;
                            nativeSelectText(mNativeClass, handleId,