From 4049be1abc65df0a830d33049e009a7cd0aa6c6b Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Thu, 8 Mar 2012 10:08:15 -0800 Subject: [PATCH] Bug 734156 - Part 1: Backout ineffective workaround d923ae85be05 (Reset IME selection when Fennec resumes). r=blassey --- mobile/android/base/GeckoApp.java | 4 ---- mobile/android/base/GeckoAppShell.java | 6 ------ mobile/android/base/GeckoInputConnection.java | 12 ------------ 3 files changed, 22 deletions(-) diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 94a40ff776ee..c59c1cb90a26 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -2072,10 +2072,6 @@ abstract public class GeckoApp mMainHandler.sendMessage(message); } - // An Android framework bug can cause an IME crash when focus changes invalidate text - // selection offsets. A workaround is to reset selection when the activity resumes. - GeckoAppShell.resetIMESelection(); - int newOrientation = getResources().getConfiguration().orientation; if (mOrientation != newOrientation) { diff --git a/mobile/android/base/GeckoAppShell.java b/mobile/android/base/GeckoAppShell.java index 530f4f6c70b8..08c92daf641f 100644 --- a/mobile/android/base/GeckoAppShell.java +++ b/mobile/android/base/GeckoAppShell.java @@ -621,12 +621,6 @@ public class GeckoAppShell mInputConnection.returnIMEQueryResult(result, selectionStart, selectionLength); } - public static void resetIMESelection() { - if (mInputConnection != null) { - mInputConnection.resetSelection(); - } - } - static void onXreExit() { // mLaunchState can only be Launched or GeckoRunning at this point GeckoApp.setLaunchState(GeckoApp.LaunchState.GeckoExiting); diff --git a/mobile/android/base/GeckoInputConnection.java b/mobile/android/base/GeckoInputConnection.java index 918a39d0bb77..66b4a99aca67 100644 --- a/mobile/android/base/GeckoInputConnection.java +++ b/mobile/android/base/GeckoInputConnection.java @@ -969,18 +969,6 @@ public class GeckoInputConnection mEditable.setSpan(this, 0, contents.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); Selection.setSelection(mEditable, contents.length()); } - - public void resetSelection() { - // An Android framework bug can cause a SpannableStringBuilder crash when focus changes - // invalidate text selection offsets. A workaround is to reset selection when the activity - // resumes. More info: https://code.google.com/p/android/issues/detail?id=5164 - Editable content = getEditable(); - if (content != null) { - Log.d(LOGTAG, "IME: resetSelection"); - int length = content.length(); - setSelection(length, length); - } - } } class DebugGeckoInputConnection extends GeckoInputConnection {