Bug 705026 - Don't use tablet layout with non-Honeycomb themes [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 28 Nov 2011 11:47:27 -0800
changeset 80888 d68a772d61a997da32749c3221a3d46c64b4ca5d
parent 80887 6d4ff40feb297353ef4300c20ea17bf65d359687
child 80889 014d6e732bd7be25bbf1f875ebd4f6fe9ad24420
push id3619
push usermbrubeck@mozilla.com
push dateMon, 28 Nov 2011 19:48:46 +0000
treeherdermozilla-inbound@d68a772d61a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs705026
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 705026 - Don't use tablet layout with non-Honeycomb themes [r=mfinkle]
mobile/xul/chrome/content/Util.js
--- a/mobile/xul/chrome/content/Util.js
+++ b/mobile/xul/chrome/content/Util.js
@@ -171,16 +171,28 @@ let Util = {
 
     // Act according to user prefs if tablet mode has been
     // explicitly disabled or enabled.
     if (tabletPref == 0)
       return this._isTablet = false;
     else if (tabletPref == 1)
       return this._isTablet = true;
 
+#ifdef ANDROID
+    // Disable tablet mode on non-honeycomb devices because of theme bugs (bug 705026)
+    let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
+    let shellVersion = sysInfo.get("shellVersion") || "";
+    let matches = shellVersion.match(/\((\d+)\)$/);
+    if (matches) {
+      let sdkVersion = parseInt(matches[1]);
+      if (sdkVersion < 11 || sdkVersion > 13)
+        return this._isTablet = false;
+    }
+#endif
+
     let dpi = this.displayDPI;
     if (dpi <= 96)
       return this._isTablet = (window.innerWidth > 1024);
 
     // See the tablet_panel_minwidth from mobile/themes/core/defines.inc
     let tablet_panel_minwidth = 124;
     let dpmm = 25.4 * window.innerWidth / dpi;
     return this._isTablet = (dpmm >= tablet_panel_minwidth);