Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11a40a04 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Make Utils.getDeviceOverrideValue aware of device orientation

Bug: 6277225
Change-Id: If41fe5cbee0985b9a4740dcd5d1c6ba73b94b377
parent 423b30d5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -466,11 +466,12 @@ public class Utils {
    }

    private static final String HARDWARE_PREFIX = Build.HARDWARE + ",";
    private static final HashMap<Integer, String> sDeviceOverrideValueMap =
            new HashMap<Integer, String>();
    private static final HashMap<String, String> sDeviceOverrideValueMap =
            new HashMap<String, String>();

    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)) {
            String overrideValue = defValue;
            for (final String element : res.getStringArray(overrideResId)) {