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

Commit 2da9338c authored by Gilles Debunne's avatar Gilles Debunne Committed by Android Git Automerger
Browse files

am d14230f1: Merge "Made paste work in ExtractEditText" into gingerbread

Merge commit 'd14230f1' into gingerbread-plus-aosp

* commit 'd14230f1':
  Made paste work in ExtractEditText
parents 748b413e d14230f1
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package android.inputmethodservice;

import android.content.Context;
import android.util.AttributeSet;
import android.view.ContextMenu;
import android.view.inputmethod.ExtractedText;
import android.widget.EditText;

@@ -29,7 +28,6 @@ import android.widget.EditText;
public class ExtractEditText extends EditText {
    private InputMethodService mIME;
    private int mSettingExtractedText;
    private boolean mContextMenuShouldBeHandledBySuper = false;
    
    public ExtractEditText(Context context) {
        super(context, null);
@@ -99,19 +97,13 @@ public class ExtractEditText extends EditText {
        return false;
    }
    
    @Override
    protected void onCreateContextMenu(ContextMenu menu) {
        super.onCreateContextMenu(menu);
        mContextMenuShouldBeHandledBySuper = true;
    }

    @Override public boolean onTextContextMenuItem(int id) {
        if (mIME != null && !mContextMenuShouldBeHandledBySuper) {
        // Horrible hack: select word option has to be handled by original view to work.
        if (mIME != null && id != android.R.id.startSelectingText) {
            if (mIME.onExtractTextContextMenuItem(id)) {
                return true;
            }
        }
        mContextMenuShouldBeHandledBySuper = false;
        return super.onTextContextMenuItem(id);
    }