Make Utils.getDeviceOverrideValue aware of device orientation

Bug: 6277225
Change-Id: If41fe5cbee0985b9a4740dcd5d1c6ba73b94b377
This commit is contained in:
Tadashi G. Takaoka 2012-04-16 12:59:55 +09:00
parent 423b30d59c
commit 11a40a047f

View file

@ -466,11 +466,12 @@ public class Utils {
} }
private static final String HARDWARE_PREFIX = Build.HARDWARE + ","; private static final String HARDWARE_PREFIX = Build.HARDWARE + ",";
private static final HashMap<Integer, String> sDeviceOverrideValueMap = private static final HashMap<String, String> sDeviceOverrideValueMap =
new HashMap<Integer, String>(); new HashMap<String, String>();
public static String getDeviceOverrideValue(Resources res, int overrideResId, String defValue) { public static String getDeviceOverrideValue(Resources res, int overrideResId, String defValue) {
final Integer key = overrideResId; final int orientation = res.getConfiguration().orientation;
final String key = overrideResId + "-" + orientation;
if (!sDeviceOverrideValueMap.containsKey(key)) { if (!sDeviceOverrideValueMap.containsKey(key)) {
String overrideValue = defValue; String overrideValue = defValue;
for (final String element : res.getStringArray(overrideResId)) { for (final String element : res.getStringArray(overrideResId)) {