diff options
author | Tarun Nainani <tnainani@codeaurora.org> | 2015-03-11 16:24:06 -0700 |
---|---|---|
committer | WebTech Code Review <code-review@localhost> | 2015-04-24 16:33:41 -0700 |
commit | 814f80e9a3b164db54966373b08ba7bab59f5dbe (patch) | |
tree | ea4f8322cc15a481bf1b13294725e29950f751c3 | |
parent | f9cb0cb7cee31ea03beeca23bc396d44de3f2a8f (diff) | |
download | android_packages_apps_Gello-814f80e9a3b164db54966373b08ba7bab59f5dbe.tar.gz android_packages_apps_Gello-814f80e9a3b164db54966373b08ba7bab59f5dbe.tar.bz2 android_packages_apps_Gello-814f80e9a3b164db54966373b08ba7bab59f5dbe.zip |
Add resource to control minimum number of active tabs
'feature_min_active_tabs'- min number of active tabs. By default
we keep number of active tabs as two for all devices including
low tier.
CR-Fixed: 804114
Change-Id: I085bf1d44b2f9e84adefb8180933a96c1d376323
-rw-r--r-- | res/values/integers.xml | 4 | ||||
-rw-r--r-- | src/com/android/browser/MemoryMonitor.java | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/res/values/integers.xml b/res/values/integers.xml index 84c48be9..8758f9d8 100644 --- a/res/values/integers.xml +++ b/res/values/integers.xml @@ -34,4 +34,8 @@ <integer name="titlebar_animation_duration">200</integer> <integer name="netswitch_type_remind">1</integer> <item type="fraction" format="fraction" name="menu_animation_pivot_x">95%</item> + + <!-- MemoryMonitor minimum number of active tabs --> + <integer name="feature_num_min_active_tabs">2</integer> + </resources> diff --git a/src/com/android/browser/MemoryMonitor.java b/src/com/android/browser/MemoryMonitor.java index f5245a90..62bfe991 100644 --- a/src/com/android/browser/MemoryMonitor.java +++ b/src/com/android/browser/MemoryMonitor.java @@ -84,15 +84,7 @@ public class MemoryMonitor { * memory class. */ private static int getMaxActiveTabs(Context context) { - // We use device memory class to decide number of active tabs - // (minimum memory class is 16). - ActivityManager am =(ActivityManager)context. - getSystemService(Context.ACTIVITY_SERVICE); - if (am.getMemoryClass() < 33) { - return 1; // only 1 Tab can be active at a time - } - else { - return 2; // atleast 2 Tabs can be active at a time - } + return context.getResources() + .getInteger(R.integer.feature_num_min_active_tabs); } } |