Bug 31359 - [Android] Using Google Voice Recognition in SearchBar() deletes results in some devices when speaking multiple and/or long phrases
Summary: [Android] Using Google Voice Recognition in SearchBar() deletes results in so...
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-06-24 15:32 UTC by Kent Green [MSFT]
Modified: 2017-08-29 12:32 UTC (History)
2 users (show)

Tags: ac, searchbar, android
Is this bug a regression?: ---
Last known good build:

Sample to reproduce the error (21.01 KB, application/zip)
2015-06-24 15:32 UTC, Kent Green [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 31359 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Kent Green [MSFT] 2015-06-24 15:32:27 UTC
Created attachment 11731 [details]
Sample to reproduce the error

From this priority desk case:

On certain devices when using speech recognition; if multiple words are spoken to be entered into SearchBar(), the words will briefly appear and then be deleted.

Screencast: http://screencast.com/t/lhpvzHv4BLV

===Code Snippet===
> public App ()
> {
>	MainPage = new ContentPage {
>		Content = new StackLayout {
>			VerticalOptions = LayoutOptions.Center,
>				Children = {
>					new SearchBar (),
>				}
>			}
>		};
>	}
> }

===Steps to Reproduce===
1. Make sure Google Speech Recognition is enabled and accessible from the keyboard in the "Language & Input" settings.
2. Deploy the app.
3. Select the search bar.
4. Select the voice button (on most devices I tested, it's a key with a microphone icon, it may be hidden in a menu on the keyboard.)
5. Speak a simple, clear word like "Testing"
6. Clear the search bar, give a new complex phrase for the voice command, like "Xamarin cross-platform mobile development" or "Testing 123"

===Expected Behavior===
The expected behavior as seen in this test device:
> LG Volt running Android 4.4.2

The expected behavior is that when a simple or complex phrase is detected & parsed by the Google Speech Recognition into the SearchBar(), it should add the result to the search bar. This is what is seen in the LG Volt test device.

===Actual Behavior===
This is the actual behavior as seen in these test devices:
> Motorola Droid RAZR MAXX running Android 4.1.2
> Motorola Moto G running Android 4.4.2
(Note: The customer reported seeing the issue on non-Motorola devices as well; which I'm investigating further.)

The actual behavior is that while a simple word "Testing" is detected & parsed correctly; a complex phrase is detected, parsed & briefly appears; but is deleted. 

===Comparing SearchBar() with Entry()===
I did an additional comparison by substituting the SearchBar() for an Entry(); and noted that on the devices that showed the bug, Entry() followed the "Expected Behavior" while SearchBar() followed the "Actual Behavior" noted above.

===Build information===

=== Xamarin Studio ===

Version 5.9.3 (build 1)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: e6ebd18
Branch: master
Build date: 2015-05-21 21:55:09-0400

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

=== Operating System ===

Mac OS X 10.10.3
Darwin Kents-Macbook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

===Additional Info===
Including simple sample to reproduce the issue, though this is mostly for convenience since it seems to be reproducible simply by creating a SearchBar() on certain devices.
Comment 1 Kent Green [MSFT] 2015-06-24 17:20:11 UTC
I ran a test in a non-Forms app with the following:

> namespace NativeTest
> {
>	[Activity (Label = "NativeTest", MainLauncher = true, Icon = "@drawable/icon")]
>	public class MainActivity : Activity
>	{
>		protected override void OnCreate (Bundle bundle)
>		{
>			base.OnCreate (bundle);
>			var searchView = new SearchView (this);

>			// Set our view from the "main" layout resource
>			SetContentView (searchView);
>		}
>	}
> }

On all three of my test devices as noted in the description; I observed that this snippet natively produces the "Expected" behavior from the description, rather than the "Actual" i.e.:
> LG Volt running Android 4.4.2
> Motorola Moto G running Android 4.4.2
> Motorola Droid RAZR MAXX running Android 4.1.2

Additionally, I noticed that in the Forms version of the search bar, when the bug occurs, it seems to consistently occur whenever more than one word is spoken; as far as I can tell, this behavior seems to remain the same regardless of how clear each word is. 

One word will stay in place, more than one will flash in the autocomplete & then be deleted.
Comment 3 Jason Smith [MSFT] 2015-06-25 16:41:44 UTC
Bug caused by feedback loop in renderer -> element -> back to renderer unsetting the new data