OLD | NEW |
1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- | 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- |
2 * This Source Code Form is subject to the terms of the Mozilla Public | 2 * This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 package org.mozilla.gecko.util; | 6 package org.mozilla.gecko.util; |
7 | 7 |
8 import org.mozilla.gecko.SysInfo; | 8 import org.mozilla.gecko.SysInfo; |
9 | 9 |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 public static boolean isSmallTablet() { | 84 public static boolean isSmallTablet() { |
85 return sIsSmallTablet; | 85 return sIsSmallTablet; |
86 } | 86 } |
87 | 87 |
88 public static boolean isTelevision() { | 88 public static boolean isTelevision() { |
89 return sIsTelevision; | 89 return sIsTelevision; |
90 } | 90 } |
91 | 91 |
92 public static boolean hasMenuButton() { | 92 public static boolean hasMenuButton() { |
93 return sHasMenuButton; | 93 // Forcing behavior independently of the presence of a hardware menu but
ton |
| 94 // See https://issues.adblockplus.org/ticket/5005 |
| 95 return false; |
94 } | 96 } |
95 | 97 |
96 public static int getMemSize() { | 98 public static int getMemSize() { |
97 return SysInfo.getMemSize(); | 99 return SysInfo.getMemSize(); |
98 } | 100 } |
99 | 101 |
100 public static boolean isLowMemoryPlatform() { | 102 public static boolean isLowMemoryPlatform() { |
101 final int memSize = getMemSize(); | 103 final int memSize = getMemSize(); |
102 | 104 |
103 // Fallback to false if we fail to read meminfo | 105 // Fallback to false if we fail to read meminfo |
104 // for some reason. | 106 // for some reason. |
105 if (memSize == 0) { | 107 if (memSize == 0) { |
106 Log.w(LOGTAG, "Could not compute system memory. Falling back to isLo
wMemoryPlatform = false."); | 108 Log.w(LOGTAG, "Could not compute system memory. Falling back to isLo
wMemoryPlatform = false."); |
107 return false; | 109 return false; |
108 } | 110 } |
109 | 111 |
110 return memSize < LOW_MEMORY_THRESHOLD_MB; | 112 return memSize < LOW_MEMORY_THRESHOLD_MB; |
111 } | 113 } |
112 } | 114 } |
OLD | NEW |