Closed Bug 770928 Opened 9 years ago Closed 9 years ago

Unable to invoke the text-interaction bar (ActionMode) on a URL in Android 4.1


(Firefox for Android Graveyard :: General, defect)

Not set


(firefox14 affected, firefox15+ verified, firefox16+ verified, firefox17 verified, firefox18 verified, fennec15+)

Firefox 17
Tracking Status
firefox14 --- affected
firefox15 + verified
firefox16 + verified
firefox17 --- verified
firefox18 --- verified
fennec 15+ ---


(Reporter: aaronmt, Assigned: sriram)



(Keywords: regression, relnote, Whiteboard: [jellybean][parity-stock][parity-chrome])


(1 file, 1 obsolete file)

Long-tap and hold on the current URL. 

ER: ICS/Jellybean text-interaction bar - (context-menu, 2.2/2.3)
AR: Nothing

Bring back the text-interaction bar.

Samsung Galaxy Nexus (Android 4.1)
Nightly (07/04)
My mistake, looks like we have a 4.1 issue here.
Summary: Unable to invoke the Android ICS/Jellybean text-interaction bar → Unable to invoke the text-interaction bar on a URL in Android 4.1
Whiteboard: [jellybean]
Summary: Unable to invoke the text-interaction bar on a URL in Android 4.1 → Unable to invoke the text-interaction bar (ActionMode) on a URL in Android 4.1
Sriram, do we need startActionMode?
This will be a pain-point for a functional loss and negative review for JB users.
Keywords: regression
Actual STR:
1. Tap on the URL bar
2. Long tap on the "editable" url.
We currently don't use ActionBar in AwesomeBar. It's hidden in AwesomeBar.
  When we long press, android brings up the text-interaction bar -- even when we make the ActionBar visibility to be "gone".

In JB:
  When we long press, android doesn't bring up the text-interaction bar -- as the visibility of the ActionBar is "gone".

Now, we can override the long press on the editable text to show the action-bar.
But, we won't know when the user is done with the options android gives, as we don't own the ActionMode.Callback to monitor the change of ActionBar. So, we cannot close it.
tracking-fennec: ? → 16+
tracking for 15 just because we'll want to make an explicit call about uplifting when we have a patch to evaluate
tracking-fennec: 16+ → 15+
Nexus S users just got 4.1.1 [1], just got it on my phone. Confirming same issue on my Nexus S.

Whiteboard: [jellybean] → [jellybean][parity-stock][parity-chrome]
Duplicate of this bug: 760160
Carrying forward tracking from bug 760160 so we can keep this on our radar.
Attached patch Patch (obsolete) — Splinter Review
This patch finally fixes it.
Basic problems:
 JB is strict with ActionBar! If we specify the visibility as "gone", it won't show text interaction.
 We don't own the ActionMode when it is shown, and hence we cannot hide it when text-editing is done.

 On long press, show the action-bar. Android takes care of the action-mode there.
 When we know the text has changed -- possibly by cut/paste,
 or when the selection has changed -- by dismissing the selected text -- possibly by copy/done/tapping on EditText
 hide the actionbar.
Attachment #646375 - Flags: review?(mbrubeck)
Attached patch PatchSplinter Review
This fixes one other bug.
Attachment #646375 - Attachment is obsolete: true
Attachment #646375 - Flags: review?(mbrubeck)
Attachment #646386 - Flags: review?(mbrubeck)
Comment on attachment 646375 [details] [diff] [review]

Review of attachment 646375 [details] [diff] [review]:

::: mobile/android/base/
@@ +217,5 @@
> +            @Override
> +            public boolean onLongClick(View v) {
> +                if (Build.VERSION.SDK_INT >= 11 && ((CustomEditText) v).getText().length() > 0) {
> +                    getActionBar().show();
> +                    return false;

Should we "return true" here?

::: mobile/android/base/
@@ +26,5 @@
>      public void setOnKeyPreImeListener(OnKeyPreImeListener listener) {
>          mOnKeyPreImeListener = listener;
>      }
> +    OnSelectionChangedListener mOnSelectionChangedListener;

Minor nit: Please move all the new code below the onKeyPreIme() method (so all the onKeyPreImeListener code remains together).
Attachment #646375 - Attachment is obsolete: false
Attachment #646375 - Attachment is obsolete: true
Attachment #646386 - Flags: review?(mbrubeck) → review+
QA Note:

Look for no functional loss on all other supported Android versions.

There are 11+ checks everywhere. So it won't affect.
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
Depends on: 778438
This broke Honeycomb in bug 778438.
please nominate for uplift if this is low-risk enough to consider. i've also tracked bug 778438 so we can ensure we take the honeycomb breakage fix at the same time.
Uplift! Go-go-go
Comment on attachment 646386 [details] [diff] [review]

[Approval Request Comment]
Bug caused by (feature/regressing bug #): -
User impact if declined: Users cannot cut-copy-paste on awesomescreen.
Testing completed (on m-c, etc.): Landed in m-c on 07/27
Risk to taking this patch (and alternatives if risky): Bug 760160.
String or UUID changes made by this patch: None.
Attachment #646386 - Flags: approval-mozilla-beta?
Attachment #646386 - Flags: approval-mozilla-aurora?
Comment on attachment 646386 [details] [diff] [review]

Not sure why the possible fallout from this bug is linking to a bug that is resolved as duplicate of _this_ bug, but I assume that means any fallout from this patch will be tracking in this bug.
Attachment #646386 - Flags: approval-mozilla-beta?
Attachment #646386 - Flags: approval-mozilla-beta+
Attachment #646386 - Flags: approval-mozilla-aurora?
Attachment #646386 - Flags: approval-mozilla-aurora+
Indeed, it's fixed on all branches.

Device: Galaxy Note
OS: Android 4.1.1
I need 3 long taps before I finally get the text-interaction bar to appear for the url bar. That seems very excessive, so I filed bug 797565 for it.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.