Bug 1299054 - Remove old Android support (API level < 15) from Gecko. r=snorp
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 30 Aug 2016 14:11:55 +0900
changeset 312000 857e992176537a37d336cd819964109f2d615d20
parent 311999 56cc74607c72f390645dd048fe874e437bc5e4e5
child 312001 ece74cf8b9f599a9d465fc29193e7dacfe897739
push id20424
push userryanvm@gmail.com
push dateWed, 31 Aug 2016 13:53:28 +0000
treeherderfx-team@b38f935eb811 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1299054
milestone51.0a1
Bug 1299054 - Remove old Android support (API level < 15) from Gecko. r=snorp MozReview-Commit-ID: K32YSqGsLf9
dom/media/android/AndroidMediaPluginHost.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
gfx/gl/AndroidSurfaceTexture.cpp
layout/generic/nsPluginFrame.cpp
netwerk/base/Predictor.cpp
widget/android/GfxInfo.cpp
--- a/dom/media/android/AndroidMediaPluginHost.cpp
+++ b/dom/media/android/AndroidMediaPluginHost.cpp
@@ -171,20 +171,16 @@ static const char* GetOmxLibraryName()
 
   if (!IsOmxSupported())
     return nullptr;
 
 #if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
   if (version >= 17) {
     return "libomxpluginkk.so";
   }
-  else if (version < 14) {
-    // Below Honeycomb not supported
-    return nullptr;
-  }
 
   // Ice Cream Sandwich and Jellybean
   return "libomxplugin.so";
 
 #elif defined(ANDROID) && defined(MOZ_WIDGET_GONK)
   return "libomxplugin.so";
 #else
   return nullptr;
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -207,21 +207,16 @@ already_AddRefed<ImageContainer>
 nsPluginInstanceOwner::GetImageContainer()
 {
   if (!mInstance)
     return nullptr;
 
   RefPtr<ImageContainer> container;
 
 #if MOZ_WIDGET_ANDROID
-  // Right now we only draw with Gecko layers on Honeycomb and higher. See Paint()
-  // for what we do on other versions.
-  if (AndroidBridge::Bridge()->GetAPIVersion() < 11)
-    return nullptr;
-
   LayoutDeviceRect r = GetPluginRect();
 
   // NotifySize() causes Flash to do a bunch of stuff like ask for surfaces to render
   // into, set y-flip flags, etc, so we do this at the beginning.
   float resolution = mPluginFrame->PresContext()->PresShell()->GetCumulativeResolution();
   ScreenSize screenSize = (r * LayoutDeviceToScreenScale(resolution)).Size();
   mInstance->NotifySize(nsIntSize::Truncate(screenSize.width, screenSize.height));
 
--- a/gfx/gl/AndroidSurfaceTexture.cpp
+++ b/gfx/gl/AndroidSurfaceTexture.cpp
@@ -41,35 +41,25 @@ public:
     if (NS_IsMainThread()) {
       mCallback->Run();
       return;
     }
     NS_DispatchToMainThread(mCallback);
   }
 };
 
-static bool
-IsSTSupported()
-{
-  return AndroidBridge::Bridge()->GetAPIVersion() >= 14; /* ICS */
-}
-
 already_AddRefed<AndroidSurfaceTexture>
 AndroidSurfaceTexture::Create()
 {
   return Create(nullptr, 0);
 }
 
 already_AddRefed<AndroidSurfaceTexture>
 AndroidSurfaceTexture::Create(GLContext* aContext, GLuint aTexture)
 {
-  if (!IsSTSupported()) {
-    return nullptr;
-  }
-
   RefPtr<AndroidSurfaceTexture> st = new AndroidSurfaceTexture();
   if (!st->Init(aContext, aTexture)) {
     printf_stderr("Failed to initialize AndroidSurfaceTexture");
     st = nullptr;
   }
 
   return st.forget();
 }
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -1383,29 +1383,28 @@ LayerState
 nsPluginFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
                              LayerManager* aManager)
 {
   if (!mInstanceOwner)
     return LAYER_NONE;
 
 #ifdef MOZ_WIDGET_ANDROID
   // We always want a layer on Honeycomb and later
-  if (AndroidBridge::Bridge()->GetAPIVersion() >= 11)
-    return LAYER_ACTIVE;
-#endif
-
+  return LAYER_ACTIVE;
+#else
   if (mInstanceOwner->NeedsScrollImageLayer()) {
     return LAYER_ACTIVE;
   }
 
   if (!mInstanceOwner->UseAsyncRendering()) {
     return LAYER_NONE;
   }
 
   return LAYER_ACTIVE_FORCE;
+#endif
 }
 
 class PluginFrameDidCompositeObserver final : public ClientLayerManager::
   DidCompositeObserver
 {
 public:
   PluginFrameDidCompositeObserver(nsPluginInstanceOwner* aOwner, ClientLayerManager* aLayerManager)
     : mInstanceOwner(aOwner),
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -43,21 +43,16 @@
 #include "mozilla/net/NeckoCommon.h"
 #include "mozilla/net/NeckoParent.h"
 
 #include "LoadContextInfo.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "SerializedLoadContext.h"
 #include "mozilla/net/NeckoChild.h"
 
-#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
-#include "nsIPropertyBag2.h"
-static const int32_t ANDROID_23_VERSION = 10;
-#endif
-
 using namespace mozilla;
 
 namespace mozilla {
 namespace net {
 
 Predictor *Predictor::sSelf = nullptr;
 
 static LazyLogModule gPredictorLog("NetworkPredictor");
@@ -585,32 +580,16 @@ Predictor::Init()
 
   if (!NS_IsMainThread()) {
     MOZ_ASSERT(false, "Predictor::Init called off the main thread!");
     return NS_ERROR_UNEXPECTED;
   }
 
   nsresult rv = NS_OK;
 
-#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
-  // This is an ugly hack to disable the predictor on android < 2.3, as it
-  // doesn't play nicely with those android versions, at least on our infra.
-  // Causes timeouts in reftests. See bug 881804 comment 86.
-  nsCOMPtr<nsIPropertyBag2> infoService =
-    do_GetService("@mozilla.org/system-info;1");
-  if (infoService) {
-    int32_t androidVersion = -1;
-    rv = infoService->GetPropertyAsInt32(NS_LITERAL_STRING("version"),
-                                         &androidVersion);
-    if (NS_SUCCEEDED(rv) && (androidVersion < ANDROID_23_VERSION)) {
-      return NS_ERROR_NOT_AVAILABLE;
-    }
-  }
-#endif
-
   rv = InstallObserver();
   NS_ENSURE_SUCCESS(rv, rv);
 
   mLastStartupTime = mStartupTime = NOW_IN_SECONDS();
 
   if (!mDNSListener) {
     mDNSListener = new DNSListener();
   }
--- a/widget/android/GfxInfo.cpp
+++ b/widget/android/GfxInfo.cpp
@@ -457,94 +457,17 @@ GfxInfo::GetFeatureStatusImpl(int32_t aF
           cHardware.EqualsLiteral("ventana") ||
           cHardware.EqualsLiteral("rk30board"))
       {
         *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
         aFailureId = "FEATURE_FAILURE_STAGE_HW";
         return NS_OK;
       }
 
-      if (CompareVersions(mOSVersion.get(), "2.2.0") >= 0 &&
-          CompareVersions(mOSVersion.get(), "2.3.0") < 0)
-      {
-        // Froyo LG devices are whitelisted.
-        // All other Froyo
-        bool isWhitelisted =
-          cManufacturer.Equals("lge", nsCaseInsensitiveCStringComparator());
-
-        if (!isWhitelisted) {
-          *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
-          aFailureId = "FEATURE_FAILURE_OLD_ANDROID";
-          return NS_OK;
-        }
-      }
-      else if (CompareVersions(mOSVersion.get(), "2.3.0") >= 0 &&
-          CompareVersions(mOSVersion.get(), "2.4.0") < 0)
-      {
-        // Gingerbread HTC devices are whitelisted.
-        // Gingerbread Samsung devices are whitelisted except for:
-        //   Samsung devices identified in Bug 847837
-        // Gingerbread Sony devices are whitelisted.
-        // All other Gingerbread devices are blacklisted.
-        bool isWhitelisted =
-          cManufacturer.Equals("htc", nsCaseInsensitiveCStringComparator()) ||
-          (cManufacturer.Find("sony", true) != -1) ||
-          cManufacturer.Equals("samsung", nsCaseInsensitiveCStringComparator());
-
-        if (cModel.Equals("GT-I8160", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-I8160L", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-I8530", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-I9070", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-I9070P", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-I8160P", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-S7500", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-S7500T", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-S7500L", nsCaseInsensitiveCStringComparator()) ||
-            cModel.Equals("GT-S6500T", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("smdkc110", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("smdkc210", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("herring", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("shw-m110s", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("shw-m180s", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("n1", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("latona", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("aalto", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("atlas", nsCaseInsensitiveCStringComparator()) ||
-            cHardware.Equals("qcom", nsCaseInsensitiveCStringComparator()))
-        {
-          isWhitelisted = false;
-        }
-
-        if (!isWhitelisted) {
-          *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
-          aFailureId = "FEATURE_FAILURE_OLD_ANDROID_2";
-          return NS_OK;
-        }
-      }
-      else if (CompareVersions(mOSVersion.get(), "3.0.0") >= 0 &&
-          CompareVersions(mOSVersion.get(), "4.0.0") < 0)
-      {
-        // Honeycomb Samsung devices are whitelisted.
-        // All other Honeycomb devices are blacklisted.
-        bool isWhitelisted =
-          cManufacturer.Equals("samsung", nsCaseInsensitiveCStringComparator());
-
-        if (!isWhitelisted) {
-          *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
-          aFailureId = "FEATURE_FAILURE_SAMSUNG";
-          return NS_OK;
-        }
-      }
-      else if (CompareVersions(mOSVersion.get(), "4.0.0") < 0)
-      {
-        *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
-        aFailureId = "FEATURE_FAILURE_OLD_ANDROID_4";
-        return NS_OK;
-      }
-      else if (CompareVersions(mOSVersion.get(), "4.1.0") < 0)
+      if (CompareVersions(mOSVersion.get(), "4.1.0") < 0)
       {
         // Whitelist:
         //   All Samsung ICS devices, except for:
         //     Samsung SGH-I717 (Bug 845729)
         //     Samsung SGH-I727 (Bug 845729)
         //     Samsung SGH-I757 (Bug 845729)
         //   All Galaxy nexus ICS devices
         //   Sony Xperia Ion (LT28) ICS devices