Bug 821777 - Get some kind of version information into nsPluginTag for Flash on Android r=josh
authorJames Willcox <jwillcox@mozilla.com>
Mon, 17 Dec 2012 10:05:53 -0500
changeset 121861 9ed12964d4247de60d3480313cecc56e1e02d569
parent 121860 cd18d8b548dd0be23f9afb71be76bcc64914dab3
child 121862 f773ab3d5146735d64512ef2780f226deff886ca
push idunknown
push userunknown
push dateunknown
reviewersjosh
bugs821777
milestone20.0a1
Bug 821777 - Get some kind of version information into nsPluginTag for Flash on Android r=josh
dom/plugins/base/nsPluginHost.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2776,20 +2776,28 @@ nsPluginHost::ReadPluginInfo()
       return rv;
 
     // If this is an old plugin registry mark this plugin tag to be refreshed
     int64_t lastmod = (vdiff == 0) ? nsCRT::atoll(values[0]) : -1;
     uint32_t tagflag = atoi(values[2]);
     if (!reader.NextLine())
       return rv;
 
-    const char *description = reader.LinePtr();
+    char *description = reader.LinePtr();
     if (!reader.NextLine())
       return rv;
 
+#if MOZ_WIDGET_ANDROID
+    // Flash on Android does not populate the version field, but it is tacked on to the description.
+    // For example, "Shockwave Flash 11.1 r115"
+    if (PL_strncmp("Shockwave Flash ", description, 16) == 0 && description[16]) {
+      version = &description[16];
+    }
+#endif
+
     const char *name = reader.LinePtr();
     if (!reader.NextLine())
       return rv;
 
     int mimetypecount = atoi(reader.LinePtr());
 
     char *stackalloced[PLUGIN_REG_MIMETYPES_ARRAY_SIZE * 3];
     char **mimetypes;